aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Geoghegan <pg@bowt.ie>2022-03-13 13:07:49 -0700
committerPeter Geoghegan <pg@bowt.ie>2022-03-13 13:07:49 -0700
commit6e20f4600a420961817ce743be454080745f84d1 (patch)
tree038d6e3cedc5e5c282c97225580dad829f3b03a4 /src
parent7e12256b478b89518ff410f29192af21de37d070 (diff)
downloadpostgresql-6e20f4600a420961817ce743be454080745f84d1.tar.gz
postgresql-6e20f4600a420961817ce743be454080745f84d1.zip
VACUUM VERBOSE: tweak scanned_pages logic.
Commit 872770fd6c taught VACUUM VERBOSE and autovacuum logging to display the total number of pages scanned by VACUUM. This information was also displayed as a percentage of rel_pages in parenthesis, which makes it easy to spot trends over time and across tables. The instrumentation displayed "0 scanned (0.00% of total)" for totally empty tables. Tweak the instrumentation: have it show "0 scanned (100.00% of total)" for empty tables instead. This approach is clearer and more consistent.
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/heap/vacuumlazy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c
index 620b7a7af5b..87ab7775aee 100644
--- a/src/backend/access/heap/vacuumlazy.c
+++ b/src/backend/access/heap/vacuumlazy.c
@@ -676,7 +676,7 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
vacrel->removed_pages,
vacrel->rel_pages,
vacrel->scanned_pages,
- orig_rel_pages == 0 ? 0 :
+ orig_rel_pages == 0 ? 100.0 :
100.0 * vacrel->scanned_pages / orig_rel_pages);
appendStringInfo(&buf,
_("tuples: %lld removed, %lld remain, %lld are dead but not yet removable\n"),