索引 | 说明 |
---|---|
普通索引 | index,最基本的索引 |
唯一索引 | unique,修饰的字段不能重复 |
主键索引 | primary key,是一个特殊的唯一索引,一张表只能有一个主键(常用) |
全文索引 | fulltext,对全局的数据添加索引(不常用) |
添加索引: alter table table_name add index(field);
删除索引: alter table table_name drop index field;
索引 | 说明 |
---|---|
普通索引 | index,最基本的索引 |
唯一索引 | unique,修饰的字段不能重复 |
主键索引 | primary key,是一个特殊的唯一索引,一张表只能有一个主键(常用) |
全文索引 | fulltext,对全局的数据添加索引(不常用) |
添加索引: alter table table_name add index(field);
删除索引: alter table table_name drop index field;