From dd3ae378301f7e84c18f7a90f183c3cd4165c0da Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 15 Oct 2025 14:31:12 +0200 Subject: 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 Reviewed-by: Kasahara Tatsuhito Discussion: https://www.postgresql.org/message-id/flat/CAOzEurQtfV4MxJiWT-XDnimEeZAY+rgzVSLe8YsyEKhZcajzSA@mail.gmail.com --- doc/src/sgml/config.sgml | 41 +++++++++++++++++++++++++++++++------- doc/src/sgml/maintenance.sgml | 3 ++- doc/src/sgml/ref/create_table.sgml | 15 ++++++++++++++ 3 files changed, 51 insertions(+), 8 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 39e658b7808..0a2a8b49fdb 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -7477,17 +7477,44 @@ local0.* /var/log/postgresql - 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. -1 disables logging autovacuum - actions. If this value is specified without units, it is taken as milliseconds. - For example, if you set this to - 250ms then all automatic vacuums and analyzes that run + all vacuum actions by autovacuum. -1 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 + 250ms then all automatic vacuums that run 250ms or longer will be logged. In addition, when this parameter is set to any value other than -1, 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 10min. - 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 postgresql.conf + file or on the server command line; but the setting can be overridden for + individual tables by changing table storage parameters. + + + + + + log_autoanalyze_min_duration (integer) + + log_autoanalyze_min_duration + configuration parameter + + + + + 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. -1 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 + 250ms then all automatic analyzes that run + 250ms or longer will be logged. In addition, when this parameter is + set to any value other than -1, 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 10min. + Enabling this parameter can be helpful in tracking analyze activity by autovacuum. This parameter can only be set in the postgresql.conf file or on the server command line; but the setting can be overridden for individual tables by changing table storage parameters. diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml index e7a9f58c015..dc59c88319e 100644 --- a/doc/src/sgml/maintenance.sgml +++ b/doc/src/sgml/maintenance.sgml @@ -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 VACUUM and/or ANALYZE as needed. - can be set to monitor + and + can be set to monitor autovacuum workers' activity. diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml index dc000e913c1..a157a244e4e 100644 --- a/doc/src/sgml/ref/create_table.sgml +++ b/doc/src/sgml/ref/create_table.sgml @@ -1966,6 +1966,21 @@ WITH ( MODULUS numeric_literal, REM + + log_autoanalyze_min_duration (integer) + + log_autoanalyze_min_duration + storage parameter + + + + + Per-table value for + parameter. + + + + vacuum_max_eager_freeze_failure_rate, toast.vacuum_max_eager_freeze_failure_rate (floating point) -- cgit v1.2.3