summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2018-04-23 17:57:43 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2018-04-23 17:57:43 -0300
commit055fb8d33da6ff9003e3da4b9944bdcd2e2b2a49 (patch)
tree2ee3763bb11d1211f10432a80fd28de7bd035d5e /doc/src
parent4df58f7ed7f9ddc5a3196fcbad35690d1b3218de (diff)
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
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/config.sgml30
-rw-r--r--doc/src/sgml/ddl.sgml2
2 files changed, 24 insertions, 8 deletions
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 5d5f2d23c4f..eabe2a92352 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3826,6 +3826,23 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
</listitem>
</varlistentry>
+ <varlistentry id="guc-enable-partition-pruning" xreflabel="enable_partition_pruning">
+ <term><varname>enable_partition_pruning</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>enable_partition_pruning</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Enables or disables the query planner's ability to eliminate a
+ partitioned table's partitions from query plans. This also controls
+ the planner's ability to generate query plans which allow the query
+ executor to remove (ignore) partitions during query execution. The
+ default is <literal>on</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="guc-enable-partitionwise-join" xreflabel="enable_partitionwise_join">
<term><varname>enable_partitionwise_join</varname> (<type>boolean</type>)
<indexterm>
@@ -4417,8 +4434,7 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
<literal>partition</literal> (examine constraints only for inheritance child
tables and <literal>UNION ALL</literal> subqueries).
<literal>partition</literal> is the default setting.
- It is often used with inheritance and partitioned tables to
- improve performance.
+ It is often used with inheritance tables to improve performance.
</para>
<para>
@@ -4441,11 +4457,11 @@ SELECT * FROM parent WHERE key = 2400;
<para>
Currently, constraint exclusion is enabled by default
- only for cases that are often used to implement table partitioning.
- Turning it on for all tables imposes extra planning overhead that is
- quite noticeable on simple queries, and most often will yield no
- benefit for simple queries. If you have no partitioned tables
- you might prefer to turn it off entirely.
+ only for cases that are often used to implement table partitioning via
+ inheritance tables. Turning it on for all tables imposes extra
+ planning overhead that is quite noticeable on simple queries, and most
+ often will yield no benefit for simple queries. If you have no
+ inheritance partitioned tables you might prefer to turn it off entirely.
</para>
<para>
diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index feb2ab77920..34da0d8d573 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -3196,7 +3196,7 @@ CREATE INDEX ON measurement (logdate);
<listitem>
<para>
- Ensure that the <xref linkend="guc-constraint-exclusion"/>
+ Ensure that the <xref linkend="guc-enable-partition-pruning"/>
configuration parameter is not disabled in <filename>postgresql.conf</filename>.
If it is, queries will not be optimized as desired.
</para>