]> granicus.if.org Git - postgresql/commit
Introduce 64-bit hash functions with a 64-bit seed.
authorRobert Haas <rhaas@postgresql.org>
Fri, 1 Sep 2017 02:21:21 +0000 (22:21 -0400)
committerRobert Haas <rhaas@postgresql.org>
Fri, 1 Sep 2017 02:21:21 +0000 (22:21 -0400)
commit81c5e46c490e2426db243eada186995da5bb0ba7
treea6cb745131c45a06fa43746a17a69e1dc9daa44a
parent2d44c58c79aeef2d376be0141057afbb9ec6b5bc
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
33 files changed:
doc/src/sgml/xindex.sgml
src/backend/access/hash/hashfunc.c
src/backend/access/hash/hashpage.c
src/backend/access/hash/hashutil.c
src/backend/access/hash/hashvalidate.c
src/backend/commands/opclasscmds.c
src/backend/utils/adt/acl.c
src/backend/utils/adt/arrayfuncs.c
src/backend/utils/adt/date.c
src/backend/utils/adt/jsonb_op.c
src/backend/utils/adt/jsonb_util.c
src/backend/utils/adt/mac.c
src/backend/utils/adt/mac8.c
src/backend/utils/adt/network.c
src/backend/utils/adt/numeric.c
src/backend/utils/adt/pg_lsn.c
src/backend/utils/adt/rangetypes.c
src/backend/utils/adt/timestamp.c
src/backend/utils/adt/uuid.c
src/backend/utils/adt/varchar.c
src/backend/utils/cache/lsyscache.c
src/backend/utils/cache/typcache.c
src/include/access/hash.h
src/include/catalog/catversion.h
src/include/catalog/pg_amproc.h
src/include/catalog/pg_proc.h
src/include/fmgr.h
src/include/utils/jsonb.h
src/include/utils/typcache.h
src/test/regress/expected/alter_generic.out
src/test/regress/expected/hash_func.out [new file with mode: 0644]
src/test/regress/parallel_schedule
src/test/regress/sql/hash_func.sql [new file with mode: 0644]