• Subject: Re: SQL select via logicals
  • From: John Carr <74711.77@xxxxxxxxxxxxxx>
  • Date: Sat, 6 Dec 1997 15:41:47 -0500

RE:     Re: SQL select via logicals

No, your records will not necessarily be returned based upon the S/O criteria.
SQL evaluates the n (used to be five, may now be ten or more) oldest logical
files by creation date based upon the ORDER BY and WHERE clauses to decide
whether or not it needs to build an access path.  If you have an ORDER BY
statement that doesn't match the WHERE (select/omit) and key of those older
logicals, you may not get the logical specified in your SELECT statement.
Dean Asmussen

Hey Dean

I thought it looked at the oldest first too.  But Kent Milligan of Rochester
DB2/400 said the following;

<Kent Milligan said;>
"A couple of ways to influence the optimizer is by specifying the logical 
file directly on the SQL statement so that the optimizer does look at that
access path first.  The other trick is recreating the index - due to the 
way index information is organized in the underlying database file object
the optimizer is typically given indexes in a most recently created order
(eg, first index examined, tends to be the index most recently created). 
These methods provide ways of influencing the optimizer, but aren't 
guaranteed to work in all cases."

So I guess it's the Newest to Oldest.

John Carr
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to "MIDRANGE-L@midrange.com".
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com

This thread ...


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

This mailing list archive is Copyright 1997-2019 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].