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



You have a select/omit logical file and are querying it directly and s/o
criteria is not honored?
Barring some humongous hole in the OS, that is not possible.

Double check your data and s/o criteria.  Simplest recreate might be to run
that same select in interactive SQL and see what you get.

Did she compile the LF after changing DDS?

As for the actual implementation of the query... you cannot force query
optimizer to pick the index contained in the s/o itself.  It'll guarantee
s/o criteria is honored, but not what implementation method it'll use.
It'll use one that it thinks is best.
Does this select return more than 20% of the rows?  I think that's where
query optimizer switches to table scan method, as it performs better for
queries returning more than 20% of the rows in the table.
There are many other reasons why the index in s/o LF would not be the best
way to implement the query (sort sequence, validity of the index itself
etc.).
Regardless of the method of implementation it chooses, data should always be
what you asked for (i.e. fields that should be *OMITted will be).

Elvis

Celebrating 10-Years of SQL Performance Excellence

-----Original Message-----
Subject: SQL Optimizer and LF with *OMIT fields

A co-worker just showed me a problems she's having. She has an LF that has 
*OMIT fields specified to reduce the size of the number of available 
entries in the file. The LF is used in an embedded ILE RPG program, that 
has a "select * from my_LF where insurance_company <> nnn" statement.

In a debug session she noticed that the optimizer chose to do its own 
thing and it read over the entire physical file, and included records that 
were supposed to be ignored (via the *OMIT) specified for the LF. 

So the program is suspect as to the integrity of what SQL will actually 
select. We have a few other programs that use this technique and to my 
knowledge haven't had any other problems of a similar nature.

So.... Is there any way to override the query optimizer so that it will 
always use the actual file/lf specified in the select statement?

Thanks!

Regards, Jerry




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.