1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Allow setting sample ratio for auto_explain

New configuration parameter auto_explain.sample_ratio makes it
possible to log just a fraction of the queries meeting the configured
threshold, to reduce the amount of logging.

Author: Craig Ringer and Julien Rouhaud
Review: Petr Jelinek
This commit is contained in:
Magnus Hagander
2016-03-11 15:08:34 +01:00
parent 69ab7b9d6c
commit 92f03fe76f
2 changed files with 46 additions and 3 deletions

View File

@ -203,6 +203,24 @@ LOAD 'auto_explain';
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname>auto_explain.sample_ratio</varname> (<type>real</type>)
<indexterm>
<primary><varname>auto_explain.sample_ratio</> configuration parameter</primary>
</indexterm>
</term>
<listitem>
<para>
<varname>auto_explain.sample_ratio</varname> (<type>floating point</type>)
causes auto_explain to only explain a fraction of the statements in each
session. The default is 1, meaning explain all the queries. In case
of nested statements, either all will be explained or none. Only
superusers can change this setting.
</para>
</listitem>
</varlistentry>
</variablelist>
<para>