This question is old, but is missing some benchmarks. I benchmarked JOIN against its 2 competitors:
WHERE IN(...)
or equivalentThe result is clear: on MySQL, JOIN
is much faster. N+1 queries can drop the performance of an application drastically:
That is, unless you select a lot of records that point to a very small number of distinct, foreign records. Here is a benchmark for the extreme case:
This is very unlikely to happen in a typical application, unless you're joining a -to-many relationship, in which case the foreign key is on the other table, and you're duplicating the main table data many times.
Takeaway:
JOIN
See my article on Medium for more information.