MySQL5.6子查询优化总结

2014-08-02
阅读 4 分钟
4k
1、子查询合并不支持 mysql> explain select * from t1 where exists (select * from t2 where t2.a2>5) and exists (select * from t2 where t2.a2<10); +----+-------------+-------+------+---------------+------+---------+------+------+-------------+ | id | select_type | table | type | possible_ke...

MySQL子查询类型

2014-07-23
阅读 3 分钟
2.9k
1、相关子查询 select * from t4 where t4.id4 = any ( select t5.id5 from t5 where t5.b5 = t4.b4);2、非相关子查询 select * from t1 where a1 = any (select a2 from t2 where t2.a2 = 10);

MySQL查询计划学习

2014-07-19
阅读 5 分钟
2.6k
2) PRIMARY:最外层SELECT。 mysql> explain select * from (select * from t2 where id2=2) b;