create index
https://www.w3resource.com/mysql/creating-table-advance/create-index.php
1?? when create table
2?? create index statement
index type: index數(shù)據(jù)結構
http://www.mysqltutorial.org/mysql-index/mysql-create-index/
image.png
mysql supported indexes
http://www.mysqltutorial.org/mysql-index/
1??主要的兩個索引:
unique index
clustered index: 一般用 primary key 作用 clustered index:如果沒有primary key萤厅, 則采用第一個unique not null 字段作為clustered index; 既沒有primary key键兜, 也沒有 unique not null银伟,則InnoDB internally generates a hidden clustered index named GEN_CLUST_INDEX on a synthetic column containing row ID values.
https://dev.mysql.com/doc/refman/5.6/en/innodb-index-types.html
2?? 索引附加條件:
prefix index
invisible index
descending index:the leftmost(靠左原則)
composite index
3?? 優(yōu)化器參數(shù):
index cardinality(基數(shù))
index hint(提示)