Create index
Indexes can be created by
CREATE INDEX INDEX_NAME ON TABLE_NAME (COL1(10) ASC,COL2(30) DESC);
# create an index on COL1 using first 10 bytes in acceding order, and COL2 using first 30 bytes in descending order.
Query existing indexes
SHOW INDEX FROM TABLE_NAME;
Drop an index
DROP INDEX INDEX_NAME ON TABLE_NAME;
Rebuild an index
repair TABLE xxx.table1 quick;
Locate indexes
SELECT TABLE_SCHEMA, TABLE_NAME, INDEX_NAME, INDEX_TYPE FROM statistics;
There are no comments on this page. [Add comment]