Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f020baa

Browse files
Rename LVRelState->frozen_pages
Rename frozen_pages to new_frozen_tuple_pages in LVRelState, the struct used for tracking state during vacuuming of a heap relation. frozen_pages sounds like it tracks pages set all-frozen. That is a misnomer. It only includes pages with at least one newly frozen tuple. It also includes pages that are not all-frozen. Author: Melanie Plageman Reviewed-by: Andres Freund, Masahiko Sawada, Nitin Jadhav, Bilal Yavuz Discussion: https://postgr.es/m/ctdjzroezaxmiyah3gwbwm67defsrwj2b5fpfs4ku6msfpxeia%40mwjyqlhwr2wu
1 parent 21fb39c commit f020baa

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/backend/access/heap/vacuumlazy.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ typedef struct LVRelState
188188
BlockNumber rel_pages; /* total number of pages */
189189
BlockNumber scanned_pages; /* # pages examined (not skipped via VM) */
190190
BlockNumber removed_pages; /* # pages removed by relation truncation */
191-
BlockNumber frozen_pages; /* # pages with newly frozen tuples */
191+
BlockNumber new_frozen_tuple_pages; /* # pages with newly frozen tuples */
192192
BlockNumber lpdead_item_pages; /* # pages with LP_DEAD items */
193193
BlockNumber missed_dead_pages; /* # pages with missed dead tuples */
194194
BlockNumber nonempty_pages; /* actually, last nonempty page + 1 */
@@ -407,7 +407,7 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
407407
/* Initialize page counters explicitly (be tidy) */
408408
vacrel->scanned_pages = 0;
409409
vacrel->removed_pages = 0;
410-
vacrel->frozen_pages = 0;
410+
vacrel->new_frozen_tuple_pages = 0;
411411
vacrel->lpdead_item_pages = 0;
412412
vacrel->missed_dead_pages = 0;
413413
vacrel->nonempty_pages = 0;
@@ -696,9 +696,10 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
696696
vacrel->NewRelminMxid, diff);
697697
}
698698
appendStringInfo(&buf, _("frozen: %u pages from table (%.2f%% of total) had %lld tuples frozen\n"),
699-
vacrel->frozen_pages,
699+
vacrel->new_frozen_tuple_pages,
700700
orig_rel_pages == 0 ? 100.0 :
701-
100.0 * vacrel->frozen_pages / orig_rel_pages,
701+
100.0 * vacrel->new_frozen_tuple_pages /
702+
orig_rel_pages,
702703
(long long) vacrel->tuples_frozen);
703704
if (vacrel->do_index_vacuuming)
704705
{
@@ -1453,11 +1454,12 @@ lazy_scan_prune(LVRelState *vacrel,
14531454
if (presult.nfrozen > 0)
14541455
{
14551456
/*
1456-
* We don't increment the frozen_pages instrumentation counter when
1457-
* nfrozen == 0, since it only counts pages with newly frozen tuples
1458-
* (don't confuse that with pages newly set all-frozen in VM).
1457+
* We don't increment the new_frozen_tuple_pages instrumentation
1458+
* counter when nfrozen == 0, since it only counts pages with newly
1459+
* frozen tuples (don't confuse that with pages newly set all-frozen
1460+
* in VM).
14591461
*/
1460-
vacrel->frozen_pages++;
1462+
vacrel->new_frozen_tuple_pages++;
14611463
}
14621464

14631465
/*

0 commit comments

Comments
 (0)