pgpg_orca
Live demo · 30 s loop

TPC-H Q17, side by side.

Same query. Same data. Same PostgreSQL 18 binary. The only thing that changes is SET pg_orca.enable_orca. Vanilla planner: 10,066 ms. ORCA: 308 ms.

psql session: TPC-H Q17 on vanilla PostgreSQL 18 takes 10.07 s; the same query with pg_orca enabled finishes in 308 ms — a 32.7× speedup, driven by correlated subquery decorrelation.

Scale factor 5 · 30M lineitem rows · 1M part rows · single-node, no parallelism · 3-run median EXPLAIN ANALYZE.

Subquery decorrelation

The correlated SubPlan re-executes 30,411 times under PG. ORCA rewrites it into a single HashAggregate that runs once.

Bushy join enumeration

PG settles for a Hash Join with a re-executed inner aggregate. ORCA evaluates bushy variants and picks a nested-loop ladder over the pre-aggregated side.

94% fewer buffer reads

The vanilla plan touches 1.6M shared buffers. The ORCA plan reads 87K — pruning falls out of the better join order, not from new indexes.