IT lexicon › Database › Join strategy

Join strategy

Database På svenska → Updated: 2026-11-10

Algorithms for efficiently combining rows from multiple tables: nested loop, hash, and merge join.

A join strategy is an algorithm for combining rows across tables. The three classics are: nested loop (for each row in A, check all rows in B), hash join (hash one table, then probe the other), and merge join (sort both, then merge). Nested loop is simplest but slowest; hash join is fastest for large tables in memory; merge join exploits existing sort order. The query planner chooses automatically based on table size, available indexes, and memory. Picking the right strategy often makes the difference between a query that runs in milliseconds versus one that times out.

← Back to the lexicon