Skip to content

Commit ea10ec1

Browse files
committed
Tweak labeling of plan qual conditions for more consistency.
1 parent 7100cbc commit ea10ec1

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

doc/src/sgml/perform.sgml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/perform.sgml,v 1.19 2002/03/24 04:31:05 tgl Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/perform.sgml,v 1.20 2002/03/24 17:11:37 tgl Exp $
33
-->
44

55
<chapter id="performance-tips">
@@ -116,7 +116,7 @@ SELECT * FROM pg_class WHERE relname = 'tenk1';
116116
</para>
117117

118118
<para>
119-
Now let's modify the query to add a qualification clause:
119+
Now let's modify the query to add a WHERE condition:
120120

121121
<programlisting>
122122
regression=# EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 1000;
@@ -142,14 +142,14 @@ regression=# EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 1000;
142142
</para>
143143

144144
<para>
145-
Modify the query to restrict the qualification even more:
145+
Modify the query to restrict the condition even more:
146146

147147
<programlisting>
148148
regression=# EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 50;
149149
QUERY PLAN
150150
-------------------------------------------------------------------------------
151151
Index Scan using tenk1_unique1 on tenk1 (cost=0.00..179.33 rows=49 width=148)
152-
Index Filter: (unique1 &lt; 50)
152+
Index Cond: (unique1 &lt; 50)
153153
</programlisting>
154154

155155
and you will see that if we make the WHERE condition selective
@@ -161,15 +161,15 @@ regression=# EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 50;
161161
</para>
162162

163163
<para>
164-
Add another condition to the qualification:
164+
Add another clause to the WHERE condition:
165165

166166
<programlisting>
167167
regression=# EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 50 AND
168168
regression-# stringu1 = 'xxx';
169169
QUERY PLAN
170170
-------------------------------------------------------------------------------
171171
Index Scan using tenk1_unique1 on tenk1 (cost=0.00..179.45 rows=1 width=148)
172-
Index Filter: (unique1 &lt; 50)
172+
Index Cond: (unique1 &lt; 50)
173173
Filter: (stringu1 = 'xxx'::name)
174174
</programlisting>
175175

@@ -193,10 +193,10 @@ regression-# AND t1.unique2 = t2.unique2;
193193
Nested Loop (cost=0.00..327.02 rows=49 width=296)
194194
-&gt; Index Scan using tenk1_unique1 on tenk1 t1
195195
(cost=0.00..179.33 rows=49 width=148)
196-
Index Filter: (unique1 &lt; 50)
196+
Index Cond: (unique1 &lt; 50)
197197
-&gt; Index Scan using tenk2_unique2 on tenk2 t2
198198
(cost=0.00..3.01 rows=1 width=148)
199-
Index Filter: ("outer".unique2 = t2.unique2)
199+
Index Cond: ("outer".unique2 = t2.unique2)
200200
</programlisting>
201201
</para>
202202

@@ -208,7 +208,7 @@ regression-# AND t1.unique2 = t2.unique2;
208208
affect row count of the outer scan. For the inner scan, the unique2 value of the
209209
current
210210
outer-scan tuple is plugged into the inner index scan
211-
to produce an index qualification like
211+
to produce an index condition like
212212
<literal>t2.unique2 = <replaceable>constant</replaceable></literal>. So we get the
213213
same inner-scan plan and costs that we'd get from, say, <literal>explain select
214214
* from tenk2 where unique2 = 42</literal>. The costs of the loop node are then set
@@ -246,7 +246,7 @@ regression-# AND t1.unique2 = t2.unique2;
246246
-&gt; Hash (cost=179.33..179.33 rows=49 width=148)
247247
-&gt; Index Scan using tenk1_unique1 on tenk1 t1
248248
(cost=0.00..179.33 rows=49 width=148)
249-
Index Filter: (unique1 &lt; 50)
249+
Index Cond: (unique1 &lt; 50)
250250
</programlisting>
251251

252252
This plan proposes to extract the 50 interesting rows of <classname>tenk1</classname>
@@ -279,11 +279,11 @@ regression-# WHERE t1.unique1 &lt; 50 AND t1.unique2 = t2.unique2;
279279
-&gt; Index Scan using tenk1_unique1 on tenk1 t1
280280
(cost=0.00..179.33 rows=49 width=148)
281281
(actual time=0.63..8.91 rows=50 loops=1)
282-
Index Filter: (unique1 &lt; 50)
282+
Index Cond: (unique1 &lt; 50)
283283
-&gt; Index Scan using tenk2_unique2 on tenk2 t2
284284
(cost=0.00..3.01 rows=1 width=148)
285285
(actual time=0.29..0.32 rows=1 loops=50)
286-
Index Filter: ("outer".unique2 = t2.unique2)
286+
Index Cond: ("outer".unique2 = t2.unique2)
287287
Total runtime: 31.60 msec
288288
</screen>
289289

doc/src/sgml/ref/explain.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/explain.sgml,v 1.18 2002/03/24 16:57:29 tgl Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/explain.sgml,v 1.19 2002/03/24 17:11:37 tgl Exp $
33
PostgreSQL documentation
44
-->
55

@@ -209,7 +209,7 @@ EXPLAIN SELECT * FROM foo WHERE i = 4;
209209
QUERY PLAN
210210
--------------------------------------------------------------
211211
Index Scan using fi on foo (cost=0.00..5.98 rows=1 width=4)
212-
Index Filter: (i = 4)
212+
Index Cond: (i = 4)
213213
(2 rows)
214214
</computeroutput>
215215
</programlisting>
@@ -226,7 +226,7 @@ EXPLAIN SELECT sum(i) FROM foo WHERE i &lt; 10;
226226
---------------------------------------------------------------------
227227
Aggregate (cost=23.93..23.93 rows=1 width=4)
228228
-&gt; Index Scan using fi on foo (cost=0.00..23.92 rows=6 width=4)
229-
Index Filter: (i &lt; 10)
229+
Index Cond: (i &lt; 10)
230230
(3 rows)
231231
</computeroutput>
232232
</programlisting>

src/backend/commands/explain.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
66
* Portions Copyright (c) 1994-5, Regents of the University of California
77
*
8-
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.74 2002/03/24 04:31:07 tgl Exp $
8+
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.75 2002/03/24 17:11:36 tgl Exp $
99
*
1010
*/
1111

@@ -389,7 +389,7 @@ explain_outNode(StringInfo str, Plan *plan, Plan *outer_plan,
389389
{
390390
case T_IndexScan:
391391
show_scan_qual(((IndexScan *) plan)->indxqualorig, true,
392-
"Index Filter",
392+
"Index Cond",
393393
((Scan *) plan)->scanrelid,
394394
outer_plan,
395395
str, indent, es);
@@ -409,7 +409,7 @@ explain_outNode(StringInfo str, Plan *plan, Plan *outer_plan,
409409
break;
410410
case T_NestLoop:
411411
show_upper_qual(((NestLoop *) plan)->join.joinqual,
412-
"Join Cond",
412+
"Join Filter",
413413
"outer", OUTER, outerPlan(plan),
414414
"inner", INNER, innerPlan(plan),
415415
str, indent, es);
@@ -426,7 +426,7 @@ explain_outNode(StringInfo str, Plan *plan, Plan *outer_plan,
426426
"inner", INNER, innerPlan(plan),
427427
str, indent, es);
428428
show_upper_qual(((MergeJoin *) plan)->join.joinqual,
429-
"Join Cond",
429+
"Join Filter",
430430
"outer", OUTER, outerPlan(plan),
431431
"inner", INNER, innerPlan(plan),
432432
str, indent, es);
@@ -443,7 +443,7 @@ explain_outNode(StringInfo str, Plan *plan, Plan *outer_plan,
443443
"inner", INNER, innerPlan(plan),
444444
str, indent, es);
445445
show_upper_qual(((HashJoin *) plan)->join.joinqual,
446-
"Join Cond",
446+
"Join Filter",
447447
"outer", OUTER, outerPlan(plan),
448448
"inner", INNER, innerPlan(plan),
449449
str, indent, es);

0 commit comments

Comments
 (0)