× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I don't see anything you've done that would cause this. But is there a specific reason you chose to do an index vs a logical file? If is because you wanted to take advantage of the SQL's default page size... then can I point out the PAGESIZE keyword on the CRTLF command? You can specify 64 in this keyword to get the SQL's default page size.


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Loyd Goodbar
Sent: Monday, July 26, 2010 11:11 AM
To: Midrange Systems Technical Discussion
Subject: Using an SQL index over DDS file?

I created an index in our test environment to support a SELECT DISTINCT
query. The file has 4 milion rows in test, and 8 million rows in production.
The file is DDS-defined.

The index is in test, but Visual Explain says a table scan will be
performed, with the reason "No indexes exist". The query asks for the same
columns as the index, and in the same order. DSPDBR reports the index is
associated with the base file. I'm using the iNav "Run SQL Scripts".

Here is the index and query:
create index prod_mod.iml10026 on prod_mod.imp1001 (i1azcd asc, i1date asc,
i1time asc, i1badt asc);
select distinct i1azcd as location, i1date as observationdate, i1time as
observationtime, i1badt as costdate from prod_mod.imp1001;

The query will be utilized in embedded SQL in an RPGLE program.

Is there anything I can do to influeunce how the query performs, to say "use
this index"? This would be similar to SQL Server "hints". Is this a CQE vs.
SQE issue? Are there any gotchas between running the query in Run SQL
Scripts versus an embedded SQLRPGLE, other than naming convention and
date/time formats?
All is on V5R4.

Thanks,
Loyd

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.