|
John, In a message dated 97-12-06 18:02:31 EST, you write: > <SNIP> (Actually, I wrote) > 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. > <SNIP> > 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." Darn, I knew _that_ -- I just keep forgetting these aritrary rules! At least my statement that the specified logical may not be used was correct... > So I guess it's the Newest to Oldest. Yep, that's why we use the physical. Even if you verify via STRDBG that the correct logical was chosen by your program, a later compile of a logical can upset the entire apple cart. Regards! Dean Asmussen Enterprise Systems Consulting, Inc. Fuquay-Varina, NC USA E-Mail: DAsmussen@aol.com "Mondays are the potholes in the road of life." -- Tom Wilson +--- | 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 +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.