debug_print_plan to appear at LOG message level, not DEBUG1 as historically.
Make debug_pretty_print default to on. Also, cause plans generated via
EXPLAIN to be subject to debug_print_plan. This is all to make
debug_print_plan a reasonably comfortable substitute for the former behavior
of EXPLAIN VERBOSE.
-
+
Server Configuration
debug_print_parse (boolean)
debug_print_rewritten (boolean)
debug_print_plan (boolean)
- debug_pretty_print (boolean)
debug_print_parse> configuration parameter
debug_print_plan> configuration parameter
+
+ These parameters enable various debugging output to be emitted.
+ When set, they print the resulting parse tree, the query rewriter
+ output, or the execution plan for each executed query.
+ These messages are emitted at LOG> message level, so by
+ default they will appear in the server log but will not be sent to the
+ client. You can change that by adjusting
+ and/or
+ .
+ These parameters are off by default.
+
+
+
+
+
+ debug_pretty_print (boolean)
debug_pretty_print> configuration parameter
- These parameters enable various debugging output to be emitted.
- For each executed query, they print
- the resulting parse tree, the query rewriter output, or the
- execution plan. debug_pretty_print indents
- these displays to produce a more readable but much longer
- output format. client_min_messages or
- log_min_messages must be
- DEBUG1 or lower to actually send this output
- to the client or the server log, respectively.
- These parameters are off by default.
+ When set, debug_pretty_print indents the messages
+ produced by debug_print_parse,
+ debug_print_rewritten, or
+ debug_print_plan. This results in more readable
+ but much longer output than the compact> format used when
+ it is off. It is on by default.
* Portions Copyright (c) 1994-5, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.177 2008/08/14 18:47:58 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.178 2008/08/19 18:30:04 tgl Exp $
*
*-------------------------------------------------------------------------
*/
PlannedStmt *plan;
/* plan the query */
- plan = planner(query, 0, params);
+ plan = pg_plan_query(query, 0, params);
/* run it (if needed) and produce output */
ExplainOnePlan(plan, params, stmt, tstate);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.555 2008/08/01 13:16:09 alvherre Exp $
+ * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.556 2008/08/19 18:30:04 tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
{
List *querytree_list;
- if (log_parser_stats)
- ResetUsage();
-
if (Debug_print_parse)
- elog_node_display(DEBUG1, "parse tree", query,
+ elog_node_display(LOG, "parse tree", query,
Debug_pretty_print);
+ if (log_parser_stats)
+ ResetUsage();
+
if (query->commandType == CMD_UTILITY)
{
/* don't rewrite utilities, just dump 'em into result list */
#endif
if (Debug_print_rewritten)
- elog_node_display(DEBUG1, "rewritten parse tree", querytree_list,
+ elog_node_display(LOG, "rewritten parse tree", querytree_list,
Debug_pretty_print);
return querytree_list;
* Print plan if debugging.
*/
if (Debug_print_plan)
- elog_node_display(DEBUG1, "plan", plan, Debug_pretty_print);
+ elog_node_display(LOG, "plan", plan, Debug_pretty_print);
TRACE_POSTGRESQL_QUERY_PLAN_DONE();
* Written by Peter Eisentraut
.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.466 2008/08/15 08:37:40 mha Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.467 2008/08/19 18:30:04 tgl Exp $
*
*--------------------------------------------------------------------
*/
bool Debug_print_plan = false;
bool Debug_print_parse = false;
bool Debug_print_rewritten = false;
-bool Debug_pretty_print = false;
+bool Debug_pretty_print = true;
bool log_parser_stats = false;
bool log_planner_stats = false;
},
{
{"debug_print_parse", PGC_USERSET, LOGGING_WHAT,
- gettext_noop("Prints the parse tree to the server log."),
+ gettext_noop("Logs each query's parse tree."),
NULL
},
&Debug_print_parse,
},
{
{"debug_print_rewritten", PGC_USERSET, LOGGING_WHAT,
- gettext_noop("Prints the parse tree after rewriting to server log."),
+ gettext_noop("Logs each query's rewritten parse tree."),
NULL
},
&Debug_print_rewritten,
},
{
{"debug_print_plan", PGC_USERSET, LOGGING_WHAT,
- gettext_noop("Prints the execution plan to server log."),
+ gettext_noop("Logs each query's execution plan."),
NULL
},
&Debug_print_plan,
NULL
},
&Debug_pretty_print,
- false, NULL, NULL
+ true, NULL, NULL
},
{
{"log_parser_stats", PGC_SUSET, STATS_MONITORING,
#debug_print_parse = off
#debug_print_rewritten = off
#debug_print_plan = off
-#debug_pretty_print = off
+#debug_pretty_print = on
#log_checkpoints = off
#log_connections = off
#log_disconnections = off