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

Commitac376a3

Browse files
committed
As Niel so nicely pointed out this morning, the output of EXPLAIN
ANALYZE is not quite clear when branches of the query are neverexecuted. So this tiny patch fixes that.The patch is attached and can also be found at:http://svana.org/kleptog/pgsql/pgsql-explain.patchMartijn van Oosterhout
1 parent1f653ec commitac376a3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎src/backend/commands/explain.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Portions Copyright (c) 1996-2002, 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.88 2002/09/19 22:48:33 tgl Exp $
8+
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.89 2002/10/14 04:26:54 momjian Exp $
99
*
1010
*/
1111

@@ -35,6 +35,7 @@ typedef struct ExplainState
3535
/* options */
3636
boolprintCost;/* print cost */
3737
boolprintNodes;/* do nodeToString() instead */
38+
boolprintAnalyze;/* print actual times */
3839
/* other states */
3940
List*rtable;/* range table */
4041
}ExplainState;
@@ -405,6 +406,11 @@ explain_outNode(StringInfo str, Plan *plan, Plan *outer_plan,
405406
1000.0*plan->instrument->total /nloops,
406407
plan->instrument->ntuples /nloops,
407408
plan->instrument->nloops);
409+
es->printAnalyze= true;
410+
}
411+
elseif(es->printAnalyze )
412+
{
413+
appendStringInfo(str," (never executed)");
408414
}
409415
}
410416
appendStringInfo(str,"\n");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp