To delete an index definition from the store, use a DROP INDEX
statement. Its form when deleting an index is:
DROP INDEX [IF EXISTS] index-name ON table-name
where:
IF EXISTS
is optional, and it
causes the DROP INDEX
statement to
be ignored if an index by that name does not exist.
If this phrase is not specified, and an index using the
specified name does not exist, then the
DROP INDEX
statement will fail
with an error.
index-name is the name of the index you want to drop.
table-name is the name of the table containing the index you want to delete.
For example, if table Users
has an index
called surnameIndex
, then you can delete it
using the following statement:
DROP INDEX IF EXISTS surnameIndex ON Users