Mysql-index

add index

alter table 表名 add index/unique/fulltext [索引名] (字段名);

drop index

alter table 表名 drop index 索引名;

View all indexes on a table

show index from 表名;

Note: While the index provides search speed, it reduces the speed of additions, deletions, and changes.
Common index key (field name 1, field name 2, ...)
unique index unique key (field name 1, field name 2, ... ...)
primary key index primary key (field name 1, field name 2, ...)
fulltext index fulltext (field name 1, field name 2, ...)
combined index index (field name 1 , field name 2, ...)
foreign key constraints foreign key (field) references table name (field name) innoDB support

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324808156&siteId=291194637