Invisible Indexes in Oracle Database 11g Release 1
Invisible Indexes in Oracle Database 11g Release 1 Oracle 11g allows indexes to be marked as invisible. Invisible indexes are maintained like any other index, but they are ignored by the optimizer unless the OPTIMIZER_USE_INVISIBLE_INDEXES parameter is set to TRUE at the instance or session level. Indexes can be created as invisible by using the INVISIBLE keyword, and their visibility can be toggled using the ALTER INDEX command. CREATE INDEX index_name ON table_name(column_name) INVISIBLE; ALTER INDEX index_name INVISIBLE; ALTER INDEX index_name VISIBLE; The following script creates and populates a table, then creates an invisible index on it. CREATE TABLE ii_tab ( id NUMBER ); BEGIN FOR i IN 1 .. 10000 LOOP INSERT INTO ii_tab VALUES (i); END LOOP; COMMIT; END; / CREATE INDEX ii_tab_id ON ii_tab(id) INVISIBLE; EXEC DBMS_STATS.gather_table_stats(USER, 'ii_tab', cascade=> TRUE); A query using the i...