mysql5.6改进子查询实测试

表t1,t2

各自生成100万条记录。

表引擎  myiasm  ,查询语句

select * from t1 where id2 in (select id2 from t2 )

查询速度 2.x秒

查询语句

select t1.* from t1,t2 where t1.id2=t2.id2

查询速度2.x秒

=======================

同样的查询在5.0.x版本速度分别是

2.x秒

7.x秒

===================

速度提高了3倍的样子(和数据有关系)

======================

再使用innodb引擎。

速度最慢也有4.8秒的样子。

确实有优化。

原文地址:https://www.cnblogs.com/stevenlaz/p/3914567.html