]> granicus.if.org Git - postgresql/commit
Fix some issues in new hashtable size calculations in nodeHash.c.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 4 Oct 2015 18:06:40 +0000 (14:06 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 4 Oct 2015 18:06:51 +0000 (14:06 -0400)
commitca5b42d85486f814b3b510e436157f443fd73683
tree5ef0db7dee17b6581b82051a3ddfe0dcc155eb82
parent544ccf644288132f805260c4eb9fd12029c5cf8c
Fix some issues in new hashtable size calculations in nodeHash.c.

Limit the size of the hashtable pointer array to not more than
MaxAllocSize, per reports from Kouhei Kaigai and others of "invalid memory
alloc request size" failures.  There was discussion of allowing the array
to get larger than that by using the "huge" palloc API, but so far no proof
that that is actually a good idea, and at this point in the 9.5 cycle major
changes from old behavior don't seem like the way to go.

Fix a rather serious secondary bug in the new code, which was that it
didn't ensure nbuckets remained a power of 2 when recomputing it for the
multiple-batch case.

Clean up sloppy division of labor between ExecHashIncreaseNumBuckets and
its sole call site.
src/backend/executor/nodeHash.c
src/include/executor/hashjoin.h