Maintenance overhead increases with the number of indexes. We recommend that you drop unnecessary indexes.
Use the ALTER TABLE statement to drop an index
Syntax:
obclient> ALTER TABLE table_name DROP KEY|INDEX index_name;
Parameters:
table_name: the name of the table from which the index is to be dropped.KEY|INDEX: indicates that you can use either theINDEXor theKEYkeyword in the statement.index_name: the name of the index to be dropped.
Example: Use the ALTER TABLE statement to drop an index.
obclient> ALTER TABLE t3 DROP KEY t3_uk, DROP KEY t3_ind3;
Query OK, 0 rows affected
Use the DROP INDEX statement to drop an index
Syntax:
obclient> DROP INDEX index_name ON table_name;
Parameters:
index_name: the name of the index to be dropped.table_name: the name of the table from which the index is to be dropped.
Example: Use the DROP INDEX statement to drop an index.
obclient> DROP INDEX t3_ind3 ON t3;
Query OK, 0 rows affected
More information
For more information about indexes of OceanBase Database in MySQL mode, see the following topics: