pgsql: Fix multi-table VACUUM VERBOSE accounting. - Mailing list pgsql-committers

From Peter Geoghegan
Subject pgsql: Fix multi-table VACUUM VERBOSE accounting.
Date
Msg-id E1nfUla-000h7t-MF@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: psql: fix \l display for pre-v15 databases.
Next
From: Noah Misch
Date:
Subject: pgsql: Use standard timeout, in 010_pg_basebackup.pl.