Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: indexes]
If your where clause is going to search on A and C, then to be
reasonably sure of using that index you would place a dummy clause
in the where clause
eg
and B > ' ' or and B >-1
this would ensure that the A,B,C index should be used, depending on the optimiser mode and other indexes available.
If you use
and A = .... and C = ....
You would need to bear in mind as well that the sorted result of A,B,C might not be very performance enhancing for a retrieval of A,C depending on the A,B set size as all B's within a single A.
Hope it helps,
Rod
-- Rod Corderey Lane Associates RodCorderey_at_Lane-Associates.com http://www.Lane-Associates.comReceived on Thu May 11 2000 - 11:01:39 CDT
> Webber Valerie H wrote:
>
> I know this issue has been discussed before but I can't find the answer
> in my list archives.
>
> If you have a composite index on a table consisting of columns A,B,C in
> that order, will the index be used if I have a query/where clause on
> columns A and C?
>
> I know that it will if I query on A alone or A,B or A,B,C but I can't
> find documentation about A and C (no B)
>
> Thanks in advance!
> Val
>
> Valerie H. Webber
> Management Systems Designers, Inc
> Valerie.H.Webber_at_m1.irs.gov
![]() |
![]() |