When you say "primary" key, is it actually what that means? The key you have on a PF in DDS is not, strictly speaking, the primary key. For one thing, it does not need to be unique, and a primary key does. Primary keys were brought into the 400 as part of what is called referential integrity. They are attached to PFs using the ADDPFCST command or an SQL command.

Having said that, it's possible that the optimizer had to create a temporary index or file and made the recommendation based on that. Your existing index is not considered a candidate, as it is not an index on the temporary file.

Look for the reasons for the choices made - often you get a hint of what to do.

HTH
Vern

At 08:12 PM 3/24/2004 -0500, you wrote:

hey all,

here's a puzzler.

I've got a rather complicated opnqryf join, that has selection criteria for
both files, one of which is on a %sst of an alpha field.  It's a dog,
mostly because the files are really large.

I ran the thing under debug to see what the query optimizer tells me, and
lo and behold, it told me to build indexs over the files.

problem is, the index it told me to build over one of them is EXACTLY the
primary key of the physical.

now, why would it want me to do that?

any would be appreciated...

Rick



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