]> granicus.if.org Git - postgresql/commit
Further twiddling of nodeHash.c hashtable sizing calculation.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 4 Oct 2015 19:55:07 +0000 (15:55 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 4 Oct 2015 19:55:07 +0000 (15:55 -0400)
commitd84cc40e4bbaa3e708029e0744cba1566ebff324
treee5a6f76b7487519c0cb9449bcb388de6501199a4
parenta8168fbcbbb3ed88c19ca2b648d737e8d90f37b1
Further twiddling of nodeHash.c hashtable sizing calculation.

On reflection, the submitted patch didn't really work to prevent the
request size from exceeding MaxAllocSize, because of the fact that we'd
happily round nbuckets up to the next power of 2 after we'd limited it to
max_pointers.  The simplest way to enforce the limit correctly is to
round max_pointers down to a power of 2 when it isn't one already.

(Note that the constraint to INT_MAX / 2, if it were doing anything useful
at all, is properly applied after that.)
src/backend/executor/nodeHash.c