Mysql索引
1 创建索引一:create 索引类型 索引名(自定义) on 表名(字段) 2 ***************************************************** 3 //单值索引 4 create index age_index on person(age) 5 //唯一索引 6 create unique name_unique on person(name) 7 //复合索引 8 create index complex_index on person(name,age) 9 ***************************************************** 10 11 创建索引二:alter table 表名 add 索引类型 索引名(字段) 12 **************************************************** 13 //单值索引 14 alter table person add index age_index(age) 15 //唯一索引 16 alter table person add unique name_index(name) 17 //复合索引 18 alter table person add index complex_index(name,age) 19 **************************************************** 20 21 删除索引:drop index 索引名 on 表名 22 *************************************************** 23 drop index age_index on person 24 *************************************************** 25 26 查询索引:show index from 表名;