当前位置:网站首页>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
边栏推荐
- 一文掌握数仓中auto analyze的使用
- FPGA timing constraint sharing 01_ Brief description of the four steps
- The latest progress of Intel Integrated Optoelectronics Research promotes the progress of CO packaging optics and optical interconnection technology
- OpenCV的二值化处理函数threshold()详解
- In flinksql, in addition to data statistics, is the saved data itself a state
- 问下各位大佬有用过cdc直接mysql to clickhouse的么
- 牛客小白月赛7 谁是神箭手
- Shell programming core technology II
- SSL证书续费相关问题详解
- 矩阵翻转(数组模拟)
猜你喜欢
Don't just learn Oracle and MySQL!
Stream stream
Mysql database basic operation -ddl | dark horse programmer
Explore the contour drawing function drawcontours() of OpenCV in detail with practical examples
PointNeXt:通过改进的模型训练和缩放策略审视PointNet++
与二值化阈值处理相关的OpenCV函数、方法汇总,便于对比和拿来使用
【问题】druid报异常sql injection violation, part alway true condition not allow 解决方案
The 300th weekly match of leetcode (20220703)
Build your own website (15)
Master the use of auto analyze in data warehouse
随机推荐
FPGA timing constraint sharing 01_ Brief description of the four steps
矩阵翻转(数组模拟)
一文掌握数仓中auto analyze的使用
Leetcode fizzbuzz C # answer
Hough transform Hough transform principle
2019年蜀山区第十五届青少年信息学竞赛
One question per day (2022-07-02) - Minimum refueling times
Some thoughts on whether the judgment point is located in the contour
Pytest 可视化测试报告之 Allure
函数式接口
有关架构设计的个人思考(本文后续不断修改更新)
26. 删除有序数组中的重复项 C#解答
1007 Maximum Subsequence Sum(25 分)(PAT甲级)
测试工程师如何“攻城”(下)
YOLOv5s-ShuffleNetV2
生成XML元素
The page element is vertically and horizontally centered, realizing the vertical and horizontal centering of known or unknown width.
Don't just learn Oracle and MySQL!
Shell programming core technology "three"
prometheus安装