MySQL subquery 次序与速度
时间:2014-04-20
来源:互联网
小弟发觉相同的 subquery 但次序不同, 速度可以差好远, 例如:
SQL1 fast:
select x, sum(y) from table1 where A and B and x in (select x from table2 where C order by x) group by x order by x;
SQL2 slow:
select x, sum(y) from table1 where x in (select x from table2 where C order by x) and A and B group by x order by x;
请问有冇朋友知点解? 唔该晒.
SQL1 fast:
select x, sum(y) from table1 where A and B and x in (select x from table2 where C order by x) group by x order by x;
SQL2 slow:
select x, sum(y) from table1 where x in (select x from table2 where C order by x) and A and B group by x order by x;
请问有冇朋友知点解? 唔该晒.
作者: footballr 发布时间: 2014-04-20
keyword "INDEX FAST FULL SCAN"
作者: alanlam 发布时间: 2014-04-20
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28