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



Have a performance problem on a iSeries I don't know how to address...
Running V5R2, lastest Cum and Group PTF's (DB, ...)

For some reason neither SQL nor Query/400 seem to honour available indexes (LFs)
As a sample case, running a
"Select * from myFileLxx where Field1 = xxx and Field2 = yyy"
or same kind of search with a Query/400


will always use the Physical file (sequential file) even though there are some different (several...) logical files (LFs) that have fields Field1 and Field2 as the first keys! (plus other different fields in each case).

Trying same Select from either the Physical or from any of the mentioned Logicals produce same "sequential proccess" from the Physical! (to be exact, if Logicals used, then it points to "arrival sequence" for that Logical, which obviously means same for the Physical, isn't it?)

Running in Debug mode, in all cases I find the CPI432C message froom the Optimizer, saying
"All available access paths have been examined"
followed by the resulting code for each one of them.
The interesting Logicals I would have expected to be used give a 4 result value, which means
"The cost for using this access path as determined by the Optimizer would be greater than the selected method..."
which in the end gives processing the Logical/Physical sequentially!


The Physical file has about 5,000,000 records.
The logicals I would have expected to be used have
- Field1 and Field2 as the first key fields
- NO select/omit at all, neither specific nor implied, nor Dynamic

Trying Select with "order by Field1, Field2" does not produce any difference.

Query Options QAQQINI file exists in QSYS and QUSRSYS, in both cases with al entries set to *DEFAULT values. Used file is QUSRSYS's.

System values:
- QQRYDEGREE    : *OPTIMIZE
- QQRYTIMLMT        : *NOMAX

Tried same selects thru Op'sNavigator running SQL scripts to look thru the Performance Supervisors, with same results.

Is there any obvious (or not so obvious...) reason for the Optimizer NOT using available indexes?
If a file is being journalled with Commit/Rollback, does this prevent using an index?


The logicals I'm referring to are in good shape (not damaged or something like that...) since they are being used by normal programs running without problems!

I just cannot imagine any reason for this behaviour...

Any ideas will be appreciated! TIA

--
Antonio Fernandez-Vicenti
afvaiv@xxxxxxxxxx



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.