Tuesday, February 4, 2014

Oracle composite index

A composite index contains more than one key column. Composite indexes can provide additional advantages over single-column indexes:
1. Improved selectivity
   Sometimes two or more columns or expressions, each with poor selectivity, can be combined to form a composite index with higher selectivity.
2. Reduced I/O
If all columns selected by a query are in a composite index, then Oracle can return these values from the index without accessing the table.

A SQL statement can use an access path involving a composite index if the statement contains constructs that use a leading portion of the index.
A leading portion of an index is a set of one or more columns that were specified first and consecutively in the list of columns in the CREATE INDEX statement that created the index. Consider this CREATE INDEX statement:
CREATE INDEX comp_ind  ON table1(x, y, z);
x, xy, and xyz combinations of columns are leading portions of the index
yz, y, and z combinations of columns are not leading portions of the index
http://docs.oracle.com/cd/B10500_01/server.920/a96533/data_acc.htm#2174

No comments:

Post a Comment