diff options
| author | Melanie Plageman <melanieplageman@gmail.com> | 2025-12-16 10:30:14 -0500 |
|---|---|---|
| committer | Melanie Plageman <melanieplageman@gmail.com> | 2025-12-16 11:04:07 -0500 |
| commit | bfe5c4bec75091d5c91813ff9c6994a169ceb8ef (patch) | |
| tree | b1ea1fad55c617e6f3de2d902fa9f8d0a3de9b9c /src/backend | |
| parent | 4877391ce894e5b964a69e94e1750cde9df04a07 (diff) | |
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
Diffstat (limited to 'src/backend')
| -rw-r--r-- | src/backend/access/heap/pruneheap.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/backend/access/heap/pruneheap.c b/src/backend/access/heap/pruneheap.c index f99d92725b8..07aa08cfe14 100644 --- a/src/backend/access/heap/pruneheap.c +++ b/src/backend/access/heap/pruneheap.c @@ -385,6 +385,13 @@ prune_freeze_setup(PruneFreezeParams *params, prstate->recently_dead_tuples = 0; prstate->hastup = false; prstate->lpdead_items = 0; + + /* + * deadoffsets are filled in during pruning but are only used to populate + * PruneFreezeResult->deadoffsets. To avoid needing two copies of the + * array, just save a pointer to the result offsets array in the + * PruneState. + */ prstate->deadoffsets = presult->deadoffsets; prstate->frz_conflict_horizon = InvalidTransactionId; |
