git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: b7e1ae2) | patch
Implement table partitioning.
Wed, 7 Dec 2016 18:17:43 +0000 (13:17 -0500)
Wed, 7 Dec 2016 18:17:55 +0000 (13:17 -0500)
commit f0e44751d7175fa3394da2c8f85e3ceb3cdbfe63
Implement table partitioning.

Table partitioning is like table inheritance and reuses much of the
existing infrastructure, but there are some important differences.
The parent is called a partitioned table and is always empty; it may
not have indexes or non-inherited constraints, since those make no
sense for a relation with no data of its own. The children are called
partitions and contain all of the actual data. Each partition has an
implicit partitioning constraint. Multiple inheritance is not
allowed, and partitioning and inheritance can't be mixed. Partitions
can't have extra columns and may not allow nulls unless the parent
does. Tuples inserted into the parent are automatically routed to the
correct partition, so tuple-routing ON INSERT triggers are not needed.
Tuple routing isn't yet supported for partitions which are foreign
tables, and it doesn't handle updates that cross partition boundaries.

Currently, tables can be range-partitioned or list-partitioned. List
partitioning is limited to a single column, but range partitioning can
involve multiple columns. A partitioning "column" can be an
expression.

Because table partitioning is less general than table inheritance, it
is hoped that it will be easier to reason about properties of
partitions, and therefore that this will serve as a better foundation
for a variety of possible optimizations, including query planner
optimizations. The tuple routing based which this patch does based on
the implicit partitioning constraints is an example of this, but it
seems likely that many other useful optimizations are also possible.

Amit Langote, reviewed and tested by Robert Haas, Ashutosh Bapat,
Amit Kapila, Rajkumar Raghuwanshi, Corey Huinker, Jaime Casanova,
Rushabh Lathia, Erik Rijkers, among others. Minor revisions by me.
85 files changed:
doc/src/sgml/catalogs.sgml diff | blob | blame | history
doc/src/sgml/ref/alter_table.sgml diff | blob | blame | history
doc/src/sgml/ref/create_foreign_table.sgml diff | blob | blame | history
doc/src/sgml/ref/create_table.sgml diff | blob | blame | history
src/backend/access/common/reloptions.c diff | blob | blame | history
src/backend/catalog/Makefile diff | blob | blame | history
src/backend/catalog/aclchk.c diff | blob | blame | history
src/backend/catalog/dependency.c diff | blob | blame | history
src/backend/catalog/heap.c diff | blob | blame | history
src/backend/catalog/index.c diff | blob | blame | history
src/backend/catalog/objectaddress.c diff | blob | blame | history
src/backend/catalog/partition.c [new file with mode: 0644] blob
src/backend/catalog/pg_constraint.c diff | blob | blame | history
src/backend/commands/analyze.c diff | blob | blame | history
src/backend/commands/copy.c diff | blob | blame | history
src/backend/commands/createas.c diff | blob | blame | history
src/backend/commands/indexcmds.c diff | blob | blame | history
src/backend/commands/lockcmds.c diff | blob | blame | history
src/backend/commands/policy.c diff | blob | blame | history
src/backend/commands/seclabel.c diff | blob | blame | history
src/backend/commands/sequence.c diff | blob | blame | history
src/backend/commands/tablecmds.c diff | blob | blame | history
src/backend/commands/trigger.c diff | blob | blame | history
src/backend/commands/typecmds.c diff | blob | blame | history
src/backend/commands/vacuum.c diff | blob | blame | history
src/backend/commands/view.c diff | blob | blame | history
src/backend/executor/execMain.c diff | blob | blame | history
src/backend/executor/nodeModifyTable.c diff | blob | blame | history
src/backend/nodes/copyfuncs.c diff | blob | blame | history
src/backend/nodes/equalfuncs.c diff | blob | blame | history
src/backend/nodes/nodeFuncs.c diff | blob | blame | history
src/backend/nodes/outfuncs.c diff | blob | blame | history
src/backend/nodes/readfuncs.c diff | blob | blame | history
src/backend/optimizer/util/plancat.c diff | blob | blame | history
src/backend/parser/analyze.c diff | blob | blame | history
src/backend/parser/gram.y diff | blob | blame | history
src/backend/parser/parse_agg.c diff | blob | blame | history
src/backend/parser/parse_expr.c diff | blob | blame | history
src/backend/parser/parse_func.c diff | blob | blame | history
src/backend/parser/parse_utilcmd.c diff | blob | blame | history
src/backend/rewrite/rewriteDefine.c diff | blob | blame | history
src/backend/rewrite/rewriteHandler.c diff | blob | blame | history
src/backend/rewrite/rowsecurity.c diff | blob | blame | history
src/backend/tcop/utility.c diff | blob | blame | history
src/backend/utils/adt/ruleutils.c diff | blob | blame | history
src/backend/utils/cache/relcache.c diff | blob | blame | history
src/backend/utils/cache/syscache.c diff | blob | blame | history
src/bin/pg_dump/common.c diff | blob | blame | history
src/bin/pg_dump/pg_dump.c diff | blob | blame | history
src/bin/pg_dump/pg_dump.h diff | blob | blame | history
src/bin/psql/describe.c diff | blob | blame | history
src/bin/psql/tab-complete.c diff | blob | blame | history
src/include/catalog/catversion.h diff | blob | blame | history
src/include/catalog/dependency.h diff | blob | blame | history
src/include/catalog/heap.h diff | blob | blame | history
src/include/catalog/indexing.h diff | blob | blame | history
src/include/catalog/partition.h [new file with mode: 0644] blob
src/include/catalog/pg_class.h diff | blob | blame | history
src/include/catalog/pg_partitioned_table.h [new file with mode: 0644] blob
src/include/catalog/pg_proc.h diff | blob | blame | history
src/include/commands/defrem.h diff | blob | blame | history
src/include/commands/tablecmds.h diff | blob | blame | history
src/include/executor/executor.h diff | blob | blame | history
src/include/nodes/execnodes.h diff | blob | blame | history
src/include/nodes/nodes.h diff | blob | blame | history
src/include/nodes/parsenodes.h diff | blob | blame | history
src/include/parser/kwlist.h diff | blob | blame | history
src/include/parser/parse_node.h diff | blob | blame | history
src/include/parser/parse_utilcmd.h diff | blob | blame | history
src/include/pg_config_manual.h diff | blob | blame | history
src/include/utils/builtins.h diff | blob | blame | history
src/include/utils/rel.h diff | blob | blame | history
src/include/utils/syscache.h diff | blob | blame | history
src/test/regress/expected/alter_table.out diff | blob | blame | history
src/test/regress/expected/create_table.out diff | blob | blame | history
src/test/regress/expected/inherit.out diff | blob | blame | history
src/test/regress/expected/insert.out diff | blob | blame | history
src/test/regress/expected/sanity_check.out diff | blob | blame | history
src/test/regress/expected/update.out diff | blob | blame | history
src/test/regress/sql/alter_table.sql diff | blob | blame | history
src/test/regress/sql/create_table.sql diff | blob | blame | history
src/test/regress/sql/inherit.sql diff | blob | blame | history
src/test/regress/sql/insert.sql diff | blob | blame | history
src/test/regress/sql/update.sql diff | blob | blame | history
src/tools/pgindent/typedefs.list diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /