Skip to main content

DROP INDEX

Remove an index from the database. The underlying table and its data are not affected.

Syntax

Description

DROP INDEX removes a previously created index. After the index is dropped, the query planner can no longer use it to optimize queries. The table data is unchanged.

Parameters

Behavior

  • Only explicitly created indexes can be dropped. Indexes automatically created for PRIMARY KEY and UNIQUE constraints cannot be dropped directly — drop the table or use ALTER TABLE instead.
  • Dropping an index may degrade query performance for queries that relied on it, but does not affect correctness.

Examples

Drop an Index

Drop an Index Only if It Exists

Drop an Index in an Attached Database

See Also