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



Could be many reasons. The query optimizer makes predictions based on
several criteria such as the type of selection clauses you use (=, >, <,
etc.), fields in order by or group by clauses, and on and on.

If you are not specifying an order by clause, you MAY be able to force
the optimizer to use a certain access path by including an order by
clause that matches the key sequence.

Also, you can often force the optimizer to use a particular access path
by selecting only those fields in the access path rather than using
Select *.

It's a complex beast - too complex to fully explain here.

Gary Guthrie
Senior Technical Editor, iSeries NEWS




"Smith, Mike" wrote:
>
> I have an embedded SQL program that I have noticed a delay on the OPEN
> CURSOR.  After running it through debug, i find that it is creating a
> 'Temporary result file' CPI4325 with reason code of '7' which says that the
> optimizer decided to do a sort rather than an access path.
> The file has a Key on it, in the order that i have selected on my SQL
> statement.  So i thought(ok, it doesn't like the key on the physical.) SO i
> created a logical file with the proper key.  I still get the same thing
> happening.
>
> Does any one have any ideas.
>
> Why is it not using the access path of my logical?
> suggesstions!!


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.