MySQL index creation syntax, mysql index creation
1. Introduction:
All mysql index column types can be indexed. Using indexes for related classes can improve the performance of select queries.Mysql IndexNumber, which can be the maximum index and the minimum index. Each storage engine supports at least 16 indexes for each table. The index length is 256 bytes.
By default, indexes created for tables of mysim and innodb Storage engine are both btree indexes. Currently, mysql does not support function indexes, but supports leading-edge indexes. It specifies the first N characters of a field.Create an index
2. mysql index creation syntax
CREATE [UNIQUE | FULLTEXT | SPATIAL] INDEX index_name
[Index_type]
ON tbl_name (index_col_name ,...)
[Index_type]
------
Index_col_name:
Col_name [(length)] [ASC | DESC]
Index_type:
USING {BTREE | HASH | RTREE}
Note: If you make a mistake when creating an index, You need to modify the mysql index. We can use alert to modify the index.Create indexWe will not talk about it. You can check the relevant manual.
3. Index deletion Syntax:
Drop indexname on tablename