当前位置:网站首页>The explain statement in MySQL queries whether SQL is indexed, and several types in extra collate and summarize
The explain statement in MySQL queries whether SQL is indexed, and several types in extra collate and summarize
2022-07-04 19:35:00 【Koikoi123】
1.using index Find through the secondary common index , Implement overlay index , There is no need to query the table
2.using index condition Find through the secondary common index , After the results found through the index, there are where filter , And this filtering can be realized only by using the secondary ordinary index , No judgment filtering in memory . But you need to query the required field values back to the table .
3.using where Whether or not it is found through the index , As long as the data is loaded into memory where Condition screening , All are
4.using index & using where: Search uses index , But all the data needed can be found in the index column , So you don't need to go back to the table to query the data
Practical example
If there is a watch xxx, to modify_date Index
1.using index Find through the secondary common index , Implement overlay index , There is no need to query the table
explain
SELECT modify_date
from xxx
2.using index condition Find through the secondary common index , We need to go back to the table
explain
SELECT *
from xxx where modify_date > "2022-06-27 10:27:07" and modify_date < "2022-06-28 0:0:0"
3.using where Search without index
explain
SELECT *
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: Search uses index , But all the data needed can be found in the index column , So you don't need to go back to the table to query the data
explain
SELECT modify_date
from xxx where modify_date > "2022-06-27 10:27:07" and modify_date < "2022-06-28 0:0:0"
Return results
边栏推荐
- 安徽 中安在线文旅频道推出“跟着小编游安徽”系列融媒体产品
- The 15th youth informatics competition in Shushan District in 2019
- C # implementation defines a set of SQL statements that can be executed across databases in the middle of SQL (detailed explanation of the case)
- Unity编辑器扩展C#遍历文件夹以及子目录下的所有图片
- 在线SQL转Excel(xls/xlsx)工具
- Shell 编程核心技术《四》
- @transactional滥用导致数据源连接池耗尽问题
- Opencv functions and methods related to binary threshold processing are summarized for comparison and use
- 指定输出的字符集
- Build your own website (15)
猜你喜欢
联想首次详解绿色智城数字孪生平台 破解城市双碳升级难点
牛客小白月赛7 谁是神箭手
Hough transform Hough transform principle
Introduction to polyfit software
Mysql database basic operation -ddl | dark horse programmer
OpenCV的二值化处理函数threshold()详解
自由小兵儿
大div中有多个div,这些div在同一行显示,溢出后产生滚动条而不换行
How to use async Awati asynchronous task processing instead of backgroundworker?
整理混乱的头文件,我用include what you use
随机推荐
Introduction to polyfit software
牛客小白月赛7 E Applese的超能力
大佬们,求助一下,我用mysql cdc 2.2.1(flink 1.14.5)写入kafka,设置
基于NCF的多模块协同实例
1008 Elevator(20 分)(PAT甲级)
Hough Transform 霍夫变换原理
2021 合肥市信息学竞赛小学组
English语法_名词 - 使用
如何使用Async-Awati异步任务处理代替BackgroundWorker?
2022CoCa: Contrastive Captioners are Image-Text Fountion Models
有关架构设计的个人思考(本文后续不断修改更新)
Unity editor extends C to traverse all pictures in folders and subdirectories
SSL证书续费相关问题详解
Online text line fixed length fill tool
反射(一)
Upgrade the smart switch, how much is the difference between the "zero fire version" and "single fire" wiring methods?
Nebula importer data import practice
Detailed explanation of the binary processing function threshold() of opencv
《看完就懂系列》字符串截取方法substr() 、 slice() 和 substring()之间的区别和用法
Online sql to excel (xls/xlsx) tool