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 J. Malley <mmalley_at_radiks.net>
Date: 1997/08/01
Message-ID: <01bc9e11$51890c60$364303cf@gateway>#1/1

> 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

Original text of this message

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