2019-04-12
selec a from tab_t where b=0 order by c limit 10;
表情况:tab_t 数据库20w,b=0无结果,表上无索引。
现象:语句频繁执行,show processlist看到执行时间为0,但是state:creating sort index。explain Extra : filesort,通过profile看到creating sort index耗时最长,而不加order by c 时看到sending data耗时最长(此sending data位于query end之前)
疑问:请问下 b=0 并无匹配值为何还有排序消耗,难道order by在where之前执行吗?
收藏
分享
7条回答
默认
最新
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
墨值悬赏

评论



