pgsql: Change NTUP_PER_BUCKET to 1 to improve hash join lookup speed.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Change NTUP_PER_BUCKET to 1 to improve hash join lookup speed.
Date: 2014-09-12 20:22:54
Message-ID: E1XSXMs-0007P4-CK@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2014-09-13 00:35:09 pgsql: More formatting.c variable renaming, for clarity
Previous Message Fujii Masao 2014-09-12 17:56:59 pgsql: Add GUC to enable logging of replication commands.