mysql> EXPLAIN SELECT a.unique_identifier FROM Bilder a LEFT JOIN hotfolder_file list b ON (a.unique_identifier=b.barename) WHERE b.barename IS NULL; +----+-------------+-------+-------+---------------+-------------------+-------- -+------+--------+--------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+-------+---------------+-------------------+-------- -+------+--------+--------------------------+
| 1 | SIMPLE | a | index | NULL | unique_identifier | 766 | NULL | 158370 | Using index |
| 1 | SIMPLE | b | index | NULL | barename | 51 | NULL | 158377 | Using where; Using index |
+----+-------------+-------+-------+---------------+-------------------+-------- -+------+--------+--------------------------+
2 rows in set (0.00 sec)