I’m wondering about the speed between explicitly saying LEFT JOIN, and then simply joining the values on each other. So here, we have:
SELECT example.id FROM example
LEFT JOIN finals ON example.id = finals.account_id";
vs.
SELECT example.id, finals.account_id
FROM example, finals
WHERE example.id = finals.account_id
I’m nearly certain the first is faster, but I cannot find an answer to suggest that. (I’m not actually even sure what to ‘call’ the second one, I just call it a soft join)
There is a sematic difference between those queries.
The first join is an OUTER JOIN that includes all rows from the left table. The second is an INNER JOIN, and will not include rows where the match fails.
If you had written
JOINinstead ofLEFT JOINthe two queries would be identical, except the first syntax is preferred for readability and maintainability.The second syntax uses what MySQL calls the “comma operator”. It is sometimes called an implicit join. It’s also called an ANSI-89 join.