On 01/04/2024 20:22, Melanie Plageman wrote:
>> From 17e183835a968e81daf7b74a4164b243e2de35aa Mon Sep 17 00:00:00 2001
>> From: Melanie Plageman <melanieplageman@gmail.com>
>> Date: Fri, 29 Mar 2024 19:43:09 -0400
>> Subject: [PATCH v11 3/7] Introduce PRUNE_DO_* actions
>>
>> We will eventually take additional actions in heap_page_prune() at the
>> discretion of the caller. For now, introduce these PRUNE_DO_* macros and
>> turn mark_unused_now, a paramter to heap_page_prune(), into a PRUNE_DO_
>
> paramter -> parameter
>
>> action.
>> ---
>> src/backend/access/heap/pruneheap.c | 51 ++++++++++++++--------------
>> src/backend/access/heap/vacuumlazy.c | 11 ++++--
>> src/include/access/heapam.h | 13 ++++++-
>> 3 files changed, 46 insertions(+), 29 deletions(-)
>>
>> diff --git a/src/backend/access/heap/pruneheap.c b/src/backend/access/heap/pruneheap.c
>> index fb0ad834f1b..30965c3c5a1 100644
>> --- a/src/backend/access/heap/pruneheap.c
>> +++ b/src/backend/access/heap/pruneheap.c
>> @@ -29,10 +29,11 @@
>> /* Working data for heap_page_prune and subroutines */
>> typedef struct
>> {
>> + /* PRUNE_DO_* arguments */
>> + uint8 actions;
>
> I wasn't sure if actions is a good name. What do you think?
Committed this part, with the name 'options'. There's some precedent for
that in heap_insert().
I decided to keep it a separate bool field here in the PruneState
struct, though, and only changed it in the heap_page_prune() function
signature. It didn't feel worth the code churn here, and
'prstate.mark_unused_now' is a shorter than "(prstate.options &
HEAP_PRUNE_PAGE_MARK_UNUSED_NOW) != 0" anyway.
--
Heikki Linnakangas
Neon (https://neon.tech)