MySQL 查询 select * from table where id in 如何提升效率?

例句:select * from a where id in (select id from b ); 对于这条sql语句它的执行计划其实并非先查询出b表的全部id,而后再与a表的id进行比较。 mysql会把in子查询转换成exists相关子查询,因此它实际等同于这条sql语句:select * from a where exists(select * from b where b.id=a.i
相关文章
相关标签/搜索