DROP INDEX

Documentation

VoltDB Home » Documentation » Using VoltDB

DROP INDEX

DROP INDEX — Removes an index.

Synopsis

DROP INDEX index-name [IF EXISTS]

Description

The DROP INDEX statement deletes the specified index, and any data associated with it, from the database. The IF EXISTS clause allows the statement to succeed even if the specified index does not exist. If the index does not exist and you do not include the IF EXISTS clause, the statement will return an error.

You must use the name of the index as specified in the original DDL when dropping the index. You cannot drop an index if it was not explicitly named in the CREATE INDEX command. This is why you should always name indexes and other constraints wherever possible.

Examples

The following example removes the index named employee_idx_by_lastname:

DROP INDEX Employee_idx_by_lastname;