3.7. JOIN Algorithms
The one operation that defines an RDBMS more than any other is a JOIN between tables. This was one of Dr. Codd’s basic operators, and various forms of joins are given keywords in SQL. Every SQL engine will have internal differences, but there are some common algorithms for doing JOINs. Picking the best algorithm to use for each query is the job of the optimizer. The programmer should not spend much time worrying about those choices, but he should know something about the algorithms in the few situations where he needs to look at execution plan. All major SQL implementations have an EXPLAIN or other command that will display execution plan in a human-readable format.
In the old days, the nested-loop and the sort-merge join ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access