MySQL NOT IN vs LEFT JOIN
NOT IN
select a.id, a.name from a where a.id not in (select id from b)5 rows in set (0.01 sec)
LEFT JOIN
select a.id, a.name from a left join b on a.id=b.id where b.id is null;5 rows in set (0.00 sec)
select a.id, a.name from a where a.id not in (select id from b)5 rows in set (0.01 sec)
select a.id, a.name from a left join b on a.id=b.id where b.id is null;5 rows in set (0.00 sec)