From 055fb8d33da6ff9003e3da4b9944bdcd2e2b2a49 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Mon, 23 Apr 2018 17:57:43 -0300 Subject: 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 --- doc/src/sgml/config.sgml | 30 +++++++++++++++++++++++------- doc/src/sgml/ddl.sgml | 2 +- 2 files changed, 24 insertions(+), 8 deletions(-) (limited to 'doc/src') 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 num_sync ( + enable_partition_pruning (boolean) + + enable_partition_pruning configuration parameter + + + + + 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 on. + + + + enable_partitionwise_join (boolean) @@ -4417,8 +4434,7 @@ ANY num_sync ( + Ensure that the configuration parameter is not disabled in postgresql.conf. If it is, queries will not be optimized as desired. -- cgit v1.2.3