The maintenance overhead increases with the number of indexes. You can drop unnecessary indexes based on your needs.
Use the ALTER TABLE statement to drop an index
The syntax is as follows:
obclient> ALTER TABLE table_name DROP KEY|INDEX index_name;
where
table_namespecifies the name of the table from which the index is to be dropped.KEY|INDEXindicates that you can use either theINDEXor theKEYkeyword in the statement.index_namespecifies 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
The syntax is as follows:
obclient> DROP INDEX index_name ON table_name;
where
index_namespecifies the name of the index to be dropped.table_namespecifies 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
References
For more information about indexes supported by the MySQL mode of OceanBase Database, see the following topics: