Re: add vacuum starttime columns - Mailing list pgsql-hackers

From Greg Sabino Mullane
Subject Re: add vacuum starttime columns
Date
Msg-id CAKAnmm+dREuWpKFp+GXDVqGVFn-zSHB_T6nqHmwkrC3n5yWGXA@mail.gmail.com
Whole thread Raw
In response to Re: add vacuum starttime columns  (wenhui qiu <qiuwenhuifx@gmail.com>)
Responses Re: add vacuum starttime columns
List pgsql-hackers
On Tue, Dec 31, 2024 at 2:33 AM wenhui qiu <qiuwenhuifx@gmail.com> wrote:

Of course, to observe the duration of vacuum operations, we can configure the log_autovacuum_min_durationparameter, but if there are many tables in the database, the vacuum entries in the logs might be quite numerous, making it difficult to analyze.

Using log_autovacuum_min_duration really is the best solution here. It is not very difficult to write a script to pull the information out. Yes, it can be a lot of lines if there are a lot of tables, but that's part of why it's a duration and not a toggle - you can ignore the quick-running ones. Also, the log files give you historical overview that the pg_stat views simply cannot provide, in addition to the actual details of what was vacuumed and why. All that is to say that I am not convinced we need to tweak the system views when we have the information already available in a better way.

For what it's worth, log_autovacuum_min_duration is one of the few parameters that I always recommend be turned on at the highest level (i.e. log it all). The extra log verbosity is well worth it. 

Cheers,
Greg

pgsql-hackers by date:

Previous
From: Sami Imseih
Date:
Subject: Re: add vacuum starttime columns
Next
From: Bruce Momjian
Date:
Subject: Re: Backport of CVE-2024-10978 fix to older pgsql versions (11, 9.6, and 9.4)