Speedup Hash Joins with dedicated functions for ExprState hashing
David Rowley <drowley@postgresql.org>
Speedup Hash Joins with dedicated functions for ExprState hashing Hashing of a single Var is a very common operation for ExprState to perform. Here we add dedicated ExecJust* functions which helps speed up Hash Joins by removing the interpretation overhead in ExecInterpExpr(). This change currently only affects Hash Joins on a single column. Hash Joins with multiple join keys or an expression still run through ExecInterpExpr(). Some testing has shown up to 10% query performance increases on recent AMD hardware and nearly 7% increase on an Apple M2 for a query performing a hash join with a large number of lookups on a small hash table. This change was extracted from a larger patch which adjusts GROUP BY / hashed subplans / hashed set operations to use ExprState hashing. Discussion: https://postgr.es/m/CAApHDvr8Zc0ZgzVoCZLdHGOFNhiJeQ6vrUcS9V7N23zMWQb-eA@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/executor/execExprInterp.c | modified | +205 −1 |
Discussion
- Add ExprState hashing for GROUP BY and hashed SubPlans 12 messages · 2024-09-01 → 2024-12-11