CREATE INDEX: (help create index;)
CREATE INDEX IndexName on TableName (Coll,coll ...);
ALTER TABLE tableName ADD INDEX indexname (coll,coll);
eg
Federated Index:
Create INDEX sage_sdept on student (SAGE,SDPT (10))
Create INDEX d_a_p on student (Dateline,ader (), POS (20));
To delete an index:
ALTER TABLE tableName DROP indexname;
DROP INDEX indexname on TableName;
To view the index of a table:
Mysql> Show index from proc;
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+--- ---+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | index_comment |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+--- ---+------------+---------+---------------+
| Proc | 0 | PRIMARY | 1 | db | A | NULL | NULL | NULL | | BTREE | | |
| Proc | 0 | PRIMARY | 2 | name | A | NULL | NULL | NULL | | BTREE | | |
| Proc | 0 | PRIMARY | 3 | Type | A | 48 | NULL | NULL | | BTREE | | |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+--- ---+------------+---------+---------------+
3 Rows in Set (0.00 sec)
MySQL Statement index operation