What Is LATERAL?
LATERAL allows a subquery to reference columns from preceding tables in the FROM clause. It’s useful when one subquery depends on each row of another. PostgreSQL uses LATERAL for row-wise dependency queries.
Why It Matters for PostgreSQL Performance
In PostgreSQL performance work, LATERAL affects throughput, latency, or operational reliability depending on workload and configuration.
Practical Benchmarking Context
When benchmarking with pgbench, track how LATERAL changes behavior across scale factor, client concurrency, and storage conditions.
Use this term together with workload shape, concurrency level, and scale factor when interpreting pgbench outputs. Isolated values can be misleading without full run context.
Example
Example: FROM users, LATERAL (SELECT ...) AS sub