That's one of the indexes you ALWAYS want to build. The Optimizer may well
use it for statistics (data skew). Or it may want to use an index from index
access method or whatever.
Or do you mean you have already created the index? That can happen too. When
the optimizer looks for an index, it may use different criteria or time out
before it gets to the right one. These rules are different depending which
version of the OS/400 you have. Sometimes it searches fifo, sometimes the
other way, etc.
If the file is really huge you could also try creating an EVA index.
If you are on V5R2 there are now two different SQL Optimizers with different
rules, and a new statistics gatherer.
If you're in the US, I believe IBM do workshops on this subject....

cheers,

Clare

Clare Holtham
Director, Small Blue Ltd - Archiving for BPCS
Web: www.smallblue.co.uk
IBM Certified AS/400 Systems Professional
E-Mail: Clare.Holtham@xxxxxxxxxxxxxxx
Mobile: +44 (0)7960 665958

----- Original Message -----
From: <rick.baird@xxxxxxxxxxxxxxx>
To: <midrange-l@xxxxxxxxxxxx>
Sent: Thursday, March 25, 2004 1:12 AM
Subject: Query optimizer tells me to build an access path that already
exists


>
> 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
>
>
> _______________________________________________
> This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
> To post a message email: MIDRANGE-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/midrange-l
> or email: MIDRANGE-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/midrange-l.
>



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