Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: controlling order of indexes used
The simplest 'general purpose' approach is to
put the tables in the FROM clause in the order that you
feel they should be visited , and then use the 'ordered'.
In a large percentage of cases, this is sufficient to make Oracle do what you want. It certainly sounds as if (combined with your index hints) it would solve your problem.
Jonathan Lewis
Yet another Oracle-related web site: www.jlcomp.demon.co.uk
bdg_at_hotmail.com wrote in message <79i2ei$ajg$1_at_nnrp1.dejanews.com>...
>Hello,
>
>Is it possible to control the order of indexes used?
>
>I have a couple of very similar queries. The only difference is that one
>contains a where condition of "column=value" and the other contains a
>condition of "column in (value1,value2)". The first version returns very
>quickly (~1 second) and the other takes ~9 minutes. Originally, the
explain
>plan indicated that different indexes were being used. I've added hints to
>the second query to force the use of the same indexes. This made the second
>query return in ~52 seconds. Now it looks like the explain plan is using
the
>queries in a different order.
>
>Any pointers or references to documentation appreciated.
>
>Thanks,
>Brian Gastineau
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Sat Feb 06 1999 - 12:54:52 CST