DROP INDEX
You are viewing an old version of this article. View
the current version here.
Syntax
DROP [ONLINE|OFFLINE] INDEX index_name ON tbl_name [algorithm_option | lock_option] algorithm_option: ALGORITHM [=] {DEFAULT|INPLACE|COPY} lock_option: LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}
Description
DROP INDEX
drops the index named index_name
from the table tbl_name
.
This statement is mapped to an ALTER TABLE
statement to drop the
index.
If another connection is using the table, a metadata lock is active, and this statement will wait until the lock is released. This is also true for non-transactional tables.
See ALTER TABLE
.
Another shortcut, CREATE INDEX
, allows the creation of an index.
The ONLINE
and OFFLINE
clauses have been removed in MariaDB 10.0.
To remove the primary key, `PRIMARY`
must be specified as index_name. Note that the quotes are necessary, because PRIMARY
is a keyword.
Since MariaDB 5.3 this statement supports progress reporting.
Comments
Comments loading...
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.