* Portions Copyright (c) 1994-5, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.172 2008/04/17 18:30:18 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.173 2008/04/18 01:42:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "commands/prepare.h"
#include "commands/trigger.h"
#include "executor/instrument.h"
-#include "nodes/print.h"
#include "optimizer/clauses.h"
#include "optimizer/planner.h"
#include "optimizer/var.h"
typedef struct ExplainState
{
/* options */
- bool printNodes; /* do nodeToString() too */
+ bool printTList; /* print plan targetlists */
bool printAnalyze; /* print actual times */
/* other states */
PlannedStmt *pstmt; /* top of plan */
es = (ExplainState *) palloc0(sizeof(ExplainState));
- es->printNodes = stmt->verbose;
+ es->printTList = stmt->verbose;
es->printAnalyze = stmt->analyze;
es->pstmt = queryDesc->plannedstmt;
es->rtable = queryDesc->plannedstmt->rtable;
- if (es->printNodes)
- {
- char *s;
- char *f;
-
- s = nodeToString(queryDesc->plannedstmt->planTree);
- if (s)
- {
- if (Explain_pretty_print)
- f = pretty_format_node_dump(s);
- else
- f = format_node_dump(s);
- pfree(s);
- do_text_output_multiline(tstate, f);
- pfree(f);
- do_text_output_oneline(tstate, ""); /* separator line */
- }
- }
-
initStringInfo(&buf);
explain_outNode(&buf,
queryDesc->plannedstmt->planTree, queryDesc->planstate,
appendStringInfoChar(str, '\n');
/* target list */
- show_plan_tlist(plan, str, indent, es);
+ if (es->printTList)
+ show_plan_tlist(plan, str, indent, es);
/* quals, sort keys, etc */
switch (nodeTag(plan))
show_plan_tlist(Plan *plan,
StringInfo str, int indent, ExplainState *es)
{
-#ifdef EXPLAIN_PRINT_TLISTS
List *context;
bool useprefix;
ListCell *lc;
}
appendStringInfoChar(str, '\n');
-#endif /* EXPLAIN_PRINT_TLISTS */
}
/*
* Written by Peter Eisentraut
.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.446 2008/04/04 17:25:23 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.447 2008/04/18 01:42:17 tgl Exp $
*
*--------------------------------------------------------------------
*/
bool Debug_print_parse = false;
bool Debug_print_rewritten = false;
bool Debug_pretty_print = false;
-bool Explain_pretty_print = true;
bool log_parser_stats = false;
bool log_planner_stats = false;
},
#endif
- {
- {"explain_pretty_print", PGC_USERSET, CLIENT_CONN_OTHER,
- gettext_noop("Uses the indented output format for EXPLAIN VERBOSE."),
- NULL
- },
- &Explain_pretty_print,
- true, NULL, NULL
- },
-
{
{"track_activities", PGC_SUSET, STATS_COLLECTOR,
gettext_noop("Collects information about executing commands."),
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
* Written by Peter Eisentraut
.
*
- * $PostgreSQL: pgsql/src/include/utils/guc.h,v 1.93 2008/04/02 14:42:56 mha Exp $
+ * $PostgreSQL: pgsql/src/include/utils/guc.h,v 1.94 2008/04/18 01:42:17 tgl Exp $
*--------------------------------------------------------------------
*/
#ifndef GUC_H
extern bool Debug_print_parse;
extern bool Debug_print_rewritten;
extern bool Debug_pretty_print;
-extern bool Explain_pretty_print;
extern bool log_parser_stats;
extern bool log_planner_stats;