Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Indexes and Where clauses
On 31 Jul 1997 22:31:09 GMT, jck4_at_msg.ti.com (Lilyan Jackson) wrote:
>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?
In order to assure an index is used, you can use the following directive:
select /*+ INDEX(<indexname>) */ .... <type the rest of your query>
>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, because it has the second position in your indexkey.
![]() |
![]() |