mirror of
https://github.com/postgres/postgres.git
synced 2025-06-01 00:01:20 -04:00
Rename:
! #show_parser_stats = false ! #show_planner_stats = false ! #show_executor_stats = false ! #show_statement_stats = false TO: ! #log_parser_stats = false ! #log_planner_stats = false ! #log_executor_stats = false ! #log_statement_stats = false
This commit is contained in:
parent
001d5a7aa5
commit
d36aa2e885
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.151 2002/11/14 23:53:26 momjian Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.152 2002/11/15 00:47:22 momjian Exp $
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<Chapter Id="runtime">
|
<Chapter Id="runtime">
|
||||||
@ -1110,10 +1110,10 @@ env PGOPTIONS='-c geqo=off' psql
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>SHOW_STATEMENT_STATS</varname> (<type>boolean</type>)</term>
|
<term><varname>LOG_STATEMENT_STATS</varname> (<type>boolean</type>)</term>
|
||||||
<term><varname>SHOW_PARSER_STATS</varname> (<type>boolean</type>)</term>
|
<term><varname>LOG_PARSER_STATS</varname> (<type>boolean</type>)</term>
|
||||||
<term><varname>SHOW_PLANNER_STATS</varname> (<type>boolean</type>)</term>
|
<term><varname>LOG_PLANNER_STATS</varname> (<type>boolean</type>)</term>
|
||||||
<term><varname>SHOW_EXECUTOR_STATS</varname> (<type>boolean</type>)</term>
|
<term><varname>LOG_EXECUTOR_STATS</varname> (<type>boolean</type>)</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
For each query, write performance statistics of the respective
|
For each query, write performance statistics of the respective
|
||||||
@ -2250,7 +2250,9 @@ $ <userinput>postmaster -o '-S 1024 -s'</userinput>
|
|||||||
|
|
||||||
<row>
|
<row>
|
||||||
<entry><option>-tpa</option>, <option>-tpl</option>, <option>-te</option><footnoteref linkend="fn.runtime-config-short"></entry>
|
<entry><option>-tpa</option>, <option>-tpl</option>, <option>-te</option><footnoteref linkend="fn.runtime-config-short"></entry>
|
||||||
<entry><literal>show_parser_stats=on</>, <literal>show_planner_stats=on</>, <literal>show_executor_stats=on</></entry>
|
<entry><literal>log_parser_stats=on</>,
|
||||||
|
<literal>log_planner_stats=on</>,
|
||||||
|
<literal>log_executor_stats=on</></entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* Copyright (c) 2002, PostgreSQL Global Development Group
|
* Copyright (c) 2002, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/prepare.c,v 1.7 2002/11/13 00:39:46 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/prepare.c,v 1.8 2002/11/15 00:47:22 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -153,7 +153,7 @@ ExecuteQuery(ExecuteStmt *stmt, CommandDest outputDest)
|
|||||||
QueryDesc *qdesc;
|
QueryDesc *qdesc;
|
||||||
EState *state;
|
EState *state;
|
||||||
|
|
||||||
if (Show_executor_stats)
|
if (log_executor_stats)
|
||||||
ResetUsage();
|
ResetUsage();
|
||||||
|
|
||||||
qdesc = CreateQueryDesc(query, plan, outputDest, NULL);
|
qdesc = CreateQueryDesc(query, plan, outputDest, NULL);
|
||||||
@ -172,7 +172,7 @@ ExecuteQuery(ExecuteStmt *stmt, CommandDest outputDest)
|
|||||||
|
|
||||||
RunQuery(qdesc, state);
|
RunQuery(qdesc, state);
|
||||||
|
|
||||||
if (Show_executor_stats)
|
if (log_executor_stats)
|
||||||
ShowUsage("EXECUTOR STATISTICS");
|
ShowUsage("EXECUTOR STATISTICS");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.308 2002/11/14 23:53:27 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.309 2002/11/15 00:47:22 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* this is the "main" module of the postgres backend and
|
* this is the "main" module of the postgres backend and
|
||||||
@ -368,15 +368,15 @@ pg_parse_query(StringInfo query_string, Oid *typev, int nargs)
|
|||||||
{
|
{
|
||||||
List *raw_parsetree_list;
|
List *raw_parsetree_list;
|
||||||
|
|
||||||
if (Log_statement)
|
if (log_statement)
|
||||||
elog(LOG, "query: %s", query_string->data);
|
elog(LOG, "query: %s", query_string->data);
|
||||||
|
|
||||||
if (Show_parser_stats)
|
if (log_parser_stats)
|
||||||
ResetUsage();
|
ResetUsage();
|
||||||
|
|
||||||
raw_parsetree_list = parser(query_string, typev, nargs);
|
raw_parsetree_list = parser(query_string, typev, nargs);
|
||||||
|
|
||||||
if (Show_parser_stats)
|
if (log_parser_stats)
|
||||||
ShowUsage("PARSER STATISTICS");
|
ShowUsage("PARSER STATISTICS");
|
||||||
|
|
||||||
return raw_parsetree_list;
|
return raw_parsetree_list;
|
||||||
@ -402,12 +402,12 @@ pg_analyze_and_rewrite(Node *parsetree)
|
|||||||
/*
|
/*
|
||||||
* (1) Perform parse analysis.
|
* (1) Perform parse analysis.
|
||||||
*/
|
*/
|
||||||
if (Show_parser_stats)
|
if (log_parser_stats)
|
||||||
ResetUsage();
|
ResetUsage();
|
||||||
|
|
||||||
querytree_list = parse_analyze(parsetree, NULL);
|
querytree_list = parse_analyze(parsetree, NULL);
|
||||||
|
|
||||||
if (Show_parser_stats)
|
if (log_parser_stats)
|
||||||
{
|
{
|
||||||
ShowUsage("PARSE ANALYSIS STATISTICS");
|
ShowUsage("PARSE ANALYSIS STATISTICS");
|
||||||
ResetUsage();
|
ResetUsage();
|
||||||
@ -444,7 +444,7 @@ pg_analyze_and_rewrite(Node *parsetree)
|
|||||||
|
|
||||||
querytree_list = new_list;
|
querytree_list = new_list;
|
||||||
|
|
||||||
if (Show_parser_stats)
|
if (log_parser_stats)
|
||||||
ShowUsage("REWRITER STATISTICS");
|
ShowUsage("REWRITER STATISTICS");
|
||||||
|
|
||||||
#ifdef COPY_PARSE_PLAN_TREES
|
#ifdef COPY_PARSE_PLAN_TREES
|
||||||
@ -479,13 +479,13 @@ pg_plan_query(Query *querytree)
|
|||||||
if (querytree->commandType == CMD_UTILITY)
|
if (querytree->commandType == CMD_UTILITY)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (Show_planner_stats)
|
if (log_planner_stats)
|
||||||
ResetUsage();
|
ResetUsage();
|
||||||
|
|
||||||
/* call the optimizer */
|
/* call the optimizer */
|
||||||
plan = planner(querytree);
|
plan = planner(querytree);
|
||||||
|
|
||||||
if (Show_planner_stats)
|
if (log_planner_stats)
|
||||||
ShowUsage("PLANNER STATISTICS");
|
ShowUsage("PLANNER STATISTICS");
|
||||||
|
|
||||||
#ifdef COPY_PARSE_PLAN_TREES
|
#ifdef COPY_PARSE_PLAN_TREES
|
||||||
@ -559,15 +559,15 @@ pg_exec_query_string(StringInfo query_string, /* string to execute */
|
|||||||
*parsetree_item;
|
*parsetree_item;
|
||||||
struct timeval start_t,
|
struct timeval start_t,
|
||||||
stop_t;
|
stop_t;
|
||||||
bool save_Log_duration = Log_duration;
|
bool save_log_duration = log_duration;
|
||||||
|
|
||||||
debug_query_string = query_string->data;
|
debug_query_string = query_string->data;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We use save_Log_duration so "SET Log_duration = true" doesn't
|
* We use save_log_duration so "SET log_duration = true" doesn't
|
||||||
* report incorrect time because gettimeofday() wasn't called.
|
* report incorrect time because gettimeofday() wasn't called.
|
||||||
*/
|
*/
|
||||||
if (save_Log_duration)
|
if (save_log_duration)
|
||||||
gettimeofday(&start_t, NULL);
|
gettimeofday(&start_t, NULL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -820,7 +820,7 @@ pg_exec_query_string(StringInfo query_string, /* string to execute */
|
|||||||
/*
|
/*
|
||||||
* execute the plan
|
* execute the plan
|
||||||
*/
|
*/
|
||||||
if (Show_executor_stats)
|
if (log_executor_stats)
|
||||||
ResetUsage();
|
ResetUsage();
|
||||||
|
|
||||||
if (dontExecute)
|
if (dontExecute)
|
||||||
@ -845,7 +845,7 @@ pg_exec_query_string(StringInfo query_string, /* string to execute */
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Show_executor_stats)
|
if (log_executor_stats)
|
||||||
ShowUsage("EXECUTOR STATISTICS");
|
ShowUsage("EXECUTOR STATISTICS");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -933,7 +933,7 @@ pg_exec_query_string(StringInfo query_string, /* string to execute */
|
|||||||
if (xact_started)
|
if (xact_started)
|
||||||
finish_xact_command(false);
|
finish_xact_command(false);
|
||||||
|
|
||||||
if (save_Log_duration)
|
if (save_log_duration)
|
||||||
{
|
{
|
||||||
gettimeofday(&stop_t, NULL);
|
gettimeofday(&stop_t, NULL);
|
||||||
if (stop_t.tv_usec < start_t.tv_usec)
|
if (stop_t.tv_usec < start_t.tv_usec)
|
||||||
@ -1498,9 +1498,9 @@ PostgresMain(int argc, char *argv[], const char *username)
|
|||||||
{
|
{
|
||||||
case 'p':
|
case 'p':
|
||||||
if (optarg[1] == 'a')
|
if (optarg[1] == 'a')
|
||||||
tmp = "show_parser_stats";
|
tmp = "log_parser_stats";
|
||||||
else if (optarg[1] == 'l')
|
else if (optarg[1] == 'l')
|
||||||
tmp = "show_planner_stats";
|
tmp = "log_planner_stats";
|
||||||
else
|
else
|
||||||
errs++;
|
errs++;
|
||||||
break;
|
break;
|
||||||
@ -1607,8 +1607,8 @@ PostgresMain(int argc, char *argv[], const char *username)
|
|||||||
/*
|
/*
|
||||||
* Post-processing for command line options.
|
* Post-processing for command line options.
|
||||||
*/
|
*/
|
||||||
if (Show_statement_stats &&
|
if (log_statement_stats &&
|
||||||
(Show_parser_stats || Show_planner_stats || Show_executor_stats))
|
(log_parser_stats || log_planner_stats || log_executor_stats))
|
||||||
{
|
{
|
||||||
elog(WARNING, "Query statistics are disabled because parser, planner, or executor statistics are on.");
|
elog(WARNING, "Query statistics are disabled because parser, planner, or executor statistics are on.");
|
||||||
SetConfigOption("show_statement_stats", "false", ctx, gucsource);
|
SetConfigOption("show_statement_stats", "false", ctx, gucsource);
|
||||||
@ -1781,7 +1781,7 @@ PostgresMain(int argc, char *argv[], const char *username)
|
|||||||
if (!IsUnderPostmaster)
|
if (!IsUnderPostmaster)
|
||||||
{
|
{
|
||||||
puts("\nPOSTGRES backend interactive interface ");
|
puts("\nPOSTGRES backend interactive interface ");
|
||||||
puts("$Revision: 1.308 $ $Date: 2002/11/14 23:53:27 $\n");
|
puts("$Revision: 1.309 $ $Date: 2002/11/15 00:47:22 $\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2008,7 +2008,7 @@ PostgresMain(int argc, char *argv[], const char *username)
|
|||||||
* Note: transaction command start/end is now done within
|
* Note: transaction command start/end is now done within
|
||||||
* pg_exec_query_string(), not here.
|
* pg_exec_query_string(), not here.
|
||||||
*/
|
*/
|
||||||
if (Show_statement_stats)
|
if (log_statement_stats)
|
||||||
ResetUsage();
|
ResetUsage();
|
||||||
|
|
||||||
pgstat_report_activity(parser_input->data);
|
pgstat_report_activity(parser_input->data);
|
||||||
@ -2017,7 +2017,7 @@ PostgresMain(int argc, char *argv[], const char *username)
|
|||||||
whereToSendOutput,
|
whereToSendOutput,
|
||||||
QueryContext);
|
QueryContext);
|
||||||
|
|
||||||
if (Show_statement_stats)
|
if (log_statement_stats)
|
||||||
ShowUsage("QUERY STATISTICS");
|
ShowUsage("QUERY STATISTICS");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* command, configuration file, and command line options.
|
* command, configuration file, and command line options.
|
||||||
* See src/backend/utils/misc/README for more information.
|
* See src/backend/utils/misc/README for more information.
|
||||||
*
|
*
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.101 2002/11/14 23:53:27 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.102 2002/11/15 00:47:22 momjian Exp $
|
||||||
*
|
*
|
||||||
* Copyright 2000 by PostgreSQL Global Development Group
|
* Copyright 2000 by PostgreSQL Global Development Group
|
||||||
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
||||||
@ -79,17 +79,17 @@ static const char *assign_msglvl(int *var, const char *newval,
|
|||||||
#ifdef USE_ASSERT_CHECKING
|
#ifdef USE_ASSERT_CHECKING
|
||||||
bool assert_enabled = true;
|
bool assert_enabled = true;
|
||||||
#endif
|
#endif
|
||||||
bool Log_statement = false;
|
bool log_statement = false;
|
||||||
bool Log_duration = false;
|
bool log_duration = false;
|
||||||
bool Debug_print_plan = false;
|
bool Debug_print_plan = false;
|
||||||
bool Debug_print_parse = false;
|
bool Debug_print_parse = false;
|
||||||
bool Debug_print_rewritten = false;
|
bool Debug_print_rewritten = false;
|
||||||
bool Debug_pretty_print = false;
|
bool Debug_pretty_print = false;
|
||||||
|
|
||||||
bool Show_parser_stats = false;
|
bool log_parser_stats = false;
|
||||||
bool Show_planner_stats = false;
|
bool log_planner_stats = false;
|
||||||
bool Show_executor_stats = false;
|
bool log_executor_stats = false;
|
||||||
bool Show_statement_stats = false; /* this is sort of all
|
bool log_statement_stats = false; /* this is sort of all
|
||||||
* three above together */
|
* three above together */
|
||||||
bool Show_btree_build_stats = false;
|
bool Show_btree_build_stats = false;
|
||||||
|
|
||||||
@ -378,11 +378,11 @@ static struct config_bool
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
{
|
{
|
||||||
{"log_statement", PGC_USERSET}, &Log_statement,
|
{"log_statement", PGC_USERSET}, &log_statement,
|
||||||
false, NULL, NULL
|
false, NULL, NULL
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{"log_duration", PGC_USERSET}, &Log_duration,
|
{"log_duration", PGC_USERSET}, &log_duration,
|
||||||
false, NULL, NULL
|
false, NULL, NULL
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -403,19 +403,19 @@ static struct config_bool
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
{"show_parser_stats", PGC_USERSET}, &Show_parser_stats,
|
{"log_parser_stats", PGC_USERSET}, &log_parser_stats,
|
||||||
false, NULL, NULL
|
false, NULL, NULL
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{"show_planner_stats", PGC_USERSET}, &Show_planner_stats,
|
{"log_planner_stats", PGC_USERSET}, &log_planner_stats,
|
||||||
false, NULL, NULL
|
false, NULL, NULL
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{"show_executor_stats", PGC_USERSET}, &Show_executor_stats,
|
{"log_executor_stats", PGC_USERSET}, &log_executor_stats,
|
||||||
false, NULL, NULL
|
false, NULL, NULL
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{"show_statement_stats", PGC_USERSET}, &Show_statement_stats,
|
{"log_statement_stats", PGC_USERSET}, &log_statement_stats,
|
||||||
false, NULL, NULL
|
false, NULL, NULL
|
||||||
},
|
},
|
||||||
#ifdef BTREE_BUILD_STATS
|
#ifdef BTREE_BUILD_STATS
|
||||||
|
@ -152,10 +152,10 @@
|
|||||||
#
|
#
|
||||||
# Statistics
|
# Statistics
|
||||||
#
|
#
|
||||||
#show_parser_stats = false
|
#log_parser_stats = false
|
||||||
#show_planner_stats = false
|
#log_planner_stats = false
|
||||||
#show_executor_stats = false
|
#log_executor_stats = false
|
||||||
#show_statement_stats = false
|
#log_statement_stats = false
|
||||||
|
|
||||||
# requires BTREE_BUILD_STATS
|
# requires BTREE_BUILD_STATS
|
||||||
#show_btree_build_stats = false
|
#show_btree_build_stats = false
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright 2000-2002 by PostgreSQL Global Development Group
|
* Copyright 2000-2002 by PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.66 2002/11/14 23:53:27 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.67 2002/11/15 00:47:22 momjian Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
@ -238,10 +238,10 @@ psql_completion(char *text, int start, int end)
|
|||||||
"debug_print_rewritten",
|
"debug_print_rewritten",
|
||||||
"debug_print_plan",
|
"debug_print_plan",
|
||||||
"debug_pretty_print",
|
"debug_pretty_print",
|
||||||
"show_parser_stats",
|
"log_parser_stats",
|
||||||
"show_planner_stats",
|
"log_planner_stats",
|
||||||
"show_executor_stats",
|
"log_executor_stats",
|
||||||
"show_statement_stats",
|
"log_statement_stats",
|
||||||
"trace_notify",
|
"trace_notify",
|
||||||
"explain_pretty_print",
|
"explain_pretty_print",
|
||||||
"sql_inheritance",
|
"sql_inheritance",
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* External declarations pertaining to backend/utils/misc/guc.c and
|
* External declarations pertaining to backend/utils/misc/guc.c and
|
||||||
* backend/utils/misc/guc-file.l
|
* backend/utils/misc/guc-file.l
|
||||||
*
|
*
|
||||||
* $Id: guc.h,v 1.25 2002/11/14 23:53:27 momjian Exp $
|
* $Id: guc.h,v 1.26 2002/11/15 00:47:22 momjian Exp $
|
||||||
*/
|
*/
|
||||||
#ifndef GUC_H
|
#ifndef GUC_H
|
||||||
#define GUC_H
|
#define GUC_H
|
||||||
@ -107,18 +107,18 @@ extern const char *assign_log_min_messages(const char *newval,
|
|||||||
bool doit, bool interactive);
|
bool doit, bool interactive);
|
||||||
extern const char *assign_client_min_messages(const char *newval,
|
extern const char *assign_client_min_messages(const char *newval,
|
||||||
bool doit, bool interactive);
|
bool doit, bool interactive);
|
||||||
extern bool Log_statement;
|
extern bool log_statement;
|
||||||
extern bool Log_duration;
|
extern bool log_duration;
|
||||||
extern bool Debug_print_plan;
|
extern bool Debug_print_plan;
|
||||||
extern bool Debug_print_parse;
|
extern bool Debug_print_parse;
|
||||||
extern bool Debug_print_rewritten;
|
extern bool Debug_print_rewritten;
|
||||||
extern bool Debug_pretty_print;
|
extern bool Debug_pretty_print;
|
||||||
|
|
||||||
extern bool Show_parser_stats;
|
extern bool log_parser_stats;
|
||||||
extern bool Show_planner_stats;
|
extern bool log_planner_stats;
|
||||||
extern bool Show_executor_stats;
|
extern bool log_executor_stats;
|
||||||
extern bool Show_statement_stats;
|
extern bool log_statement_stats;
|
||||||
extern bool Show_btree_build_stats;
|
extern bool log_btree_build_stats;
|
||||||
|
|
||||||
extern bool Explain_pretty_print;
|
extern bool Explain_pretty_print;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user