Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Query tuning experts: Any hope for tuning query with 5+ joins and a sort?
2 Nov 2002 14:46:24 -0800, william milbratz said (and I quote):
> My questions:
> 1) Does the 'hint' mechanism stop working when the number of joins get
> past a certain threshold (i.e. "beyond three joins, you're on your
> own")
No.
>
> 2)What's the best strategy to get a query that uses 5+ joins plus a
> sort to use the indexes for its sorting.
>
Hehehe! This one is fun... ;)
According to Oracle, you cannot use an index to speed up a sort. Not
until the latest versions. Yet most of us have been doing it since
yonks, taking advantage of the optimizer and how it works. A common
technique that works in most versions of Oracle is the usual "where col
>= smallest_possible_value". There are of course others. The hint
INDEX_ASC is one.
-- Cheers Nuno Souto nsouto_at_optusnet.com.au.nospamReceived on Sat Nov 02 2002 - 17:09:50 CST