当前位置:网站首页>【MySQL】mysql因为字符集导致left join出现Using join buffer (Block Nested Loop)
【MySQL】mysql因为字符集导致left join出现Using join buffer (Block Nested Loop)
2022-08-10 22:31:00 【陶士涵】
今天在查询一个sql的时候发现没有使用到索引
仔细看了很多遍,该加的索引都加了,还是不行
使用explain查看
索引为什么失效
- 隐式转换导致索引失效
- 随着表的增长,where条件出来的数据太多,大于15%,使得索引失效(会导致CBO计算走索引花费大于走全表)
- 字符集不一致导致索引失效一个utf8一个utf8mb4
我这里主要是字符集不一致,索引失效了
转换了一下字符集就成功了
ALTER TABLE user CONVERT TO CHARSET utf8mb4;
边栏推荐
猜你喜欢
Pro-test is effective | A method to deal with missing features of risk control data
3598. 二叉树遍历(华中科技大学考研机试题)
配电网络扩展规划:考虑使用概率性能源生产和消费概况的决策(Matlab代码实现)
leetcode:357. 统计各位数字都不同的数字个数
合并k个已排序的链表
企业云存储日常运行维护实践经验分享
实例050:随机数
谁是边缘计算服务的采购者?是这六个关键角色
Distribution Network Expansion Planning: Consider Decisions Using Probabilistic Energy Production and Consumption Profiles (Matlab Code Implementation)
JS学习 2022080
随机推荐
What is Jmeter? What are the principle steps used by Jmeter?
2021 IDEA creates web projects
美味的佳肴
Spark基础【RDD转换算子】
如何成为一名正义黑客?你应该学习什么?
美味的石井饭
Distribution Network Expansion Planning: Consider Decisions Using Probabilistic Energy Production and Consumption Profiles (Matlab Code Implementation)
阿里云贾朝辉:云XR平台支持彼真科技呈现国风科幻虚拟演唱会
TCP连接过程中如果拔掉网线会发生什么?
【Maui正式版】创建可跨平台的Maui程序,以及有关依赖注入、MVVM双向绑定的实现和演示
geemap的详细安装步骤及环境配置
JS use regular expressions in g model and non g difference
确诊了!是Druid1.1.20的锅,查询无法映射LocalDateTime类型(带源码解析及解决方案)
This visual tool artifact is more intuitive and easy to use!love so much
Addition of linked lists (2)
LeetCode Daily 2 Questions 01: Reverse Strings (both 1200) Method: Double Pointer
面试官: AMS在Android起到什么作用,简单的分析下Android的源码
IM 即时通讯开发如何设计图片文件的服务端存储架构
虚拟地址空间
MySQL:MySQL的集群——主从复制的原理和配置