当前位置:网站首页>mysql中explain语句查询sql是否走索引,extra中的几种类型整理汇总
mysql中explain语句查询sql是否走索引,extra中的几种类型整理汇总
2022-06-29 20:05:00 【游戏编程】
1.using index通过二级普通索引查找,实现了覆盖索引,不用进行回表查询
2.using index condition通过二级普通索引查找,在通过索引查到的结果后还有where条件过滤,而且这个过滤筛选是只需要用二级普通索引就可以实现,不用在内存中进行判断筛选。但是需要回表查询需要的字段值。
3.using where不管有没有通过索引查找,只要加载了数据到内存进行where条件筛选,都是
4.using index & using where:查找使用了索引,但是需要的数据都在索引列中能找到,所以不需要回表查询数据
实际例子
假如有一个表xxx,给modify_date上索引
1.using index通过二级普通索引查找,实现了覆盖索引,不用进行回表查询
explainSELECT modify_date from xxx
2.using index condition通过二级普通索引查找,需要回表
explainSELECT * from xxx where modify_date > "2022-06-27 10:27:07" and modify_date < "2022-06-28 0:0:0"
3.using where不走索引查找
explainSELECT * from xxx where create_date > "2022-06-27 10:27:07" and create_date < "2022-06-28 0:0:0"
4.using index & using where:查找使用了索引,但是需要的数据都在索引列中能找到,所以不需要回表查询数据
explainSELECT modify_date from xxx where modify_date > "2022-06-27 10:27:07" and modify_date < "2022-06-28 0:0:0"返回结果

作者:Koikoi123
游戏编程,一个游戏开发收藏夹~
如果图片长时间未显示,请使用Chrome内核浏览器。
边栏推荐
- Community interview -- jumpserver open source fortress in the eyes of an it newcomer
- There is no small green triangle on the method in idea
- The era of data security solutions
- wangeditor富文本编辑器使用(详细)
- Ovirt database modify delete node
- 命令执行(RCE)漏洞
- idea中方法上没有小绿色三角
- 日本樱桃一颗拍出1980元天价,网友:吃了有上当的感觉
- Three.js开发:粗线的画法
- [boutique] detailed explanation of Pinia
猜你喜欢
随机推荐
3-2 host discovery - layer 3 discovery
社区访谈丨一个IT新人眼中的JumpServer开源堡垒机
Configuration du Flume 4 - source personnalisée + sink
Nacos problem
mapbox-gl开发教程(十二):加载面图层数据
Lock4j -- distributed lock Middleware -- customize the logic of lock acquisition failure
Hangfire details
The era of data security solutions
Koa 源码剖析
Notepad++--宏(记录操作过程)
数据链路层
【精品】pinia详解
.NetCore统一认证授权学习——Run(1)
【Try to Hack】vulnhub narak
File contains vulnerability
Introduction to the latest version 24.1.0.360 update of CorelDRAW
Flume配置4——自定義Source+Sink
雲服務器的安全設置常識
剑指 Offer 66. 构建乘积数组
data link layer








![[observation] softcom power liutianwen: embrace change and](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
