Oracle® Database Administrator's Guide 11g Release 2 (11.2) Part Number E10595-04 |
|
|
View PDF |
To drop an index, the index must be contained in your schema, or you must have the DROP ANY INDEX
system privilege.
Some reasons for dropping an index include:
The index is no longer required.
The index is not providing anticipated performance improvements for queries issued against the associated table. For example, the table might be very small, or there might be many rows in the table but very few index entries.
Applications do not use the index to query the data.
The index has become invalid and must be dropped before being rebuilt.
The index has become too fragmented and must be dropped before being rebuilt.
When you drop an index, all extents of the index segment are returned to the containing tablespace and become available for other objects in the tablespace.
How you drop an index depends on whether you created the index explicitly with a CREATE INDEX
statement, or implicitly by defining a key constraint on a table. If you created the index explicitly with the CREATE INDEX
statement, then you can drop the index with the DROP INDEX
statement. The following statement drops the emp_ename
index:
DROP INDEX emp_ename;
You cannot drop only the index associated with an enabled UNIQUE
key or PRIMARY KEY
constraint. To drop a constraints associated index, you must disable or drop the constraint itself.
Note:
If a table is dropped, all associated indexes are dropped automatically.See Also:
Oracle Database SQL Language Reference for syntax and restrictions on the use of the DROP INDEX
statement
"Making an Index Invisible" for an alternative to dropping indexes