MySQL 快速查询--索引添加

> use mgnt;
> create index 索引名 on clusters_cluster(cluster_name);  # create创建索引。
> alter table table_name add index 索引名(cluster_name) ;  # alter方法创建索引, table_name表名,cluster_name字段名。

索引分类:

PRIMARY, INDEX, UNIQUE 这3种是一类

PRIMARY 主键。 就是 唯一 且 不能为空。

INDEX 索引,普通的 , 如:create index index_name on clusters_cluster(cluster_name);

UNIQUE 唯一索引。 不允许有重复。

FULLTEXT 是全文索引,用于在一篇文章中,检索文本信息的。

 

你可能感兴趣的:(Mysql)