Re: Skip vacuum log report code in lazy_scan_heap() if possible - Mailing list pgsql-hackers

From Bossart, Nathan
Subject Re: Skip vacuum log report code in lazy_scan_heap() if possible
Date
Msg-id 13CA6501-D0E1-40CD-A540-59CBC38D163E@amazon.com
Whole thread Raw
In response to Skip vacuum log report code in lazy_scan_heap() if possible  (Greg Nancarrow <gregn4422@gmail.com>)
List pgsql-hackers
On 10/29/21, 3:54 AM, "Greg Nancarrow" <gregn4422@gmail.com> wrote:
> When recently debugging a vacuum-related issue, I noticed that there
> is some log-report processing/formatting code at the end of
> lazy_scan_heap() that, unless the vacuum VERBOSE option is specified,
> typically results in no log output (as the log-level is then DEBUG2).
> I think it is worth skipping this code if ultimately nothing is going
> to be logged (and I found that even for a tiny database, a VACUUM may
> execute this code hundreds of times).
> I have attached a simple patch for this.

I think this logging only happens once per table, so I'm not sure it's
really worth it to short-circuit here.  If it was per-page, IMO there
would be a much stronger case for it.  That being said, I don't think
the proposed patch would hurt anything.

Nathan


pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: [PATCH] Support pg_ident mapping for LDAP
Next
From: Tom Lane
Date:
Subject: Better localization of errors in plpgsql variable initialization