Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Indexes and Where clauses
> In order to ensure that an index gets used in a query, does the column is
> position one of the index have to be in the where clause?
>
> For instance. If I have an index like the following:
> INDEX_NAME COLUMN_NAME COLUMN_POSITION
> ----------- ----------- ---------------
> INDEX1 KEY_1 1
> INDEX1 KEY_2 2
>
> Will INDEX1 be used if only KEY_2 is specified in the where clause?
No. The index can only be used if the where clause includes key_1. It could also be used if the where clause specified only key_1. The reason is because the index B-tree is built using the concatenation of all the index columns in order. Received on Fri Aug 01 1997 - 00:00:00 CDT
![]() |
![]() |