13.1.27 DROP INDEX Statement语句

DROP INDEX index_name ON tbl_name
    [algorithm_option | lock_option] ...
algorithm_option:
    ALGORITHM [=] {DEFAULT | INPLACE | COPY}
lock_option:
    LOCK [=] {DEFAULT | NONE | SHARED | EXCLUSIVE}

DROP INDEX drops the index named index_name from the table tbl_name. DROP INDEX从表tbl_name中删除名为index_name的索引。This statement is mapped to an ALTER TABLE statement to drop the index. 此语句映射到ALTER TABLE语句以删除索引。See Section 13.1.9, “ALTER TABLE Statement”.请参阅第13.1.9节,“ALTER TABLE语句”

To drop a primary key, the index name is always PRIMARY, which must be specified as a quoted identifier because PRIMARY is a reserved word:若要删除主键,索引名始终为PRIMARY,必须将其指定为带引号的标识符,因为PRIMARY是保留字:

DROP INDEX `PRIMARY` ON t;

Indexes on variable-width columns of NDB tables are dropped online; that is, without any table copying. NDB表的可变宽度列上的索引在线删除;也就是说,没有任何表复制。The table is not locked against access from other NDB Cluster API nodes, although it is locked against other operations on the same API node for the duration of the operation. 该表不针对来自其他NDB群集API节点的访问而锁定,尽管在操作期间,它针对同一API节点上的其他操作而锁定。This is done automatically by the server whenever it determines that it is possible to do so; you do not have to use any special SQL syntax or server options to cause it to happen.只要服务器确定可以这样做,它就会自动完成此操作;您不必使用任何特殊的SQL语法或服务器选项来实现它。

ALGORITHM and LOCK clauses may be given to influence the table copying method and level of concurrency for reading and writing the table while its indexes are being modified. 在修改表的索引时,可能会给出ALGORITHMLOCK子句来影响表复制方法和读写表的并发级别。They have the same meaning as for the ALTER TABLE statement. 它们与ALTER TABLE语句的含义相同。For more information, see Section 13.1.9, “ALTER TABLE Statement”有关更多信息,请参阅第13.1.9节,“ALTER TABLE语句”

MySQL NDB Cluster supports online operations using the same ALGORITHM=INPLACE syntax supported in the standard MySQL Server. MySQL NDB Cluster支持使用标准MySQL服务器中支持的相同ALGORITHM=INPLACE语法进行在线操作。See Section 23.5.11, “Online Operations with ALTER TABLE in NDB Cluster”, for more information.更多信息,请参阅第23.5.11节,“NDB集群中ALTER TABLE的在线操作”