当前位置:网站首页>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内核浏览器。
边栏推荐
- Freemaker template framework generates images
- Chapter II (physical layer)
- Linux安装MySQL5
- .NetCore统一认证授权学习——Run(1)
- [compilation principle] semantic analysis
- Hangfire详解
- thinkphp5中的配置如何使用
- Ovirt database modify delete node
- [boutique] detailed explanation of Pinia
- [observation] softcom power liutianwen: embrace change and "follow the trend" to become an "enabler" of China's digital economy
猜你喜欢

As the "only" privacy computing provider, insight technology is the "first" to settle in the Yangtze River Delta data element circulation service platform

苹果iPhone手机升级系统内存空间变小不够如何解决?

lock4j--分布式锁中间件--自定义获取锁失败的逻辑

A keepalived high availability accident made me learn it again!

How to set a pod to run on a specified node

Finally, Amazon~

Tiger painter mengxiangshun's digital collection is on sale in limited quantities and comes with Maotai in the year of the tiger

如何设置 Pod 到指定节点运行
![[compilation principle] type check](/img/fc/458871e2df4e0384f65e09faa909d7.png)
[compilation principle] type check

JMeter BeanShell explanation and thread calling
随机推荐
Real time tracking of bug handling progress of the project through metersphere and dataease
As the "only" privacy computing provider, insight technology is the "first" to settle in the Yangtze River Delta data element circulation service platform
NLP - GIZA++ 实现词对齐
[notes] take notes again -- learn by doing Verilog HDL – 008
Nutch2.1 distributed fetching
社区访谈丨一个IT新人眼中的JumpServer开源堡垒机
【编译原理】类型检查
JMeter BeanShell explanation and thread calling
一个mysql里有3306端口下,一个mysql有20多个数据库,怎么一键备份20多个数据库,做系统备份,防止数据误删除?
jfinal中如何使用过滤器监控Druid监听SQL执行?
雪花id,分布式唯一id
Sword finger offer 66 Building a product array
Nacos problem
Zotero journal Automatic Matching Update Influencing Factors
Flume theory
CorelDRAW最新24.1.0.360版本更新介绍讲解
剑指 Offer 41. 数据流中的中位数
剑指 Offer 59 - II. 队列的最大值
Connaissance générale des paramètres de sécurité du serveur Cloud
WPS and Excelle