× 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.



Lloyd,

Try to run the Index Advisor in VE to see what does it suggest for an index.
Also, as up to V5R3 (sorry, my system's release), AFAIK there is no way to
specify an index "hint".

As per "any gotchas", you can always define your working environment (date
formats, naming conventions, etc) in your SQLRPGLE program with the SET
OPTION statement, so I don't see why it should be any different than running
it under STRSQL

Regards,

Luis Rodriguez
IBM Certified Systems Expert — eServer i5 iSeries
--



On Mon, Jul 26, 2010 at 10:40 AM, Loyd Goodbar <loyd@xxxxxxxxxxxxxx> wrote:

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
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



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.