mysql> EXPLAIN SELECT a.name FROM users a INNER JOIN sessions b ON a.name = b.name +----+-------------+-------+--------+------------------+------------+---------+-----------------+------+---------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+--------+------------------+------------+---------+-----------------+------+---------------------------------+ | 1 | SIMPLE | b | ALL | NULL | NULL | NULL | NULL | 8 | Using temporary; Using filesort | | 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 3 | users.b.user_id | 1 | Using where | | 1 | SIMPLE | c | ref | usernummer,kombi | usernummer | 3 | users.a.id | 2 | Using index | +----+-------------+-------+--------+------------------+------------+---------+-----------------+------+---------------------------------+ 3 rows in set (0.00 sec) mysql> EXPLAIN SELECT b.name FROM sessions a INNER JOIN users b ON a.name = b.name +----+-------------+-------+--------+------------------+------------+---------+-----------------+------+---------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+--------+------------------+------------+---------+-----------------+------+---------------------------------+ | 1 | SIMPLE | a | ALL | NULL | NULL | NULL | NULL | 7 | Using temporary; Using filesort | | 1 | SIMPLE | b | eq_ref | PRIMARY | PRIMARY | 3 | users.a.user_id | 1 | Using where | | 1 | SIMPLE | c | ref | usernummer,kombi | usernummer | 3 | users.a.user_id | 2 | Using index | +----+-------------+-------+--------+------------------+------------+---------+-----------------+------+---------------------------------+ 3 rows in set (0.00 sec)