pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Geoghegan <pg@bowt.ie>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix multi-table VACUUM VERBOSE accounting.
Date: Fri, 15 Apr 2022 22:50:14 +0000
Message-ID: <E1nfUla-000h7t-MF@gemulon.postgresql.org> (raw)

Fix multi-table VACUUM VERBOSE accounting.

Per-backend global variables like VacuumPageHit are initialized once per
VACUUM command.  This was missed by commit 49c9d9fc, which unified
VACUUM VERBOSE and autovacuum logging.  As a result of that oversight,
incorrect values were shown when multiple relations were processed by a
single VACUUM VERBOSE command.

Relations that happened to be processed later on would show "buffer
usage:" values that incorrectly included buffer accesses made while
processing earlier unrelated relations.  The same accesses were counted
multiple times.

To fix, take initial values for the tracker variables at the start of
heap_vacuum_rel(), and report delta values later on.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d3609dd2547b3ed807bc3b6dd27a008d65e86668

Modified Files
--------------
src/backend/access/heap/vacuumlazy.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)



Message-ID: <E1nfUla-000h7t-MF@gemulon.postgresql.org>
Permalink:  ../E1nfUla-000h7t-MF@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nfUla-000h7t-MF@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: pg@bowt.ie
  Subject: Re: pgsql: Fix multi-table VACUUM VERBOSE accounting.
  In-Reply-To: <E1nfUla-000h7t-MF@gemulon.postgresql.org>
  References: <E1nfUla-000h7t-MF@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox