• Subject: Re: SQL Cursor Questions
  • From: pytel@xxxxxxxxxx
  • Date: Thu, 18 Nov 1999 20:25:05 -0600

> However, even though
> I'm selecting records from a keyed logical file, the records are ordered
> the physical file's RRN order.  In other words, the access path
> with the logical file is not used.  When I execute the very same
> interactively, it uses the access path of the logical.  The only
> is the cursor is not used in the interactive version.  Is this normal
> operation for cursors or am I doing something wrong? I know I can use an
> Order by clause to put the records in the same order as the logical is
> keyed, but why doesn't it use the logical's access path in the first

SQL does not care, whether you address PF or LF - it will always use
underlying data in the way it considers is most optimal.
The difference between SQL in interactive session and SQL imbedded in a
program is that optimization goals are slightly different.
By defaut, interactive SQL is biased to returning first screenful of data
as fast as possible, and imbedded SQL is geared to reduce entire processing
time. This will explain why access path was used for interactive and not
for batch - arrival access path may be more efficient if large subset of
file records is selected.

Best regards
    Alexei Pytel

| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@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-2020 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].