not in,not exists,left join性能对比
今天注意到,公司的代码里经常用到exists这个用法。也许个人习惯不一样吧,测试了下性能。对比下,这三种效率上的区别。 mysql> select SQL_NO_CACHE count(*) from test1 where id not in(select id from test2);+----------+ | count(*) | +----------+ |
转载
2013-04-27 10:04:34 ·
1120 阅读 ·
0 评论