Introduce 64-bit hash functions with a 64-bit seed.

Robert Haas <rhaas@postgresql.org>

Commit: 81c5e46c490e2426db243eada186995da5bb0ba7
Author: Robert Haas <rhaas@postgresql.org>
Date: 2017-09-01T02:21:21Z
Releases: 11.0
Introduce 64-bit hash functions with a 64-bit seed.

This will be useful for hash partitioning, which needs a way to seed
the hash functions to avoid problems such as a hash index on a hash
partitioned table clumping all values into a small portion of the
bucket space; it's also useful for anything that wants a 64-bit hash
value rather than a 32-bit hash value.

Just in case somebody wants a 64-bit hash value that is compatible
with the existing 32-bit hash values, make the low 32-bits of the
64-bit hash value match the 32-bit hash value when the seed is 0.

Robert Haas and Amul Sul

Discussion: http://postgr.es/m/CA+Tgmoafx2yoJuhCQQOL5CocEi-w_uG4S2xT0EtgiJnPGcHW3g@mail.gmail.com

Files

PathChange+/−
doc/src/sgml/xindex.sgml modified +11 −2
src/backend/access/hash/hashfunc.c modified +371 −1
src/backend/access/hash/hashpage.c modified +1 −1
src/backend/access/hash/hashutil.c modified +3 −3
src/backend/access/hash/hashvalidate.c modified +33 −9
src/backend/commands/opclasscmds.c modified +25 −9
src/backend/utils/adt/acl.c modified +15 −0
src/backend/utils/adt/arrayfuncs.c modified +79 −0
src/backend/utils/adt/date.c modified +21 −0
src/backend/utils/adt/jsonb_op.c modified +43 −0
src/backend/utils/adt/jsonb_util.c modified +43 −0
src/backend/utils/adt/mac8.c modified +9 −0
src/backend/utils/adt/mac.c modified +9 −0
src/backend/utils/adt/network.c modified +10 −0
src/backend/utils/adt/numeric.c modified +60 −0
src/backend/utils/adt/pg_lsn.c modified +6 −0
src/backend/utils/adt/rangetypes.c modified +63 −0
src/backend/utils/adt/timestamp.c modified +19 −0
src/backend/utils/adt/uuid.c modified +8 −0
src/backend/utils/adt/varchar.c modified +18 −0
src/backend/utils/cache/lsyscache.c modified +4 −4
src/backend/utils/cache/typcache.c modified +54 −4
src/include/access/hash.h modified +27 −5
src/include/catalog/catversion.h modified +1 −1
src/include/catalog/pg_amproc.h modified +36 −0
src/include/catalog/pg_proc.h modified +54 −0
src/include/fmgr.h modified +1 −0
src/include/utils/jsonb.h modified +2 −0
src/include/utils/typcache.h modified +4 −0
src/test/regress/expected/alter_generic.out modified +2 −2
src/test/regress/expected/hash_func.out added +300 −0
src/test/regress/parallel_schedule modified +1 −1
src/test/regress/sql/hash_func.sql added +222 −0

Documentation touched

Discussion