pgsql: Change NTUP_PER_BUCKET to 1 to improve hash join lookup speed. - Mailing list pgsql-committers

From Robert Haas
Subject pgsql: Change NTUP_PER_BUCKET to 1 to improve hash join lookup speed.
Date
Msg-id E1XSXMs-0007P4-CK@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Change NTUP_PER_BUCKET to 1 to improve hash join lookup speed.

Since this makes the bucket headers use ~10x as much memory, properly
account for that memory when we figure out whether everything fits
in work_mem.  This might result in some cases that previously used
only a single batch getting split into multiple batches, but it's
unclear as yet whether we need defenses against that case, and if so,
what the shape of those defenses should be.

It's worth noting that even in these edge cases, users should still be
no worse off than they would have been last week, because commit
45f6240a8fa9d35548eb2ef23dba2c11540aa02a saved a big pile of memory
on exactly the same workloads.

Tomas Vondra, reviewed and somewhat revised by me.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/8cce08f168481c5fc5be4e7e29b968e314f1b41e

Modified Files
--------------
src/backend/executor/nodeHash.c |   75 +++++++++++++++++++++------------------
1 file changed, 41 insertions(+), 34 deletions(-)


pgsql-committers by date:

Previous
From: Fujii Masao
Date:
Subject: pgsql: Add GUC to enable logging of replication commands.
Next
From: Bruce Momjian
Date:
Subject: pgsql: More formatting.c variable renaming, for clarity