Skip to content

Commit bfe5c4b

Browse files
Add explanatory comment to prune_freeze_setup()
heap_page_prune_and_freeze() fills in PruneState->deadoffsets, the array of OffsetNumbers of dead tuples. It is returned to the caller in the PruneFreezeResult. To avoid having two copies of the array, the PruneState saves only a pointer to the array. This was a bit unusual and confusing, so add a clarifying comment. Author: Melanie Plageman <melanieplageman@gmail.com> Suggested-by: Chao Li <li.evan.chao@gmail.com> Discussion: https://postgr.es/m/CAEoWx2=jiD1nqch4JQN+odAxZSD7mRvdoHUGJYN2r6tQG_66yQ@mail.gmail.com
1 parent 4877391 commit bfe5c4b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/backend/access/heap/pruneheap.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,13 @@ prune_freeze_setup(PruneFreezeParams *params,
385385
prstate->recently_dead_tuples = 0;
386386
prstate->hastup = false;
387387
prstate->lpdead_items = 0;
388+
389+
/*
390+
* deadoffsets are filled in during pruning but are only used to populate
391+
* PruneFreezeResult->deadoffsets. To avoid needing two copies of the
392+
* array, just save a pointer to the result offsets array in the
393+
* PruneState.
394+
*/
388395
prstate->deadoffsets = presult->deadoffsets;
389396
prstate->frz_conflict_horizon = InvalidTransactionId;
390397

0 commit comments

Comments
 (0)