diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-06-01 15:33:19 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-06-01 15:33:19 +0000 |
commit | 1f559b7d3aa411e08d2ad46a4bd7d9213945b103 (patch) | |
tree | df4325affc882914a2dd6c6e8a8160ffc223a057 /src/include | |
parent | 397d00af8f0526c78eef5999e85ce6a3d5e9e36f (diff) |
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.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/access/hash.h | 3 | ||||
-rw-r--r-- | src/include/catalog/catversion.h | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/include/access/hash.h b/src/include/access/hash.h index 2bd314a8aa3..e7f59e2da82 100644 --- a/src/include/access/hash.h +++ b/src/include/access/hash.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/access/hash.h,v 1.81 2007/05/30 20:12:02 tgl Exp $ + * $PostgreSQL: pgsql/src/include/access/hash.h,v 1.82 2007/06/01 15:33:18 tgl Exp $ * * NOTES * modeled after Margo Seltzer's hash implementation for unix. @@ -265,6 +265,7 @@ extern Datum hashname(PG_FUNCTION_ARGS); extern Datum hashtext(PG_FUNCTION_ARGS); extern Datum hashvarlena(PG_FUNCTION_ARGS); extern Datum hash_any(register const unsigned char *k, register int keylen); +extern Datum hash_uint32(uint32 k); /* private routines */ diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 9ae142387ca..b71f718776b 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -37,7 +37,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.407 2007/05/21 17:10:29 petere Exp $ + * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.408 2007/06/01 15:33:19 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 200705211 +#define CATALOG_VERSION_NO 200706011 #endif |