select * from a as a where a.id in (1,2,3,...,100)效率如何
in里面的东西是没有规律的
是从另一个表按条件select出来的是单这么写效率好,还是select * from a as a inner join b as b on b.xx=xx and a.xx=b.xx效率好
in里面的东西是没有规律的
是从另一个表按条件select出来的是单这么写效率好,还是select * from a as a inner join b as b on b.xx=xx and a.xx=b.xx效率好
select * from a as a where a.id=2;
.....
select * from a as a where a.id=99;
select * from a as a where a.id=100;上面肯定比下面的效率好,对吧
[求证&散分]MySQL 中 where id in (1,2,3,4,...) 的效率问题讨论
看了那个帖子,感觉是数据量很小||数据量很大的时候,in的效率会好
但是不知道这个度是多少小于10条能否认为in的效率好