Home » SQL & PL/SQL » SQL & PL/SQL » index
index [message #19559] Thu, 28 March 2002 02:50 Go to next message
jaffer
Messages: 1
Registered: March 2002
Junior Member
if there are 5 fields in a table
and i create index with 3 fields
whether it is necessary to use all the 3 fields in hte where condition to use the index i created
Re: index [message #19560 is a reply to message #19559] Thu, 28 March 2002 04:19 Go to previous message
John R
Messages: 156
Registered: March 2000
Senior Member
In Oracle 8i and earlier, as long as you use the first fields in the index, the index will be used.

Eg:

Your index is on columns Col_1, Col_2 and Col_3, in that order.

A query specifying Col_1 and Col_2 will use the index.
A query specifying Col_1 and Col_3 will use the index, but only for the value of Col_1
A query specifying Col_2 and Col_3 will be unable to use the index.
Previous Topic: downgrading data from oracle 8i to oracle 8.0.5
Next Topic: Oracle errors
Goto Forum:
  


Current Time: Fri Mar 29 01:46:47 CDT 2024