索引覆盖 Using index


简介

  • 查询的列恰好是索引的一部分,那么查询只需要在索引文件上进行,不需要回行到磁盘再找数据

实例

索引结构为:(name,age)
#命中索引,而且查询的列正好是索引的一部分
select name from table where name=1; 
#命中索引,而且查询的列正好是索引的一部分
select name,age from table where name=1;
#命中索引,但是不是索引覆盖,status不存在于命中的索引列之中,规则按照复合索引,左前缀失效去想。
select name,status from table where name=1;

results matching ""

    No results matching ""