pgsql: Add hash partitioning.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add hash partitioning.
Date: 2017-11-09 23:10:11
Message-ID: E1eCvxb-0002YO-84@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Add hash partitioning.

Hash partitioning is useful when you want to partition a growing data
set evenly. This can be useful to keep table sizes reasonable, which
makes maintenance operations such as VACUUM faster, or to enable
partition-wise join.

At present, we still depend on constraint exclusion for partitioning
pruning, and the shape of the partition constraints for hash
partitioning is such that that doesn't work. Work is underway to fix
that, which should both improve performance and make partitioning
pruning work with hash partitioning.

Amul Sul, reviewed and tested by Dilip Kumar, Ashutosh Bapat, Yugo
Nagata, Rajkumar Raghuwanshi, Jesper Pedersen, and by me. A few
final tweaks also by me.

Discussion: http://postgr.es/m/CAAJ_b96fhpJAP=ALbETmeLk1Uni_GFZD938zgenhF49qgDTjaQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1aba8e651ac3e37e1d2d875842de1e0ed22a651e

Modified Files
--------------
doc/src/sgml/ddl.sgml | 28 +-
doc/src/sgml/ref/alter_table.sgml | 7 +
doc/src/sgml/ref/create_table.sgml | 85 +++-
src/backend/catalog/partition.c | 682 ++++++++++++++++++++++++---
src/backend/commands/tablecmds.c | 48 +-
src/backend/nodes/copyfuncs.c | 2 +
src/backend/nodes/equalfuncs.c | 2 +
src/backend/nodes/outfuncs.c | 2 +
src/backend/nodes/readfuncs.c | 2 +
src/backend/optimizer/path/joinrels.c | 12 +-
src/backend/parser/gram.y | 76 ++-
src/backend/parser/parse_utilcmd.c | 29 +-
src/backend/utils/adt/ruleutils.c | 15 +-
src/backend/utils/cache/relcache.c | 26 +-
src/bin/psql/tab-complete.c | 2 +-
src/include/catalog/catversion.h | 2 +-
src/include/catalog/partition.h | 3 +
src/include/catalog/pg_proc.h | 4 +
src/include/nodes/parsenodes.h | 8 +-
src/test/regress/expected/alter_table.out | 62 +++
src/test/regress/expected/create_table.out | 78 ++-
src/test/regress/expected/insert.out | 46 ++
src/test/regress/expected/partition_join.out | 81 ++++
src/test/regress/expected/update.out | 29 ++
src/test/regress/sql/alter_table.sql | 64 +++
src/test/regress/sql/create_table.sql | 51 +-
src/test/regress/sql/insert.sql | 33 ++
src/test/regress/sql/partition_join.sql | 32 ++
src/test/regress/sql/update.sql | 28 ++
src/tools/pgindent/typedefs.list | 1 +
30 files changed, 1420 insertions(+), 120 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Geoghegan 2017-11-10 00:02:17 Re: [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple
Previous Message Andres Freund 2017-11-09 22:24:31 Re: [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-11-09 23:11:32 Re: [POC] hash partitioning
Previous Message Michael Paquier 2017-11-09 23:08:50 Re: [PATCH] A hook for session start