MySQL using index condition
mysql Using index condition
2023-09-27 14:21:16 时间
2022-7-19 15:30:59 星期二
查看MySQL explain的时候, 最后一列看到了 using index condition, 查了查网上资料, 自己试了试, 出现的场景如下:
SQL中使用了 join, 并且 on 中的两个字段的数据类型不一致,
我的两个表中, join用的两个字段, 一个是char, 一个是varchar,
都改成 char后, 再explain 就没有 using index condition 了
参考:
https://www.fujieace.com/mysql/extra-using-index-condition.html
https://www.likecs.com/show-204613174.html
https://www.likecs.com/show-305433161.html
官网: https://dev.mysql.com/doc/refman/8.0/en/explain-output.html#explain_extra
Using index condition (JSON property: using_index_condition) Tables are read by accessing index tuples and testing them first to determine whether to read full table rows. In this way, index information is used to defer (“push down”) reading full table rows unless it is necessary
感觉网上其他文章的翻译比较拗口(常见到"表行"这个词, 很诡异, 应该是从翻译工具中直接贴出来的), 我自己试着翻译:
读表之前, 先尝试通过访问(查询)索引元组来决定是否读取全表的数据;
这种情况下, 如非必要, 索引信息常用来延迟(避免)读取表中所有行的数据;
(言下之意是还可能要回表的, 但是否扫全表还不确定, 要看索引信息了??)
相关文章
- MySQL 调优 —— Using filesort
- mysql中使用show variables同时查询多个参数值?show variables的使用?
- mysql 错误码: 1267
- MySQL 解决 emoji表情 的方法,使用utf8mb4 字符集(4字节 UTF-8 Unicode 编码)
- Mysql调优之Using filesort一般情况
- MySQL 创建用户 与 授权
- mysql加密函数
- 《PHP和MySQL Web开发从新手到高手(第5版)》一一2.8 修改存储的数据
- linux mysql Access denied for user ‘root‘@‘localhost‘ (using password: YES) 大坑
- 利用Java针对MySql封装的jdbc框架类 JdbcUtils 完整实现(包含增删改查、JavaBean反射原理,附源码)
- 解决mysql:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO/YES)
- mysql 8.0.20下载与安装、navicat下载、修改mysql密码、连接mysql
- 6:7 题一起MySQL数据库分库备份
- mysql中count与null的坑
- mysql自动补全功能(只能用于表/列 名)
- MySQL 面试题(一):索引失效的几种情况
- [Mysql] 插入数据