Skip to content

Commit 6e20f46

Browse files
VACUUM VERBOSE: tweak scanned_pages logic.
Commit 872770f 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.
1 parent 7e12256 commit 6e20f46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/access/heap/vacuumlazy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
676676
vacrel->removed_pages,
677677
vacrel->rel_pages,
678678
vacrel->scanned_pages,
679-
orig_rel_pages == 0 ? 0 :
679+
orig_rel_pages == 0 ? 100.0 :
680680
100.0 * vacrel->scanned_pages / orig_rel_pages);
681681
appendStringInfo(&buf,
682682
_("tuples: %lld removed, %lld remain, %lld are dead but not yet removable\n"),

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy