Re: oracle indexes

From: DA Morgan <>
Date: Thu, 05 Jun 2008 09:36:53 -0700
Message-ID: <>

doug wrote:
> Hello,
> Say If I have a table with column a, and column b (say they are
> integers).
> Sometimes I will do a query with a where clause that just references
> column a.
> Sometimes I will do a query with a where clause that references both
> column a and b.
> Is there a need to create an index with a, and an index with a, b? Or
> will an index with a,b work for both of the above types of queries?
> I know in mysql if I have an index (a, b, c), then it is useful for
> queries referencing a or a,b or a, b,c. But, I am not as familiar
> with how Oracle indexes work.
> Thanks.

Assuming a currently supported version of Oracle it works the same way. It will even in many cases support a query on b and b,c that does not include a.

But you have, for some reason, not provided version information so this response is purely generic.

Oracle changes, often dramatically from version to version with respect to specific functionality. Always, when asking Oracle questions include full version information ... 3+ decimal places.

Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington (replace x with u to respond)
Puget Sound Oracle Users Group
Received on Thu Jun 05 2008 - 11:36:53 CDT

Original text of this message