What join algorithms do databases use?

SQL joins · Experienced

Model answer

Common ones are nested loop join (good for small inputs or indexed lookups), hash join (builds a hash table of one side, good for large unsorted inputs) and merge join (for sorted inputs). The planner picks based on statistics, so use EXPLAIN to see which was chosen and why.

Learn this topic

SQL JOINs: INNER JOIN and LEFT JOIN Explained in the course SQL for Beginners: Learn Databases Step by Step.

Sign in to add your own answer.

More questions