diff options
| author | Peter Geoghegan <pg@bowt.ie> | 2023-01-03 10:08:55 -0800 |
|---|---|---|
| committer | Peter Geoghegan <pg@bowt.ie> | 2023-01-03 10:08:55 -0800 |
| commit | b37a0832396414e8469d4ee4daea33396bde39b0 (patch) | |
| tree | 6596a113bc60f29dcffe827ed9188cd00c6c8145 /src/include/access | |
| parent | bf03cfd162176d543da79f9398131abc251ddbb9 (diff) | |
| download | postgresql-b37a0832396414e8469d4ee4daea33396bde39b0.tar.gz | |
Refine the definition of page-level freezing.
Improve comments added by commit 1de58df4 which describe the
lazy_scan_prune "freeze the page" path. These newly revised comments
are based on suggestions from Jeff Davis.
In passing, remove nearby visibility_cutoff_xid comments left over from
commit 6daeeb1f.
Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-By: Jeff Davis <pgsql@j-davis.com>
Discussion: https://postgr.es/m/ebc857107fe3edd422ef8a65191ca4a8da568b9b.camel@j-davis.com
Diffstat (limited to 'src/include/access')
| -rw-r--r-- | src/include/access/heapam.h | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h index 39c009dbf2..4a69b6dd04 100644 --- a/src/include/access/heapam.h +++ b/src/include/access/heapam.h @@ -145,16 +145,14 @@ typedef struct HeapPageFreeze /* * "Freeze" NewRelfrozenXid/NewRelminMxid trackers. * - * Trackers used when heap_freeze_execute_prepared freezes the page, and - * when page is "nominally frozen", which happens with pages where every - * call to heap_prepare_freeze_tuple produced no usable freeze plan. - * - * "Nominal freezing" enables vacuumlazy.c's approach of setting a page - * all-frozen in the visibility map when every tuple's 'totally_frozen' - * result is true. That always works in the same way, independent of the - * need to freeze tuples, and without complicating the general rule around - * 'totally_frozen' results (which is that 'totally_frozen' results are - * only to be trusted with a page that goes on to be frozen by caller). + * Trackers used when heap_freeze_execute_prepared freezes, or when there + * are zero freeze plans for a page. It is always valid for vacuumlazy.c + * to freeze any page, by definition. This even includes pages that have + * no tuples with storage to consider in the first place. That way the + * 'totally_frozen' results from heap_prepare_freeze_tuple can always be + * used in the same way, even when no freeze plans need to be executed to + * "freeze the page". Only the "freeze" path needs to consider the need + * to set pages all-frozen in the visibility map under this scheme. * * When we freeze a page, we generally freeze all XIDs < OldestXmin, only * leaving behind XIDs that are ineligible for freezing, if any. And so @@ -178,11 +176,6 @@ typedef struct HeapPageFreeze * VACUUM scans a page that isn't cleanup locked. Both code paths are * based on the same general idea (do less work for this page during the * ongoing VACUUM, at the cost of having to accept older final values). - * - * When vacuumlazy.c caller decides to do "no freeze" processing, it must - * not go on to set the page all-frozen (setting the page all-visible - * could still be okay). heap_prepare_freeze_tuple's 'totally_frozen' - * results can only be used on a page that also gets frozen as instructed. */ TransactionId NoFreezePageRelfrozenXid; MultiXactId NoFreezePageRelminMxid; |
