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

From Greg Nancarrow
Subject Skip vacuum log report code in lazy_scan_heap() if possible
Date
Msg-id CAJcOf-fH5FGsF3mpPL1m5yHLeR0HdXWQp9RA=LnHu0Qd=eq9DA@mail.gmail.com
Whole thread Raw
Responses Re: Skip vacuum log report code in lazy_scan_heap() if possible  ("Bossart, Nathan" <bossartn@amazon.com>)
Re: Skip vacuum log report code in lazy_scan_heap() if possible  ("Bossart, Nathan" <bossartn@amazon.com>)
List pgsql-hackers
Hi,

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.

Regards,
Greg Nancarrow
Fujitsu Australia

Attachment

pgsql-hackers by date:

Previous
From: "Joel Mariadasan (jomariad)"
Date:
Subject: Vulnerability identified with Postgres 13.4 for Windows
Next
From: Amit Kapila
Date:
Subject: Re: Skipping logical replication transactions on subscriber side