当主表数据<<子查询表数据时:exists查询比in查询快;
Select name from e where name not in (select name from s);
先查询s表数据,s表查询完后再查询e表;
Select name from e where not exists (select name from s);
先查询e表数据,e表查询完后再找s表中是否存在name;
所以exists在某些查询中比in快。
若子查询表大则用exists(内层索引),子查询表小则用in(外层索引);
limit不能直接放在IN/ALL/ANY/SOME等子查询里