当索引过多时,维护开销增大,因此,需要删除不必要的索引。
格式
DROP INDEX indexname
ON tblname;
示例
DROP INDEX test_index ON test;
报错
语法错误时报
ERROR 1064 (42000): You have an error in your SQL syntax;
输入表名错误时,报
ERROR 1146 (42S02): Table 'XXX' doesn't exist
输入表名过长,报
ERROR 1059 (42000): Identifier name 'XXX' is too long
输入索引错误,报
ERROR 1091 (42000): Can't DROP 'XXX'; check that column/key exists