Creating access paths (DDS described logical files or even better SQL
indexes) is always a good idea when working with large files in composition
with SQL.
While DDS is an outdated technology you should intent to create SQL indexes
instead, which are much more powerful.
... even though indexes cannot be specified in an SQL statement, they can be
used with native I/O like any keyed logical file.

Specifying a DDS described logical file in a SQL statement is not a good
idea (and never was).
The SQL optimizer will first analyze the DDS description of the logical
file, take the selected columns, join information, select omit/clauses (NOT
the key information) and rewrites the SQL statement based on this
After optimization starts at that time the optimizer does not know that
there was a logical file with a specific key defined.
The query optimizer estimates (all) existing access path (SQL indexes and
logical files), based on the joins, where conditions, group by conditions
(and sometimes even order by clause) and interviews the statistics manager
(which provides information about the data composition). If up to ~15% of
the data of the table are selected the optimizer may use an existing access

If the specified DDS described logical file is taken it is nothing else than
by hazard. (In this way if you need the rows to be returned in a specific
sequence, you need to add an order by clause).
... and even worse before release 7.1 TR 7 or 8 DDS analysis could only be
performed by the CQE optimizer, so the queries could not profit from the
newer SQE.

There is a nice whitepaper about indexing and statitisc strategies written
by Kent Milligan and Mike Cain, which should be learned "by heart".
Here is the link:

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"

-----Ursprüngliche Nachricht-----
Von: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von
Booth Martin
Gesendet: Thursday, 03.9 2015 22:15
An: Midrange Systems Technical Discussion
Betreff: SQL sort

I am fairly new with SQL so please excuse what are most likely very simple

I am looking to understand the pros and cons with SQL.
On large files with data that will be used in various applications and in
various sort-by schemes, are logical files a help?
If so, does one reference the physical file and then SQL finds the best
logical, or does it help to specify a specific logical file?
What is the right way to collect a set of records equal to SFLPAGE?

So far, I believe my biggest problem is that I haven't yet figured out how
to ask the right questions.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

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