Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

+1-1
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)