Also improve wording.
* Add GUC to issue notice about queries that use unjoined tables
* Allow EXPLAIN to identify tables that were skipped because of
- enable_constraint_exclusion
+ constraint_exclusion
* Allow EXPLAIN output to be more easily processed by scripts
* Allow the creation of indexes with mixed ascending/descending specifiers
* -Fix incorrect rtree results due to wrong assumptions about "over"
operator semantics
-* Allow enable_constraint_exclusion to work for UNIONs like it does for
+* Allow constraint_exclusion to work for UNIONs like it does for
inheritance, and allow it to work for UPDATE and DELETE queries
Add GUC to issue notice about queries that use unjoined tables
Allow EXPLAIN to identify tables that were skipped because of
- enable_constraint_exclusion
+ constraint_exclusion
Allow EXPLAIN output to be more easily processed by scripts
CREATE
Allow the creation of indexes with mixed ascending/descending specifiers
-Fix incorrect rtree results due to wrong assumptions about "over"
operator semantics
-
Allow enable_constraint_exclusion to work for UNIONs like it does for
+
Allow constraint_exclusion to work for UNIONs like it does for
inheritance, and allow it to work for UPDATE and DELETE queries
GIST
- enable-constraint-exclusion" xreflabel="enable_constraint_exclusion">
- enable_constraint_exclusion (boolean)
+ constraint-exclusion" xreflabel="constraint_exclusion">
+ constraint_exclusion (boolean)
-
enable_constraint_exclusion> configuration parameter
+
constraint_exclusion> configuration parameter
- Enables or disables the query planner's use of table constraints.
- The default is off>.
+ Enables or disables the query planner's use of table constraints to
+ limit table access. The default is off>.
When this parameter is on>, the planner compares query
- conditions to table CHECK constraints, and omits scanning tables
- for which the conditions contradict the constraints. (Presently
+ conditions with table CHECK constraints, and omits scanning tables
+ where the conditions contradict the constraints. (Presently
this is done only for child tables of inheritance scans.) For
example:
- Currently, enable_constraint_exclusion> defaults to
- off>, because it creates a risk of wrong answers when
- query plans are cached: if a table constraint is changed or dropped,
- the previously generated plan may now be wrong, and there is no
+ Currently, constraint_exclusion> defaults to
+ off>, because it risks incorrect results if
+ query plans are cached --- if a table constraint is changed or dropped,
+ the previously generated plan might now be wrong, and there is no
built-in mechanism to force re-planning. (This deficiency will
probably be addressed in a future
PostgreSQL release.) Another reason
for keeping it off is that the constraint checks are relatively
- expensive to make, and in many circumstances will yield no savings.
+ expensive, and in many circumstances will yield no savings.
It is recommended to turn this on only if you are actually using
partitioned tables designed to take advantage of the feature.
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.135 2005/07/23 21:05:46 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.136 2005/08/22 17:34:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/* These parameters are set by GUC */
-bool enable_constraint_exclusion = false;
+bool constraint_exclusion = false;
bool enable_geqo = false; /* just in case GUC doesn't set it */
int geqo_threshold;
* exclusion, just ignore it. (We have to have converted the
* baserestrictinfo Vars before we can make the test.)
*/
- if (enable_constraint_exclusion)
+ if (constraint_exclusion)
{
List *constraint_pred;
* Written by Peter Eisentraut
.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.285 2005/08/21 03:39:34 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.286 2005/08/22 17:34:59 momjian Exp $
*
*--------------------------------------------------------------------
*/
true, NULL, NULL
},
{
- {"enable_constraint_exclusion", PGC_USERSET, QUERY_TUNING_OTHER,
- gettext_noop("Enables the planner's use of constraints in queries."),
- gettext_noop("Constraints will be examined to exclude tables "
- "that can be proven not to be required to produce "
- "a correct result for the query.")
+ {"constraint_exclusion", PGC_USERSET, QUERY_TUNING_OTHER,
+ gettext_noop("Enables the planner to use constraints to limit table access."),
+ gettext_noop("This prevents table access if the table constraints "
+ "guarantee that table access is necessary.")
},
- &enable_constraint_exclusion,
+ &constraint_exclusion,
false, NULL, NULL
},
{
# - Other Planner Options -
#default_statistics_target = 10 # range 1-1000
-#enable_constraint_exclusion = off
+#constraint_exclusion = off
#from_collapse_limit = 8
#join_collapse_limit = 8 # 1 disables collapsing of explicit
# JOINs
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/optimizer/cost.h,v 1.69 2005/07/23 21:05:48 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/optimizer/cost.h,v 1.70 2005/08/22 17:35:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern bool enable_nestloop;
extern bool enable_mergejoin;
extern bool enable_hashjoin;
-extern bool enable_constraint_exclusion;
+extern bool constraint_exclusion;
extern double clamp_row_est(double nrows);
extern void cost_seqscan(Path *path, PlannerInfo *root, RelOptInfo *baserel);
SELECT name, setting FROM pg_settings WHERE name LIKE 'enable%';
name | setting
------------------------------+---------
+-------------------+---------
enable_bitmapscan | on
- enable_constraint_exclusion | off
enable_hashagg | on
enable_hashjoin | on
enable_indexscan | on
enable_seqscan | on
enable_sort | on
enable_tidscan | on
-(10 rows)
+(9 rows)
CREATE TABLE foo2(fooid int, f2 int);
INSERT INTO foo2 VALUES(1, 11);