Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardSQLnested-loop joinSingle-choice MCQ

In a semi-join executed as a nested loop (e.g. WHERE EXISTS), how does the executor's per-outer-row behavior differ from an ordinary inner nested-loop join, and why does this affect cost?

SELECT c.id FROM customers c WHERE EXISTS ( SELECT 1 FROM orders o WHERE o.customer_id = c.id );