当前位置:网站首页>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内核浏览器。
边栏推荐
- Linux安装MySQL5
- A great open source image watermarking solution
- Zotero journal automatic matching update influence factor
- [USB flash disk test] in order to transfer the data at the bottom of the pressure box, I bought a 2T USB flash disk, and the test result is only 47g~
- 偶然发现了另一种跨域方式,不知道有没有人这么玩过
- 7. cancellation and closing
- PHP implementation extracts non repeated integers (programming topics can be the fastest familiar functions)
- 【Try to Hack】vulnhub narak
- Ovirt database modify delete node
- What is a database? Database detailed notes! Take you into the database ~ you want to know everything here!
猜你喜欢

Detailed description of gaussdb (DWS) complex and diverse resource load management methods

Flume配置4——自定义Source+Sink

ASP. Net core creates razor page and uploads multiple files (buffer mode) (Continued)

The list of winners in the classic Smurfs of childhood: bluedad's digital collection was announced

Deficiencies and optimization schemes in Dao

Jmeter之BeanShell详解和夸线程调用
![[compilation principle] syntax analysis](/img/9e/6b1f15e3da9997b08d11c6f091ed0e.png)
[compilation principle] syntax analysis

画虎国手孟祥顺数字藏品限量发售,随赠虎年茅台

Luoqingqi: has high-end household appliances become a red sea? Casati took the lead in breaking the game

Common knowledge of ECS security settings
随机推荐
[compilation principle] type check
Luoqingqi: has high-end household appliances become a red sea? Casati took the lead in breaking the game
Notepad++--宏(记录操作过程)
Nutch2.1 distributed fetching
data link layer
La collection numérique Meng xiangshun, artiste national du tigre peint, est disponible en quantité limitée et est offerte avec Maotai de l'année du tigre
剑指 Offer 41. 数据流中的中位数
【编译原理】语义分析
The list of winners in the classic Smurfs of childhood: bluedad's digital collection was announced
Flume configuration 4 - Custom source+sink
Tag based augmented reality using OpenCV
How to set a pod to run on a specified node
Hangfire详解
云服务器的安全设置常识
社区访谈丨一个IT新人眼中的JumpServer开源堡垒机
How to use the configuration in thinkphp5
Configuration du Flume 4 - source personnalisée + sink
Flutter calls Baidu map app to realize location search and route planning
1404万!四川省人社厅关系型数据库及中间件软件系统升级采购招标!
Sword finger offer 66 Building a product array