pgsql: Fix several hash functions that were taking chintzy shortcuts

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix several hash functions that were taking chintzy shortcuts
Date: 2007-06-01 15:33:19
Message-ID: 20070601153319.34C289FB686@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Fix several hash functions that were taking chintzy shortcuts instead of
delivering a well-randomized hash value. I got religion on this after
observing that performance of multi-batch hash join degrades terribly if the
higher-order bits of hash values aren't random, as indeed was true for say
hashes of small integer values. It's now expected and documented that hash
functions should use hash_any or some comparable method to ensure that all
bits of their output are about equally random.

initdb forced because this change invalidates existing hash indexes. For the
same reason, this isn't back-patchable; the hash join performance problem
will get a band-aid fix in the back branches.

Modified Files:
--------------
pgsql/src/backend/access/hash:
hashfunc.c (r1.51 -> r1.52)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/hash/hashfunc.c.diff?r1=1.51&r2=1.52)
pgsql/src/backend/nodes:
bitmapset.c (r1.12 -> r1.13)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/bitmapset.c.diff?r1=1.12&r2=1.13)
pgsql/src/backend/utils/hash:
hashfn.c (r1.30 -> r1.31)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/hash/hashfn.c.diff?r1=1.30&r2=1.31)
pgsql/src/include/access:
hash.h (r1.81 -> r1.82)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/access/hash.h.diff?r1=1.81&r2=1.82)
pgsql/src/include/catalog:
catversion.h (r1.407 -> r1.408)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/catversion.h.diff?r1=1.407&r2=1.408)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2007-06-01 15:58:02 pgsql: Fix performance problems in multi-batch hash joins by ensuring
Previous Message User Pgunittest 2007-06-01 15:26:26 pgunittest - pgUnitTest: