mysql 添加索引
创建测试表
create table t_1229
(
id int
);
-- 查看表 t_1229 的索引
show index from t_1229;
-- 给表 t_1229 在字段 id 上 添加普通索引名为 index_id
alter table t_1229 add index index_id(id);
-- 删除表 t_1229 中的 index_id 索引
alter table t_1229 drop index index_id;
创建测试表
create table t_1229
(
id int
);
-- 查看表 t_1229 的索引
show index from t_1229;
-- 给表 t_1229 在字段 id 上 添加普通索引名为 index_id
alter table t_1229 add index index_id(id);
-- 删除表 t_1229 中的 index_id 索引
alter table t_1229 drop index index_id;