Skip to content

DROP INDEX

DROP INDEX removes an index definition and its rebuildable storage.

DROP INDEX [IF EXISTS] index_name ON table_name

The 1.2 execution contract requires the ON table clause even though the parser can represent an omitted table name. IF EXISTS suppresses a missing-index error.

index_name identifies the index and table_name fixes its owning table.

Success returns a command result with no rows. SHOW INDEXES confirms the remaining definitions.

Index removal is transactional. ROLLBACK keeps the prior index visible.

Omitting ON table_name is rejected in 1.2. A mismatched table, missing index without IF EXISTS, or attempt to remove an implicit primary-key structure fails.

The effective Principal must own the index; the session also needs CONNECT.

CREATE TABLE ref_drop_index (id INTEGER PRIMARY KEY, code TEXT);
CREATE INDEX ref_drop_code_idx ON ref_drop_index (code) USING BTREE;
DROP INDEX ref_drop_code_idx ON ref_drop_index;
SHOW INDEXES FROM ref_drop_index;

See Indexes, CREATE INDEX and ALTER INDEX.