table_name是表名, name,age都是列命。带index_xxx都是索引命
---------------------查看所有索引
show index from table_name;

---------------------删除索引
alter table table_name drop index index_name;
drop index index_age on table_name;

--------------------添加索引
create index index_name on table_name(name);
alter table table_name add index index_age(age);

-------------------查看索引是否生效
在语句前面加 explain 看返回结果重的key有没有值
如:EXPLAIN SELECT name from index_name where name = ‘yechuanjiang’;
mysql索引的添加删除和查看

相关文章:

  • 2021-06-14
  • 2022-12-23
  • 2021-05-15
  • 2021-06-12
猜你喜欢
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2021-06-15
相关资源
相似解决方案