Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How can I optimize a query on two indexed columns?
If you are using the cost-based optimizer (ie. if your tables are analyzed),
the optimizer should pick the index for the column that has the highest
selectivity. You must be using the rule-based optimizer, because it would
pick the index for the first column listed in the WHERE clause. So:
Hope this helps,
Dave Sisk
José Lima Suárez wrote in message <6hb66o$s5b$1_at_diana.bcn.ibernet.es>...
>Hi,
>
>I have a query like this:
>
>select col1, col2
>from tab1
>where col1 = 'x' and col2 = 'y'
>
>and both col1 and col2 have differents indexes, col1 has a lot of rows per
>value so if Oracle uses this index is slowly than if uses the col2 index
>(that has a few rows per value).
>
>is there any way to force the index to use in the query execution?
>
>Thanks...
>
>
>
Received on Sat Apr 18 1998 - 20:55:53 CDT
![]() |
![]() |