当前位置:网站首页>话说SQLyog欺骗了我!
话说SQLyog欺骗了我!
2022-07-07 00:35:00 【51CTO】
emax_task_apply这张表的数据达到了700多万,系统查询数据变得慢了起来。这次要对这张表涉及到的sql进行优化。
emax_task_apply现在的索引:
SHOW INDEX FROM emax_task_apply
我一向用SQLyog这个客户端工具。
如下两个sql语句,我在SQLyog通过多次执行比较,前者明显优于后者。
然后,信誓旦旦的告诉同事:
执行这两个sql, 比较一下, 性能很明显
SELECT SQL_NO_CACHE * FROM emax_task_apply WHERE task_id >= 1 AND enterprise_id>=1 AND user_id = 1587702862385631 AND apply_status != 'TASKAPPLY_INVALID';
SELECT SQL_NO_CACHE * FROM emax_task_apply WHERE user_id = 1587702862385631 AND apply_status != 'TASKAPPLY_INVALID';
同事后来反馈说,没有快到哪里呀,多次执行比较来看,反而前者比后者还稍慢一些呢。
后来,才发现,同事是用Navicat Premium 12 做的测试。
怎么同样的sql、同样的db,两个工具却存在这样的差异呢?
再来看他们的执行计划,2个工具对2个sql的分析结果是一样的。
我又找另一个同事,在DataGrip里执行,发现。。。
看来,“小海豚”SQLyog欺骗了我。
不过,还是不敢相信这个事实。
于是,我把2个sql放到程序里,在IDEA里跑testcase,发现测试结果与Navicat一致。
为什么会有这样的差异呢,以后再追查。也借此给遇到同样问题的同学提个醒儿。
边栏推荐
- What is make makefile cmake qmake and what is the difference?
- Opensergo is about to release v1alpha1, which will enrich the service governance capabilities of the full link heterogeneous architecture
- 5. 数据访问 - EntityFramework集成
- Red Hat安装内核头文件
- Forkjoin is the most comprehensive and detailed explanation (from principle design to use diagram)
- 如何提高网站权重
- Bat instruction processing details
- Explication contextuelle du langage Go
- Web Authentication API兼容版本信息
- async / await
猜你喜欢
随机推荐
Explication contextuelle du langage Go
STM32 key state machine 2 - state simplification and long press function addition
产业金融3.0:“疏通血管”的金融科技
STM32按键状态机2——状态简化与增加长按功能
【Shell】清理nohup.out文件
【日常训练--腾讯精选50】235. 二叉搜索树的最近公共祖先
拼多多商品详情接口、拼多多商品基本信息、拼多多商品属性接口
Common skills and understanding of SQL optimization
得物客服一站式工作台卡顿优化之路
软件测试面试技巧
Unity keeps the camera behind and above the player
驱动开发中platform设备驱动架构详解
《ClickHouse原理解析与应用实践》读书笔记(6)
《2022中国低/无代码市场研究及选型评估报告》发布
Pinduoduo product details interface, pinduoduo product basic information, pinduoduo product attribute interface
Message queuing: how to ensure that messages are not lost
MySQL-CentOS7通过YUM安装MySQL
Add salt and pepper noise or Gaussian noise to the picture
分布式事务解决方案之2PC
Reptile exercises (III)