pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add GUC enable_partition_pruning
Date: Mon, 23 Apr 2018 20:59:43 +0000
Message-ID: <E1fAiYp-0002Ob-0D@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/055fb8d33da6ff9003e3da4b9944bdcd2e2b2a49

Modified Files
--------------
doc/src/sgml/config.sgml                      |  30 +++--
doc/src/sgml/ddl.sgml                         |   2 +-
src/backend/nodes/outfuncs.c                  |   2 +-
src/backend/optimizer/path/allpaths.c         |   3 +-
src/backend/optimizer/path/costsize.c         |   1 +
src/backend/optimizer/plan/createplan.c       |   7 +-
src/backend/optimizer/plan/planner.c          |  11 +-
src/backend/optimizer/prep/prepjointree.c     |   2 +-
src/backend/optimizer/util/plancat.c          |  45 +++++--
src/backend/utils/misc/guc.c                  |  11 ++
src/backend/utils/misc/postgresql.conf.sample |   1 +
src/include/nodes/relation.h                  |  16 ++-
src/include/optimizer/cost.h                  |   1 +
src/test/regress/expected/partition_prune.out | 164 ++++++++++++++++++++++++++
src/test/regress/expected/sysviews.out        |   3 +-
src/test/regress/sql/partition_prune.sql      |  52 ++++++++
16 files changed, 322 insertions(+), 29 deletions(-)



Message-ID: <E1fAiYp-0002Ob-0D@gemulon.postgresql.org>
Permalink:  ../E1fAiYp-0002Ob-0D@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1fAiYp-0002Ob-0D@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Add GUC enable_partition_pruning
  In-Reply-To: <E1fAiYp-0002Ob-0D@gemulon.postgresql.org>
  References: <E1fAiYp-0002Ob-0D@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox