auto_explain: Add logging of trigger execution
Author: Kyotaro HORIGUCHI Reviewed-by: Jaime Casanova
This commit is contained in:
parent
84df54b22e
commit
e2a0fc5363
|
@ -25,6 +25,7 @@ static int auto_explain_log_min_duration = -1; /* msec or -1 */
|
||||||
static bool auto_explain_log_analyze = false;
|
static bool auto_explain_log_analyze = false;
|
||||||
static bool auto_explain_log_verbose = false;
|
static bool auto_explain_log_verbose = false;
|
||||||
static bool auto_explain_log_buffers = false;
|
static bool auto_explain_log_buffers = false;
|
||||||
|
static bool auto_explain_log_triggers = false;
|
||||||
static bool auto_explain_log_timing = false;
|
static bool auto_explain_log_timing = false;
|
||||||
static int auto_explain_log_format = EXPLAIN_FORMAT_TEXT;
|
static int auto_explain_log_format = EXPLAIN_FORMAT_TEXT;
|
||||||
static bool auto_explain_log_nested_statements = false;
|
static bool auto_explain_log_nested_statements = false;
|
||||||
|
@ -113,6 +114,17 @@ _PG_init(void)
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
DefineCustomBoolVariable("auto_explain.log_triggers",
|
||||||
|
"Include trigger statistics in plans.",
|
||||||
|
"This has no effect unless log_analyze is also set.",
|
||||||
|
&auto_explain_log_triggers,
|
||||||
|
false,
|
||||||
|
PGC_SUSET,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
DefineCustomEnumVariable("auto_explain.log_format",
|
DefineCustomEnumVariable("auto_explain.log_format",
|
||||||
"EXPLAIN format to be used for plan logging.",
|
"EXPLAIN format to be used for plan logging.",
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -295,6 +307,8 @@ explain_ExecutorEnd(QueryDesc *queryDesc)
|
||||||
ExplainBeginOutput(&es);
|
ExplainBeginOutput(&es);
|
||||||
ExplainQueryText(&es, queryDesc);
|
ExplainQueryText(&es, queryDesc);
|
||||||
ExplainPrintPlan(&es, queryDesc);
|
ExplainPrintPlan(&es, queryDesc);
|
||||||
|
if (es.analyze && auto_explain_log_triggers)
|
||||||
|
ExplainPrintTriggers(&es, queryDesc);
|
||||||
ExplainEndOutput(&es);
|
ExplainEndOutput(&es);
|
||||||
|
|
||||||
/* Remove last line break */
|
/* Remove last line break */
|
||||||
|
|
|
@ -122,6 +122,24 @@ LOAD 'auto_explain';
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<varname>auto_explain.log_triggers</varname> (<type>boolean</type>)
|
||||||
|
</term>
|
||||||
|
<indexterm>
|
||||||
|
<primary><varname>auto_explain.log_triggers</> configuration parameter</primary>
|
||||||
|
</indexterm>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
<varname>auto_explain.log_triggers</varname> causes trigger
|
||||||
|
execution statistics to be included when an execution plan is logged.
|
||||||
|
This parameter is off by default. Only superusers can change this
|
||||||
|
setting. This parameter has no effect unless
|
||||||
|
<varname>auto_explain.log_analyze</> parameter is set.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>
|
||||||
<varname>auto_explain.log_format</varname> (<type>enum</type>)
|
<varname>auto_explain.log_format</varname> (<type>enum</type>)
|
||||||
|
|
Loading…
Reference in New Issue