Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Query tuning experts: Any hope for tuning query with 5+ joins and a sort?

Re: Query tuning experts: Any hope for tuning query with 5+ joins and a sort?

From: Nuno Souto <nsouto_at_optushome.com.au.nospam>
Date: Sun, 3 Nov 2002 10:09:50 +1100
Message-ID: <3dc45dc9$0$18869$afc38c87@news.optusnet.com.au>


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.nospam
Received on Sat Nov 02 2002 - 17:09:50 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US