tezvyn:

Nested Loop Join: The Brute-Force Database Join

Source: Wikipedia: Nested loop joinbeginner

A nested loop join is the brute-force way to match two tables. For each row in the first table, it scans every row in the second. It's simple and effective for small tables but its performance degrades quadratically on large datasets.

A nested loop join is the database's most straightforward, brute-force matching strategy. Imagine having two decks of cards; for each card in the first deck, you compare it against every single card in the second to find matches. This "naive" approach is often the default for joining very small tables, or when one table is tiny. The footgun is letting it run on two large tables, where its O(M*N) complexity becomes prohibitively slow.

Read the original → Wikipedia: Nested loop join

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

Nested Loop Join: The Brute-Force Database Join · Tezvyn