mirror of
https://github.com/postgres/postgres.git
synced 2025-05-21 00:02:53 -04:00
enable_constraint_exclusion => constraint_exclusion
Also improve wording.
This commit is contained in:
parent
8ad3965a11
commit
a7f49252d2
4
doc/TODO
4
doc/TODO
@ -385,7 +385,7 @@ SQL Commands
|
|||||||
|
|
||||||
* Add GUC to issue notice about queries that use unjoined tables
|
* Add GUC to issue notice about queries that use unjoined tables
|
||||||
* Allow EXPLAIN to identify tables that were skipped because of
|
* 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 EXPLAIN output to be more easily processed by scripts
|
||||||
|
|
||||||
|
|
||||||
@ -769,7 +769,7 @@ Indexes
|
|||||||
* Allow the creation of indexes with mixed ascending/descending specifiers
|
* Allow the creation of indexes with mixed ascending/descending specifiers
|
||||||
* -Fix incorrect rtree results due to wrong assumptions about "over"
|
* -Fix incorrect rtree results due to wrong assumptions about "over"
|
||||||
operator semantics
|
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
|
inheritance, and allow it to work for UPDATE and DELETE queries
|
||||||
|
|
||||||
|
|
||||||
|
@ -355,7 +355,7 @@ first.
|
|||||||
</p>
|
</p>
|
||||||
</li><li>Add GUC to issue notice about queries that use unjoined tables
|
</li><li>Add GUC to issue notice about queries that use unjoined tables
|
||||||
</li><li>Allow EXPLAIN to identify tables that were skipped because of
|
</li><li>Allow EXPLAIN to identify tables that were skipped because of
|
||||||
enable_constraint_exclusion
|
constraint_exclusion
|
||||||
</li><li>Allow EXPLAIN output to be more easily processed by scripts
|
</li><li>Allow EXPLAIN output to be more easily processed by scripts
|
||||||
</li><li>CREATE
|
</li><li>CREATE
|
||||||
<ul>
|
<ul>
|
||||||
@ -694,7 +694,7 @@ first.
|
|||||||
</li><li>Allow the creation of indexes with mixed ascending/descending specifiers
|
</li><li>Allow the creation of indexes with mixed ascending/descending specifiers
|
||||||
</li><li>-<em>Fix incorrect rtree results due to wrong assumptions about "over"</em>
|
</li><li>-<em>Fix incorrect rtree results due to wrong assumptions about "over"</em>
|
||||||
operator semantics
|
operator semantics
|
||||||
</li><li>Allow enable_constraint_exclusion to work for UNIONs like it does for
|
</li><li>Allow constraint_exclusion to work for UNIONs like it does for
|
||||||
inheritance, and allow it to work for UPDATE and DELETE queries
|
inheritance, and allow it to work for UPDATE and DELETE queries
|
||||||
</li><li>GIST
|
</li><li>GIST
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.346 2005/08/21 03:39:26 tgl Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.347 2005/08/22 17:34:56 momjian Exp $
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<chapter Id="runtime">
|
<chapter Id="runtime">
|
||||||
@ -2352,24 +2352,24 @@ archive_command = 'copy "%p" /mnt/server/archivedir/"%f"' # Windows
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="guc-enable-constraint-exclusion" xreflabel="enable_constraint_exclusion">
|
<varlistentry id="guc-constraint-exclusion" xreflabel="constraint_exclusion">
|
||||||
<term><varname>enable_constraint_exclusion</varname> (<type>boolean</type>)</term>
|
<term><varname>constraint_exclusion</varname> (<type>boolean</type>)</term>
|
||||||
<indexterm>
|
<indexterm>
|
||||||
<primary>constraint exclusion</primary>
|
<primary>constraint exclusion</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
<indexterm>
|
<indexterm>
|
||||||
<primary><varname>enable_constraint_exclusion</> configuration parameter</primary>
|
<primary><varname>constraint_exclusion</> configuration parameter</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Enables or disables the query planner's use of table constraints.
|
Enables or disables the query planner's use of table constraints to
|
||||||
The default is <literal>off</>.
|
limit table access. The default is <literal>off</>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
When this parameter is <literal>on</>, the planner compares query
|
When this parameter is <literal>on</>, the planner compares query
|
||||||
conditions to table CHECK constraints, and omits scanning tables
|
conditions with table CHECK constraints, and omits scanning tables
|
||||||
for which the conditions contradict the constraints. (Presently
|
where the conditions contradict the constraints. (Presently
|
||||||
this is done only for child tables of inheritance scans.) For
|
this is done only for child tables of inheritance scans.) For
|
||||||
example:
|
example:
|
||||||
|
|
||||||
@ -2387,15 +2387,15 @@ SELECT * FROM parent WHERE key = 2400;
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Currently, <varname>enable_constraint_exclusion</> defaults to
|
Currently, <varname>constraint_exclusion</> defaults to
|
||||||
<literal>off</>, because it creates a risk of wrong answers when
|
<literal>off</>, because it risks incorrect results if
|
||||||
query plans are cached: if a table constraint is changed or dropped,
|
query plans are cached --- if a table constraint is changed or dropped,
|
||||||
the previously generated plan may now be wrong, and there is no
|
the previously generated plan might now be wrong, and there is no
|
||||||
built-in mechanism to force re-planning. (This deficiency will
|
built-in mechanism to force re-planning. (This deficiency will
|
||||||
probably be addressed in a future
|
probably be addressed in a future
|
||||||
<productname>PostgreSQL</productname> release.) Another reason
|
<productname>PostgreSQL</productname> release.) Another reason
|
||||||
for keeping it off is that the constraint checks are relatively
|
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
|
It is recommended to turn this on only if you are actually using
|
||||||
partitioned tables designed to take advantage of the feature.
|
partitioned tables designed to take advantage of the feature.
|
||||||
</para>
|
</para>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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 $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* These parameters are set by GUC */
|
/* 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 */
|
bool enable_geqo = false; /* just in case GUC doesn't set it */
|
||||||
int geqo_threshold;
|
int geqo_threshold;
|
||||||
|
|
||||||
@ -318,7 +318,7 @@ set_inherited_rel_pathlist(PlannerInfo *root, RelOptInfo *rel,
|
|||||||
* exclusion, just ignore it. (We have to have converted the
|
* exclusion, just ignore it. (We have to have converted the
|
||||||
* baserestrictinfo Vars before we can make the test.)
|
* baserestrictinfo Vars before we can make the test.)
|
||||||
*/
|
*/
|
||||||
if (enable_constraint_exclusion)
|
if (constraint_exclusion)
|
||||||
{
|
{
|
||||||
List *constraint_pred;
|
List *constraint_pred;
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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 $
|
||||||
*
|
*
|
||||||
*--------------------------------------------------------------------
|
*--------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -453,13 +453,12 @@ static struct config_bool ConfigureNamesBool[] =
|
|||||||
true, NULL, NULL
|
true, NULL, NULL
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{"enable_constraint_exclusion", PGC_USERSET, QUERY_TUNING_OTHER,
|
{"constraint_exclusion", PGC_USERSET, QUERY_TUNING_OTHER,
|
||||||
gettext_noop("Enables the planner's use of constraints in queries."),
|
gettext_noop("Enables the planner to use constraints to limit table access."),
|
||||||
gettext_noop("Constraints will be examined to exclude tables "
|
gettext_noop("This prevents table access if the table constraints "
|
||||||
"that can be proven not to be required to produce "
|
"guarantee that table access is necessary.")
|
||||||
"a correct result for the query.")
|
|
||||||
},
|
},
|
||||||
&enable_constraint_exclusion,
|
&constraint_exclusion,
|
||||||
false, NULL, NULL
|
false, NULL, NULL
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -190,7 +190,7 @@
|
|||||||
# - Other Planner Options -
|
# - Other Planner Options -
|
||||||
|
|
||||||
#default_statistics_target = 10 # range 1-1000
|
#default_statistics_target = 10 # range 1-1000
|
||||||
#enable_constraint_exclusion = off
|
#constraint_exclusion = off
|
||||||
#from_collapse_limit = 8
|
#from_collapse_limit = 8
|
||||||
#join_collapse_limit = 8 # 1 disables collapsing of explicit
|
#join_collapse_limit = 8 # 1 disables collapsing of explicit
|
||||||
# JOINs
|
# JOINs
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* 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 $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -49,7 +49,7 @@ extern bool enable_hashagg;
|
|||||||
extern bool enable_nestloop;
|
extern bool enable_nestloop;
|
||||||
extern bool enable_mergejoin;
|
extern bool enable_mergejoin;
|
||||||
extern bool enable_hashjoin;
|
extern bool enable_hashjoin;
|
||||||
extern bool enable_constraint_exclusion;
|
extern bool constraint_exclusion;
|
||||||
|
|
||||||
extern double clamp_row_est(double nrows);
|
extern double clamp_row_est(double nrows);
|
||||||
extern void cost_seqscan(Path *path, PlannerInfo *root, RelOptInfo *baserel);
|
extern void cost_seqscan(Path *path, PlannerInfo *root, RelOptInfo *baserel);
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
SELECT name, setting FROM pg_settings WHERE name LIKE 'enable%';
|
SELECT name, setting FROM pg_settings WHERE name LIKE 'enable%';
|
||||||
name | setting
|
name | setting
|
||||||
-----------------------------+---------
|
-------------------+---------
|
||||||
enable_bitmapscan | on
|
enable_bitmapscan | on
|
||||||
enable_constraint_exclusion | off
|
|
||||||
enable_hashagg | on
|
enable_hashagg | on
|
||||||
enable_hashjoin | on
|
enable_hashjoin | on
|
||||||
enable_indexscan | on
|
enable_indexscan | on
|
||||||
@ -11,7 +10,7 @@ SELECT name, setting FROM pg_settings WHERE name LIKE 'enable%';
|
|||||||
enable_seqscan | on
|
enable_seqscan | on
|
||||||
enable_sort | on
|
enable_sort | on
|
||||||
enable_tidscan | on
|
enable_tidscan | on
|
||||||
(10 rows)
|
(9 rows)
|
||||||
|
|
||||||
CREATE TABLE foo2(fooid int, f2 int);
|
CREATE TABLE foo2(fooid int, f2 int);
|
||||||
INSERT INTO foo2 VALUES(1, 11);
|
INSERT INTO foo2 VALUES(1, 11);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user