Join
Nested Loop
Join algorithm that scans the inner relation once for every row of the outer relation.
A Nested Loop join takes one row from the outer side and looks up matching rows on the inner side, repeating for every outer row. It is fast when the outer side is small and the inner side has an efficient lookup — typically an index on the join key.
Nested Loops are usually the planner's pick for OLTP-style queries that filter to a handful of rows and then look up related data. They become a problem when row estimates are wrong and the loop ends up running millions of times.
If you see a slow Nested Loop with bad estimates, the fix is often an index on the inner relation, fresher statistics, or a rewrite that lets the planner choose Hash or Merge join instead.