← Graph

LATERAL join

concept 2 connections

SQL join (PostgreSQL ≥ 9.3) that lets a subquery reference columns of the outer FROM clause, enabling per-row correlated subqueries such as 'top 10 reviews of each product'. In the LATERAL-joins lightning talk it dramatically outperforms both a classic JOIN+GROUP BY and a CTE when additional filtering is applied (down to ~5 ms vs ~47 ms in the example).

category
pattern
about
LATERAL join concept
Shows LATERAL joins delivering the biggest speedup with filtering.
about
LATERAL join concept
Recommends LATERAL for filtered top-N-per-group queries.

Provenance

Read by
6 extractions