1.聚集索引
主键为聚集索引,创建表必有主键。
2.非聚集索引
创建索引
ALTER TABLE aiyou_city ADD INDEX index_name(citycode)
查询索引(所有的索引)
show index from aiyou_city;
show keys FROM aiyou_city;
删除索引
DROP INDEX index_name ON aiyou_city;
1.聚集索引
主键为聚集索引,创建表必有主键。
2.非聚集索引
创建索引
ALTER TABLE aiyou_city ADD INDEX index_name(citycode)
查询索引(所有的索引)
show index from aiyou_city;
show keys FROM aiyou_city;
删除索引
DROP INDEX index_name ON aiyou_city;