Re: Combine Prune and Freeze records emitted by vacuum

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Melanie Plageman <melanieplageman(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Geoghegan <pg(at)bowt(dot)ie>
Subject: Re: Combine Prune and Freeze records emitted by vacuum
Date: 2024-04-01 21:57:27
Message-ID: e117064e-cb5d-4298-8c85-fde77022c0b0@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 01/04/2024 20:22, Melanie Plageman wrote:
>> From 17e183835a968e81daf7b74a4164b243e2de35aa Mon Sep 17 00:00:00 2001
>> From: Melanie Plageman <melanieplageman(at)gmail(dot)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)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2024-04-01 22:06:49 Re: Security lessons from liblzma
Previous Message Tom Lane 2024-04-01 21:47:58 Re: Statistics Import and Export