索引(Index)是帮助数据库高效获取数据的数据结构.
结构
语法
创建索引
creat [unique] index 索引名 on 表名 (字段名, ...); //创建唯一索引时加上unique, 多个字段用逗号隔开
查看索引
show index from 表名;
删除索引
drop index 索引名 on 表名;
索引(Index)是帮助数据库高效获取数据的数据结构.
结构
语法
创建索引
creat [unique] index 索引名 on 表名 (字段名, ...); //创建唯一索引时加上unique, 多个字段用逗号隔开
查看索引
show index from 表名;
删除索引
drop index 索引名 on 表名;