mirror of
https://github.com/postgres/postgres.git
synced 2025-06-03 01:21:48 +03:00
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
This commit is contained in:
parent
21fb39cb07
commit
f020baa066
@ -188,7 +188,7 @@ typedef struct LVRelState
|
|||||||
BlockNumber rel_pages; /* total number of pages */
|
BlockNumber rel_pages; /* total number of pages */
|
||||||
BlockNumber scanned_pages; /* # pages examined (not skipped via VM) */
|
BlockNumber scanned_pages; /* # pages examined (not skipped via VM) */
|
||||||
BlockNumber removed_pages; /* # pages removed by relation truncation */
|
BlockNumber removed_pages; /* # pages removed by relation truncation */
|
||||||
BlockNumber frozen_pages; /* # pages with newly frozen tuples */
|
BlockNumber new_frozen_tuple_pages; /* # pages with newly frozen tuples */
|
||||||
BlockNumber lpdead_item_pages; /* # pages with LP_DEAD items */
|
BlockNumber lpdead_item_pages; /* # pages with LP_DEAD items */
|
||||||
BlockNumber missed_dead_pages; /* # pages with missed dead tuples */
|
BlockNumber missed_dead_pages; /* # pages with missed dead tuples */
|
||||||
BlockNumber nonempty_pages; /* actually, last nonempty page + 1 */
|
BlockNumber nonempty_pages; /* actually, last nonempty page + 1 */
|
||||||
@ -407,7 +407,7 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
|
|||||||
/* Initialize page counters explicitly (be tidy) */
|
/* Initialize page counters explicitly (be tidy) */
|
||||||
vacrel->scanned_pages = 0;
|
vacrel->scanned_pages = 0;
|
||||||
vacrel->removed_pages = 0;
|
vacrel->removed_pages = 0;
|
||||||
vacrel->frozen_pages = 0;
|
vacrel->new_frozen_tuple_pages = 0;
|
||||||
vacrel->lpdead_item_pages = 0;
|
vacrel->lpdead_item_pages = 0;
|
||||||
vacrel->missed_dead_pages = 0;
|
vacrel->missed_dead_pages = 0;
|
||||||
vacrel->nonempty_pages = 0;
|
vacrel->nonempty_pages = 0;
|
||||||
@ -696,9 +696,10 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
|
|||||||
vacrel->NewRelminMxid, diff);
|
vacrel->NewRelminMxid, diff);
|
||||||
}
|
}
|
||||||
appendStringInfo(&buf, _("frozen: %u pages from table (%.2f%% of total) had %lld tuples frozen\n"),
|
appendStringInfo(&buf, _("frozen: %u pages from table (%.2f%% of total) had %lld tuples frozen\n"),
|
||||||
vacrel->frozen_pages,
|
vacrel->new_frozen_tuple_pages,
|
||||||
orig_rel_pages == 0 ? 100.0 :
|
orig_rel_pages == 0 ? 100.0 :
|
||||||
100.0 * vacrel->frozen_pages / orig_rel_pages,
|
100.0 * vacrel->new_frozen_tuple_pages /
|
||||||
|
orig_rel_pages,
|
||||||
(long long) vacrel->tuples_frozen);
|
(long long) vacrel->tuples_frozen);
|
||||||
if (vacrel->do_index_vacuuming)
|
if (vacrel->do_index_vacuuming)
|
||||||
{
|
{
|
||||||
@ -1453,11 +1454,12 @@ lazy_scan_prune(LVRelState *vacrel,
|
|||||||
if (presult.nfrozen > 0)
|
if (presult.nfrozen > 0)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* We don't increment the frozen_pages instrumentation counter when
|
* We don't increment the new_frozen_tuple_pages instrumentation
|
||||||
* nfrozen == 0, since it only counts pages with newly frozen tuples
|
* counter when nfrozen == 0, since it only counts pages with newly
|
||||||
* (don't confuse that with pages newly set all-frozen in VM).
|
* frozen tuples (don't confuse that with pages newly set all-frozen
|
||||||
|
* in VM).
|
||||||
*/
|
*/
|
||||||
vacrel->frozen_pages++;
|
vacrel->new_frozen_tuple_pages++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user