mysql> select count(1) from foo where remote in (select remote from bar); +----------+ | count(1) | +----------+ | 5750 | +----------+ 1 row in set (0.30 sec) mysql> select count(1) from foo ; +----------+ | count(1) | +----------+ | 94587 | +----------+ 1 row in set (0.01 sec) mysql> select count(1) from foo where remote not in (select remote from bar); +----------+ | count(1) | +----------+ | 56 | +----------+ 1 row in set (0.45 sec)