Professional Documents
Culture Documents
INDEXES
To speed up SQL statement execution on a table
Without an index, Oracle will do a full table search
Indexes are most useful on larger tables, on columns that are
likely to appear in where clauses as simple equality
ALL_INDEXES
DBA_INDEXES
USER_INDEXES
ALL_IND_COLUMNS
DBA_IND_COLUMNS
USER_IND_COLUMNS
UNIQUE INDEX
NON-UNIQUE INDEX
COMPOSITE INDEX
FUNCTIONBASED INDEX
BTREE INDEX
BITMAP INDEX
Ex:
create unique index idx_empno on emp(empno);
Ex:
create index idx_job on emp(job);
Ex:
create index idx_ename on emp(upper(ename));
Ex:
create index idx_empno on emp(empno);
When a table has millions of rows and the key columns have
low cardinality.
When queries often use a combination of multiple WHERE
conditions involving the OR operator
When there is read-only or low update activity on the key
columns
Ex:
create bitmap index idx_job on emp(job);