Semi-Joins in PostgreSQL
summary
Explains how PostgreSQL implements EXISTS/IN by either using a native JOIN_SEMI executor (supported for nested-loop, hash and merge joins) or by unique-ifying the RHS into an inner join; planner reduces semi-join to inner when the left side is unique. Describes PG18’s right semi join (hash on smaller side), a temporary disable of parallel plans, and PG19’s unification-planning fixes that remove redundant sorts — a measured plan change drops runtime from 73s to 21s (≈3.4× faster).
AI-written summary · about
