diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-10-14 04:26:54 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-10-14 04:26:54 +0000 |
commit | ac376a3eb9ff779753955422f7facd6d26e7d801 (patch) | |
tree | 875a38c69f32af6656bcab95b4763afe7dde821d /src/backend/commands/explain.c | |
parent | 1f653ec31ef0f88af1216c0631605e859b4794a5 (diff) | |
download | postgresql-ac376a3eb9ff779753955422f7facd6d26e7d801.tar.gz postgresql-ac376a3eb9ff779753955422f7facd6d26e7d801.zip |
As Niel so nicely pointed out this morning, the output of EXPLAIN
ANALYZE is not quite clear when branches of the query are never
executed. So this tiny patch fixes that.
The patch is attached and can also be found at:
http://svana.org/kleptog/pgsql/pgsql-explain.patch
Martijn van Oosterhout
Diffstat (limited to 'src/backend/commands/explain.c')
-rw-r--r-- | src/backend/commands/explain.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 2478c4f769f..f0aabc9dc8d 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -5,7 +5,7 @@ * Portions Copyright (c) 1996-2002, 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.88 2002/09/19 22:48:33 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.89 2002/10/14 04:26:54 momjian Exp $ * */ @@ -35,6 +35,7 @@ typedef struct ExplainState /* options */ bool printCost; /* print cost */ bool printNodes; /* do nodeToString() instead */ + bool printAnalyze; /* print actual times */ /* other states */ List *rtable; /* range table */ } ExplainState; @@ -405,6 +406,11 @@ explain_outNode(StringInfo str, Plan *plan, Plan *outer_plan, 1000.0 * plan->instrument->total / nloops, plan->instrument->ntuples / nloops, plan->instrument->nloops); + es->printAnalyze = true; + } + else if( es->printAnalyze ) + { + appendStringInfo(str, " (never executed)"); } } appendStringInfo(str, "\n"); |