diff --git a/doc/src/sgml/perform.sgml b/doc/src/sgml/perform.sgml index 6b13d6ae3a..17c8a348d0 100644 --- a/doc/src/sgml/perform.sgml +++ b/doc/src/sgml/perform.sgml @@ -1,5 +1,5 @@ @@ -116,7 +116,7 @@ SELECT * FROM pg_class WHERE relname = 'tenk1'; - Now let's modify the query to add a qualification clause: + Now let's modify the query to add a WHERE condition: regression=# EXPLAIN SELECT * FROM tenk1 WHERE unique1 < 1000; @@ -142,14 +142,14 @@ regression=# EXPLAIN SELECT * FROM tenk1 WHERE unique1 < 1000; - Modify the query to restrict the qualification even more: + Modify the query to restrict the condition even more: regression=# EXPLAIN SELECT * FROM tenk1 WHERE unique1 < 50; QUERY PLAN ------------------------------------------------------------------------------- Index Scan using tenk1_unique1 on tenk1 (cost=0.00..179.33 rows=49 width=148) - Index Filter: (unique1 < 50) + Index Cond: (unique1 < 50) and you will see that if we make the WHERE condition selective @@ -161,7 +161,7 @@ regression=# EXPLAIN SELECT * FROM tenk1 WHERE unique1 < 50; - Add another condition to the qualification: + Add another clause to the WHERE condition: regression=# EXPLAIN SELECT * FROM tenk1 WHERE unique1 < 50 AND @@ -169,7 +169,7 @@ regression-# stringu1 = 'xxx'; QUERY PLAN ------------------------------------------------------------------------------- Index Scan using tenk1_unique1 on tenk1 (cost=0.00..179.45 rows=1 width=148) - Index Filter: (unique1 < 50) + Index Cond: (unique1 < 50) Filter: (stringu1 = 'xxx'::name) @@ -193,10 +193,10 @@ regression-# AND t1.unique2 = t2.unique2; Nested Loop (cost=0.00..327.02 rows=49 width=296) -> Index Scan using tenk1_unique1 on tenk1 t1 (cost=0.00..179.33 rows=49 width=148) - Index Filter: (unique1 < 50) + Index Cond: (unique1 < 50) -> Index Scan using tenk2_unique2 on tenk2 t2 (cost=0.00..3.01 rows=1 width=148) - Index Filter: ("outer".unique2 = t2.unique2) + Index Cond: ("outer".unique2 = t2.unique2) @@ -208,7 +208,7 @@ regression-# AND t1.unique2 = t2.unique2; affect row count of the outer scan. For the inner scan, the unique2 value of the current outer-scan tuple is plugged into the inner index scan - to produce an index qualification like + to produce an index condition like t2.unique2 = constant. So we get the same inner-scan plan and costs that we'd get from, say, explain select * from tenk2 where unique2 = 42. The costs of the loop node are then set @@ -246,7 +246,7 @@ regression-# AND t1.unique2 = t2.unique2; -> Hash (cost=179.33..179.33 rows=49 width=148) -> Index Scan using tenk1_unique1 on tenk1 t1 (cost=0.00..179.33 rows=49 width=148) - Index Filter: (unique1 < 50) + Index Cond: (unique1 < 50) This plan proposes to extract the 50 interesting rows of tenk1 @@ -279,11 +279,11 @@ regression-# WHERE t1.unique1 < 50 AND t1.unique2 = t2.unique2; -> Index Scan using tenk1_unique1 on tenk1 t1 (cost=0.00..179.33 rows=49 width=148) (actual time=0.63..8.91 rows=50 loops=1) - Index Filter: (unique1 < 50) + Index Cond: (unique1 < 50) -> Index Scan using tenk2_unique2 on tenk2 t2 (cost=0.00..3.01 rows=1 width=148) (actual time=0.29..0.32 rows=1 loops=50) - Index Filter: ("outer".unique2 = t2.unique2) + Index Cond: ("outer".unique2 = t2.unique2) Total runtime: 31.60 msec diff --git a/doc/src/sgml/ref/explain.sgml b/doc/src/sgml/ref/explain.sgml index e8ef9fc76f..46c6c8c955 100644 --- a/doc/src/sgml/ref/explain.sgml +++ b/doc/src/sgml/ref/explain.sgml @@ -1,5 +1,5 @@ @@ -209,7 +209,7 @@ EXPLAIN SELECT * FROM foo WHERE i = 4; QUERY PLAN -------------------------------------------------------------- Index Scan using fi on foo (cost=0.00..5.98 rows=1 width=4) - Index Filter: (i = 4) + Index Cond: (i = 4) (2 rows) @@ -226,7 +226,7 @@ EXPLAIN SELECT sum(i) FROM foo WHERE i < 10; --------------------------------------------------------------------- Aggregate (cost=23.93..23.93 rows=1 width=4) -> Index Scan using fi on foo (cost=0.00..23.92 rows=6 width=4) - Index Filter: (i < 10) + Index Cond: (i < 10) (3 rows) diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 25b9f13fe2..5a5df6a47c 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -5,7 +5,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994-5, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.74 2002/03/24 04:31:07 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.75 2002/03/24 17:11:36 tgl Exp $ * */ @@ -389,7 +389,7 @@ explain_outNode(StringInfo str, Plan *plan, Plan *outer_plan, { case T_IndexScan: show_scan_qual(((IndexScan *) plan)->indxqualorig, true, - "Index Filter", + "Index Cond", ((Scan *) plan)->scanrelid, outer_plan, str, indent, es); @@ -409,7 +409,7 @@ explain_outNode(StringInfo str, Plan *plan, Plan *outer_plan, break; case T_NestLoop: show_upper_qual(((NestLoop *) plan)->join.joinqual, - "Join Cond", + "Join Filter", "outer", OUTER, outerPlan(plan), "inner", INNER, innerPlan(plan), str, indent, es); @@ -426,7 +426,7 @@ explain_outNode(StringInfo str, Plan *plan, Plan *outer_plan, "inner", INNER, innerPlan(plan), str, indent, es); show_upper_qual(((MergeJoin *) plan)->join.joinqual, - "Join Cond", + "Join Filter", "outer", OUTER, outerPlan(plan), "inner", INNER, innerPlan(plan), str, indent, es); @@ -443,7 +443,7 @@ explain_outNode(StringInfo str, Plan *plan, Plan *outer_plan, "inner", INNER, innerPlan(plan), str, indent, es); show_upper_qual(((HashJoin *) plan)->join.joinqual, - "Join Cond", + "Join Filter", "outer", OUTER, outerPlan(plan), "inner", INNER, innerPlan(plan), str, indent, es);