当前位置:网站首页>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
边栏推荐
- Pointnet/Pointnet++点云数据集处理并训练
- mysql中explain语句查询sql是否走索引,extra中的几种类型整理汇总
- Summary and sorting of 8 pits of redis distributed lock
- Unity adds a function case similar to editor extension to its script, the use of ContextMenu
- How test engineers "attack the city" (Part 2)
- 1008 Elevator(20 分)(PAT甲级)
- 使用canal配合rocketmq监听mysql的binlog日志
- Hough Transform 霍夫变换原理
- HDU 1097 A hard puzzle
- Educational Codeforces Round 22 E. Army Creation
猜你喜欢
与二值化阈值处理相关的OpenCV函数、方法汇总,便于对比和拿来使用
“只跑一趟”,小区装维任务主动推荐探索
2022CoCa: Contrastive Captioners are Image-Text Fountion Models
Explore the contour drawing function drawcontours() of OpenCV in detail with practical examples
PointNeXt:通过改进的模型训练和缩放策略审视PointNet++
FPGA timing constraint sharing 01_ Brief description of the four steps
自由小兵儿
node_exporter部署
关于判断点是否位于轮廓内的一点思考
One question per day (2022-07-02) - Minimum refueling times
随机推荐
Is the securities account opened by qiniu safe?
sqlserver的CDC第一次查询的能读取到数据,但后面增删改读取不到,是什么原因
页面元素垂直水平居中、实现已知或者未知宽度的垂直水平居中。
@transactional滥用导致数据源连接池耗尽问题
The latest progress of Intel Integrated Optoelectronics Research promotes the progress of CO packaging optics and optical interconnection technology
双冒号作用运算符以及命名空间详解
The CDC of sqlserver can read the data for the first time, but it can't read the data after adding, deleting and modifying. What's the reason
Allure of pytest visual test report
1002. A+B for Polynomials (25)(PAT甲级)
Upgrade the smart switch, how much is the difference between the "zero fire version" and "single fire" wiring methods?
欧拉函数
函数式接口
Online sql to excel (xls/xlsx) tool
. Net ORM framework hisql practice - Chapter 2 - using hisql to realize menu management (add, delete, modify and check)
生成XML元素
大佬们,求助一下,我用mysql cdc 2.2.1(flink 1.14.5)写入kafka,设置
26. Delete the duplicate item C solution in the ordered array
数组中的第K个最大元素
MySQL数据库基本操作-DDL | 黑马程序员
FPGA timing constraint sharing 01_ Brief description of the four steps