MySQL基础之索引

这段时间看了好多东西却没有总结,今天在这里写一写

关于索引

索引是一种提高查询效率的方法,它是B+树的结构,从根到中间节点在到叶子节点,无需遍历全部就可以查到所需的东西

关于索引的创建

一般有俩种方式
*在创建table的时候添加索引
create table test( id int not null, index i_sss(id);
*在已有的table中添加索引
create index i_sss(id) on test;


如何查看索引

show index from test;


如何删除索引

drop index i_sss on test;


之后会逐步更新,测试markdown

原文地址:https://www.cnblogs.com/libowen/p/6060096.html