Assuming t is a large table, and the following two queries
SELECT t1.value, t2.value
FROM t as t1 JOIN t as t2
ON t1.id = t2.id
WHERE t1.key = '123'
and
SELECT t1.value, t2.value
FROM t as t1 JOIN t as t2 JOIN t as t3
ON t1.id = t2.id
WHERE t1.key = '123'
the second one having a JOIN with a table that is not used in the SELECT.
The second query executes much slower. I expected that MySQL would figure out that the third JOIN is not used and will just ignore it. But it does not?