mirror of
https://github.com/postgres/postgres.git
synced 2025-10-22 14:32:25 +03:00
Add log_autoanalyze_min_duration
The log output functionality of log_autovacuum_min_duration applies to both VACUUM and ANALYZE, so it is not possible to separate the VACUUM and ANALYZE log output thresholds. Logs are likely to be output only for VACUUM and not for ANALYZE. Therefore, we decided to separate the threshold for log output of VACUUM by autovacuum (log_autovacuum_min_duration) and the threshold for log output of ANALYZE by autovacuum (log_autoanalyze_min_duration). Author: Shinya Kato <shinya11.kato@gmail.com> Reviewed-by: Kasahara Tatsuhito <kasaharatt@oss.nttdata.com> Discussion: https://www.postgresql.org/message-id/flat/CAOzEurQtfV4MxJiWT-XDnimEeZAY+rgzVSLe8YsyEKhZcajzSA@mail.gmail.com
This commit is contained in:
@@ -7477,17 +7477,44 @@ local0.* /var/log/postgresql
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Causes each action executed by autovacuum to be logged if it ran for at
|
||||
Causes vacuum action executed by autovacuum to be logged if it ran for at
|
||||
least the specified amount of time. Setting this to zero logs
|
||||
all autovacuum actions. <literal>-1</literal> disables logging autovacuum
|
||||
actions. If this value is specified without units, it is taken as milliseconds.
|
||||
For example, if you set this to
|
||||
<literal>250ms</literal> then all automatic vacuums and analyzes that run
|
||||
all vacuum actions by autovacuum. <literal>-1</literal> disables logging
|
||||
vacuum actions by autovacuum. If this value is specified without units,
|
||||
it is taken as milliseconds. For example, if you set this to
|
||||
<literal>250ms</literal> then all automatic vacuums that run
|
||||
250ms or longer will be logged. In addition, when this parameter is
|
||||
set to any value other than <literal>-1</literal>, a message will be
|
||||
logged if an autovacuum action is skipped due to a conflicting lock or a
|
||||
logged if a vacuum action by autovacuum is skipped due to a conflicting lock or a
|
||||
concurrently dropped relation. The default is <literal>10min</literal>.
|
||||
Enabling this parameter can be helpful in tracking autovacuum activity.
|
||||
Enabling this parameter can be helpful in tracking vacuum activity by autovacuum.
|
||||
This parameter can only be set in the <filename>postgresql.conf</filename>
|
||||
file or on the server command line; but the setting can be overridden for
|
||||
individual tables by changing table storage parameters.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="guc-log-autoanalyze-min-duration" xreflabel="log_autoanalyze_min_duration">
|
||||
<term><varname>log_autoanalyze_min_duration</varname> (<type>integer</type>)
|
||||
<indexterm>
|
||||
<primary><varname>log_autoanalyze_min_duration</varname></primary>
|
||||
<secondary>configuration parameter</secondary>
|
||||
</indexterm>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Causes analyze action executed by autovacuum to be logged if it ran for at
|
||||
least the specified amount of time. Setting this to zero logs
|
||||
all analyze actions by autovacuum. <literal>-1</literal> disables logging
|
||||
analyze actions by autovacuum. If this value is specified without units,
|
||||
it is taken as milliseconds. For example, if you set this to
|
||||
<literal>250ms</literal> then all automatic analyzes that run
|
||||
250ms or longer will be logged. In addition, when this parameter is
|
||||
set to any value other than <literal>-1</literal>, a message will be
|
||||
logged if an analyze action by autovacuum is skipped due to a conflicting lock or a
|
||||
concurrently dropped relation. The default is <literal>10min</literal>.
|
||||
Enabling this parameter can be helpful in tracking analyze activity by autovacuum.
|
||||
This parameter can only be set in the <filename>postgresql.conf</filename>
|
||||
file or on the server command line; but the setting can be overridden for
|
||||
individual tables by changing table storage parameters.
|
||||
|
@@ -892,7 +892,8 @@ HINT: Execute a database-wide VACUUM in that database.
|
||||
the next database will be processed as soon as the first worker finishes.
|
||||
Each worker process will check each table within its database and
|
||||
execute <command>VACUUM</command> and/or <command>ANALYZE</command> as needed.
|
||||
<xref linkend="guc-log-autovacuum-min-duration"/> can be set to monitor
|
||||
<xref linkend="guc-log-autovacuum-min-duration"/> and
|
||||
<xref linkend="guc-log-autoanalyze-min-duration"/> can be set to monitor
|
||||
autovacuum workers' activity.
|
||||
</para>
|
||||
|
||||
|
@@ -1966,6 +1966,21 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="reloption-log-autoanalyze-min-duration" xreflabel="log_autoanalyze_min_duration">
|
||||
<term><literal>log_autoanalyze_min_duration</literal> (<type>integer</type>)
|
||||
<indexterm>
|
||||
<primary><varname>log_autoanalyze_min_duration</varname></primary>
|
||||
<secondary>storage parameter</secondary>
|
||||
</indexterm>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Per-table value for <xref linkend="guc-log-autoanalyze-min-duration"/>
|
||||
parameter.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="reloption-vacuum-max-eager-freeze-failure-rate" xreflabel="vacuum_max_eager_freeze_failure_rate">
|
||||
<term><literal>vacuum_max_eager_freeze_failure_rate</literal>, <literal>toast.vacuum_max_eager_freeze_failure_rate</literal> (<type>floating point</type>)
|
||||
<indexterm>
|
||||
|
Reference in New Issue
Block a user