From: | Robert Haas <rhaas(at)postgresql(dot)org> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Introduce 64-bit hash functions with a 64-bit seed. |
Date: | 2017-09-01 02:31:21 |
Message-ID: | E1dnbjt-0004xb-6w@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
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
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/81c5e46c490e2426db243eada186995da5bb0ba7
Modified Files
--------------
doc/src/sgml/xindex.sgml | 13 +-
src/backend/access/hash/hashfunc.c | 372 +++++++++++++++++++++++++++-
src/backend/access/hash/hashpage.c | 2 +-
src/backend/access/hash/hashutil.c | 6 +-
src/backend/access/hash/hashvalidate.c | 42 +++-
src/backend/commands/opclasscmds.c | 34 ++-
src/backend/utils/adt/acl.c | 15 ++
src/backend/utils/adt/arrayfuncs.c | 79 ++++++
src/backend/utils/adt/date.c | 21 ++
src/backend/utils/adt/jsonb_op.c | 43 ++++
src/backend/utils/adt/jsonb_util.c | 43 ++++
src/backend/utils/adt/mac.c | 9 +
src/backend/utils/adt/mac8.c | 9 +
src/backend/utils/adt/network.c | 10 +
src/backend/utils/adt/numeric.c | 60 +++++
src/backend/utils/adt/pg_lsn.c | 6 +
src/backend/utils/adt/rangetypes.c | 63 +++++
src/backend/utils/adt/timestamp.c | 19 ++
src/backend/utils/adt/uuid.c | 8 +
src/backend/utils/adt/varchar.c | 18 ++
src/backend/utils/cache/lsyscache.c | 8 +-
src/backend/utils/cache/typcache.c | 58 ++++-
src/include/access/hash.h | 32 ++-
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_amproc.h | 36 +++
src/include/catalog/pg_proc.h | 54 ++++
src/include/fmgr.h | 1 +
src/include/utils/jsonb.h | 2 +
src/include/utils/typcache.h | 4 +
src/test/regress/expected/alter_generic.out | 4 +-
src/test/regress/expected/hash_func.out | 300 ++++++++++++++++++++++
src/test/regress/parallel_schedule | 2 +-
src/test/regress/sql/hash_func.sql | 222 +++++++++++++++++
33 files changed, 1555 insertions(+), 42 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2017-09-01 02:57:40 | Re: pgsql: Introduce 64-bit hash functions with a 64-bit seed. |
Previous Message | Tom Lane | 2017-08-31 20:21:22 | pgsql: Avoid memory leaks when a GatherMerge node is rescanned. |