Causes analyze action executed by autovacuum to be logged if it ran for at least the specified amount of time.
At a glance
| Property | Value |
|---|---|
| Parameter | log_autoanalyze_min_duration |
| Category | Error Reporting and Logging |
| Default | 10min |
| Value type | integer |
| Change scope | Reload (postgresql.conf, SIGHUP) |
| Available in | PostgreSQL 19 (added in 19) |
What it does
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.
(Description quoted from the official PostgreSQL documentation.)
How to apply a change
Set it in postgresql.conf (or with ALTER SYSTEM) and reload with SELECT pg_reload_conf(); or pg_ctl reload — no restart needed.
Inspect the current value and source with SHOW log_autoanalyze_min_duration; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'log_autoanalyze_min_duration';.
Tuning guidance
Set a threshold so only slow autoanalyze runs are logged, surfacing tables whose stats collection is expensive; -1 disables, 0 logs all.