Re: Skip vacuum log report code in lazy_scan_heap() if possible

From: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
To: Greg Nancarrow <gregn4422(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Skip vacuum log report code in lazy_scan_heap() if possible
Date: 2021-12-02 22:22:25
Message-ID: 5D7C48BB-5FD7-4AE4-B931-E9886A3037D4@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/29/21, 10:49 AM, "Bossart, Nathan" <bossartn(at)amazon(dot)com> wrote:
> On 10/29/21, 3:54 AM, "Greg Nancarrow" <gregn4422(at)gmail(dot)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.

Since I have no further comments, I went ahead and marked this once as
ready-for-committer.

Nathan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Steinar H. Gunderson 2021-12-02 22:57:27 [PATCH] Document heuristics for parameterized paths
Previous Message Andres Freund 2021-12-02 22:16:07 Re: pg_dump versus ancient server versions