1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Tweak the behavior of log_duration as proposed by Guillaume Smet: rather

than being equivalent to setting log_min_duration_statement to zero, this
option now forces logging of all query durations, but doesn't force logging
of query text.  Also, add duration logging coverage for fastpath function
calls.
This commit is contained in:
Tom Lane
2006-09-08 15:55:53 +00:00
parent 0b33c56297
commit b59d31c215
4 changed files with 103 additions and 49 deletions

View File

@@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.84 2006/09/07 22:51:59 tgl Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.85 2006/09/08 15:55:52 tgl Exp $ -->
<chapter Id="runtime-config">
<title>Server Configuration</title>
@@ -2718,23 +2718,22 @@ SELECT * FROM parent WHERE key = 2400;
Only superusers can change this setting.
</para>
<para>
For clients using extended query protocol, durations of the Parse,
Bind, and Execute steps are logged independently.
</para>
<para>
For clients using extended query protocol, durations of the Parse,
Bind, and Execute steps are logged independently.
</para>
<note>
<para>
When using this option together with
<xref linkend="guc-log-statement">,
the text of statements that are logged because of
<varname>log_statement</> will not be repeated in the
duration log message.
If you are not using <application>syslog</>, it is recommended
that you log the PID or session ID using
<xref linkend="guc-log-line-prefix">
so that you can link the statement message to the later
duration message using the process ID or session ID.
The difference between setting this option and setting
<xref linkend="guc-log-min-duration-statement"> to zero is that
exceeding <varname>log_min_duration_statement</> forces the text of
the query to be logged, but this option doesn't. Thus, if
<varname>log_duration</> is <literal>on</> and
<varname>log_min_duration_statement</> has a positive value, all
durations are logged but the query text is included only for
statements exceeding the threshold. This behavior can be useful for
gathering statistics in high-load installations.
</para>
</note>
</listitem>