Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita7f4925

Browse files
committed
enable_constraint_exclusion => constraint_exclusion
Also improve wording.
1 parent8ad3965 commita7f4925

File tree

8 files changed

+31
-33
lines changed

8 files changed

+31
-33
lines changed

‎doc/TODO

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ SQL Commands
385385

386386
* Add GUC to issue notice about queries that use unjoined tables
387387
* Allow EXPLAIN to identify tables that were skipped because of
388-
enable_constraint_exclusion
388+
constraint_exclusion
389389
* Allow EXPLAIN output to be more easily processed by scripts
390390

391391

@@ -769,7 +769,7 @@ Indexes
769769
* Allow the creation of indexes with mixed ascending/descending specifiers
770770
* -Fix incorrect rtree results due to wrong assumptions about "over"
771771
operator semantics
772-
* Allowenable_constraint_exclusion to work for UNIONs like it does for
772+
* Allowconstraint_exclusion to work for UNIONs like it does for
773773
inheritance, and allow it to work for UPDATE and DELETE queries
774774

775775

‎doc/src/FAQ/TODO.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ <h1><a name="section_8">SQL Commands</a></h1>
355355
</p>
356356
</li><li>Add GUC to issue notice about queries that use unjoined tables
357357
</li><li>Allow EXPLAIN to identify tables that were skipped because of
358-
enable_constraint_exclusion
358+
constraint_exclusion
359359
</li><li>Allow EXPLAIN output to be more easily processed by scripts
360360
</li><li>CREATE
361361
<ul>
@@ -694,7 +694,7 @@ <h1><a name="section_13">Indexes</a></h1>
694694
</li><li>Allow the creation of indexes with mixed ascending/descending specifiers
695695
</li><li>-<em>Fix incorrect rtree results due to wrong assumptions about "over"</em>
696696
operator semantics
697-
</li><li>Allowenable_constraint_exclusion to work for UNIONs like it does for
697+
</li><li>Allowconstraint_exclusion to work for UNIONs like it does for
698698
inheritance, and allow it to work for UPDATE and DELETE queries
699699
</li><li>GIST
700700
<ul>

‎doc/src/sgml/runtime.sgml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.346 2005/08/21 03:39:26 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.347 2005/08/22 17:34:56 momjian Exp $
33
-->
44

55
<chapter Id="runtime">
@@ -2352,24 +2352,24 @@ archive_command = 'copy "%p" /mnt/server/archivedir/"%f"' # Windows
23522352
</listitem>
23532353
</varlistentry>
23542354

2355-
<varlistentry id="guc-enable-constraint-exclusion" xreflabel="enable_constraint_exclusion">
2356-
<term><varname>enable_constraint_exclusion</varname> (<type>boolean</type>)</term>
2355+
<varlistentry id="guc-constraint-exclusion" xreflabel="constraint_exclusion">
2356+
<term><varname>constraint_exclusion</varname> (<type>boolean</type>)</term>
23572357
<indexterm>
23582358
<primary>constraint exclusion</primary>
23592359
</indexterm>
23602360
<indexterm>
2361-
<primary><varname>enable_constraint_exclusion</> configuration parameter</primary>
2361+
<primary><varname>constraint_exclusion</> configuration parameter</primary>
23622362
</indexterm>
23632363
<listitem>
23642364
<para>
2365-
Enables or disables the query planner's use of table constraints.
2366-
The default is <literal>off</>.
2365+
Enables or disables the query planner's use of table constraints to
2366+
limit table access.The default is <literal>off</>.
23672367
</para>
23682368

23692369
<para>
23702370
When this parameter is <literal>on</>, the planner compares query
2371-
conditionsto table CHECK constraints, and omits scanning tables
2372-
for which the conditions contradict the constraints. (Presently
2371+
conditionswith table CHECK constraints, and omits scanning tables
2372+
where the conditions contradict the constraints. (Presently
23732373
this is done only for child tables of inheritance scans.) For
23742374
example:
23752375

@@ -2387,15 +2387,15 @@ SELECT * FROM parent WHERE key = 2400;
23872387
</para>
23882388

23892389
<para>
2390-
Currently, <varname>enable_constraint_exclusion</> defaults to
2391-
<literal>off</>, because itcreates a risk of wrong answers when
2392-
query plans are cached: if a table constraint is changed or dropped,
2393-
the previously generated planmay now be wrong, and there is no
2390+
Currently, <varname>constraint_exclusion</> defaults to
2391+
<literal>off</>, because itrisks incorrect results if
2392+
query plans are cached --- if a table constraint is changed or dropped,
2393+
the previously generated planmight now be wrong, and there is no
23942394
built-in mechanism to force re-planning. (This deficiency will
23952395
probably be addressed in a future
23962396
<productname>PostgreSQL</productname> release.) Another reason
23972397
for keeping it off is that the constraint checks are relatively
2398-
expensive to make, and in many circumstances will yield no savings.
2398+
expensive, and in many circumstances will yield no savings.
23992399
It is recommended to turn this on only if you are actually using
24002400
partitioned tables designed to take advantage of the feature.
24012401
</para>

‎src/backend/optimizer/path/allpaths.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.135 2005/07/23 21:05:46 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.136 2005/08/22 17:34:58 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -36,7 +36,7 @@
3636

3737

3838
/* These parameters are set by GUC */
39-
boolenable_constraint_exclusion= false;
39+
boolconstraint_exclusion= false;
4040
boolenable_geqo= false;/* just in case GUC doesn't set it */
4141
intgeqo_threshold;
4242

@@ -318,7 +318,7 @@ set_inherited_rel_pathlist(PlannerInfo *root, RelOptInfo *rel,
318318
* exclusion, just ignore it. (We have to have converted the
319319
* baserestrictinfo Vars before we can make the test.)
320320
*/
321-
if (enable_constraint_exclusion)
321+
if (constraint_exclusion)
322322
{
323323
List*constraint_pred;
324324

‎src/backend/utils/misc/guc.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.285 2005/08/21 03:39:34 tgl Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.286 2005/08/22 17:34:59 momjian Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -453,13 +453,12 @@ static struct config_bool ConfigureNamesBool[] =
453453
true,NULL,NULL
454454
},
455455
{
456-
{"enable_constraint_exclusion",PGC_USERSET,QUERY_TUNING_OTHER,
457-
gettext_noop("Enables the planner's use of constraints in queries."),
458-
gettext_noop("Constraints will be examined to exclude tables "
459-
"that can be proven not to be required to produce "
460-
"a correct result for the query.")
456+
{"constraint_exclusion",PGC_USERSET,QUERY_TUNING_OTHER,
457+
gettext_noop("Enables the planner to use constraints to limit table access."),
458+
gettext_noop("This prevents table access if the table constraints "
459+
"guarantee that table access is necessary.")
461460
},
462-
&enable_constraint_exclusion,
461+
&constraint_exclusion,
463462
false,NULL,NULL
464463
},
465464
{

‎src/backend/utils/misc/postgresql.conf.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
# - Other Planner Options -
191191

192192
#default_statistics_target = 10# range 1-1000
193-
#enable_constraint_exclusion = off
193+
#constraint_exclusion = off
194194
#from_collapse_limit = 8
195195
#join_collapse_limit = 8# 1 disables collapsing of explicit
196196
# JOINs

‎src/include/optimizer/cost.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/optimizer/cost.h,v 1.69 2005/07/23 21:05:48 tgl Exp $
10+
* $PostgreSQL: pgsql/src/include/optimizer/cost.h,v 1.70 2005/08/22 17:35:03 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -49,7 +49,7 @@ extern bool enable_hashagg;
4949
externboolenable_nestloop;
5050
externboolenable_mergejoin;
5151
externboolenable_hashjoin;
52-
externboolenable_constraint_exclusion;
52+
externboolconstraint_exclusion;
5353

5454
externdoubleclamp_row_est(doublenrows);
5555
externvoidcost_seqscan(Path*path,PlannerInfo*root,RelOptInfo*baserel);

‎src/test/regress/expected/rangefuncs.out

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
SELECT name, setting FROM pg_settings WHERE name LIKE 'enable%';
22
name | setting
3-
-----------------------------+---------
3+
-------------------+---------
44
enable_bitmapscan | on
5-
enable_constraint_exclusion | off
65
enable_hashagg | on
76
enable_hashjoin | on
87
enable_indexscan | on
@@ -11,7 +10,7 @@ SELECT name, setting FROM pg_settings WHERE name LIKE 'enable%';
1110
enable_seqscan | on
1211
enable_sort | on
1312
enable_tidscan | on
14-
(10 rows)
13+
(9 rows)
1514

1615
CREATE TABLE foo2(fooid int, f2 int);
1716
INSERT INTO foo2 VALUES(1, 11);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp