Skip to content

Commit 6f33c17

Browse files
committed
Produce slightly saner-looking EXPLAIN output for a Result node.
1 parent c969fed commit 6f33c17

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/backend/optimizer/plan/createplan.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.108 2001/08/21 16:36:03 tgl Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.109 2001/09/21 04:06:04 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -1827,7 +1827,16 @@ make_result(List *tlist,
18271827
#ifdef NOT_USED
18281828
tlist = generate_fjoin(tlist);
18291829
#endif
1830-
copy_plan_costsize(plan, subplan);
1830+
if (subplan)
1831+
copy_plan_costsize(plan, subplan);
1832+
else
1833+
{
1834+
plan->startup_cost = 0;
1835+
plan->total_cost = cpu_tuple_cost;
1836+
plan->plan_rows = 1; /* wrong if we have a set-valued function? */
1837+
plan->plan_width = 0; /* XXX try to be smarter? */
1838+
}
1839+
18311840
plan->state = (EState *) NULL;
18321841
plan->targetlist = tlist;
18331842
plan->qual = NIL;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy