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;
The relevant parameters are described as follows:
table_name: Specifies the name of the table from which you want to drop an index.KEY|INDEX: Indicates that you can use eitherINDEXorKEYas the index keyword in this statement.index_name: Specifies the name of the index to be dropped.
The following example shows how to use the ALTER TABLE statement to drop an index from a table:
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;
The relevant parameters are described as follows:
index_name: Specifies the name of the index to be dropped.table_name: Specifies the name of the table from which you want to drop the index.
The following example shows how to 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 in MySQL-compatible mode, see the following topics: