Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Indexes and Where clauses

Re: Indexes and Where clauses

From: Martin Jesterhoudt <martinj_at_worldonline.nl>
Date: 1997/08/01
Message-ID: <33e25167.2908562@news.worldonline.nl>#1/1

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.


Received on Fri Aug 01 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US