]> granicus.if.org Git - postgresql/commit
Add GUC enable_partition_pruning
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 23 Apr 2018 20:57:43 +0000 (17:57 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 23 Apr 2018 20:57:43 +0000 (17:57 -0300)
commit055fb8d33da6ff9003e3da4b9944bdcd2e2b2a49
tree2ee3763bb11d1211f10432a80fd28de7bd035d5e
parent4df58f7ed7f9ddc5a3196fcbad35690d1b3218de
Add GUC enable_partition_pruning

This controls both plan-time and execution-time new-style partition
pruning.  While finer-grain control is possible (maybe using an enum GUC
instead of boolean), there doesn't seem to be much need for that.

This new parameter controls partition pruning for all queries:
trivially, SELECT queries that affect partitioned tables are naturally
under its control since they are using the new technology.  However,
while UPDATE/DELETE queries do not use the new code, we make the new GUC
control their behavior also (stealing control from
constraint_exclusion), because it is more natural, and it leads to a
more natural transition to the future in which those queries will also
use the new pruning code.

Constraint exclusion still controls pruning for regular inheritance
situations (those not involving partitioned tables).

Author: David Rowley
Review: Amit Langote, Ashutosh Bapat, Justin Pryzby, David G. Johnston
Discussion: https://postgr.es/m/CAKJS1f_0HwsxJG9m+nzU+CizxSdGtfe6iF_ykPYBiYft302DCw@mail.gmail.com
16 files changed:
doc/src/sgml/config.sgml
doc/src/sgml/ddl.sgml
src/backend/nodes/outfuncs.c
src/backend/optimizer/path/allpaths.c
src/backend/optimizer/path/costsize.c
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/prep/prepjointree.c
src/backend/optimizer/util/plancat.c
src/backend/utils/misc/guc.c
src/backend/utils/misc/postgresql.conf.sample
src/include/nodes/relation.h
src/include/optimizer/cost.h
src/test/regress/expected/partition_prune.out
src/test/regress/expected/sysviews.out
src/test/regress/sql/partition_prune.sql