show index from 表名;
create index 索引名 on 表名(字段名1,...);
如果只有一个字段名,表示建立单列索引;多个字段名,表示建立组合索引。如果字段为字符类型,可以在字符后面指定长度,比如students(name(20),age),也可以不指定,其他类型(int,bit)的字段不需要指定长度
drop index 索引名 on 表名;
set profiling = 1;
select * from areas where atitle = ‘北京市‘;
show profiles;
create index title_index on areas(atitle(20));
select * from areas where atitle = ‘北京市‘;
show profiles;
原文:https://www.cnblogs.com/Elite-Wang/p/14207896.html