Re: get rid of RM_HEAP2_ID

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: John Naylor <johncnaylorls(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: get rid of RM_HEAP2_ID
Date: 2025-10-15 14:35:58
Message-ID: 1c511d09-b0e4-44f8-94d6-067ef416bfd4@iki.fi
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 15/10/2025 02:54, Michael Paquier wrote:
> On Tue, Oct 14, 2025 at 03:20:16PM +0300, Heikki Linnakangas wrote:
>> I'm not sure I agree with the premise that we should try to get rid of
>> RM_HEAP2_ID. There's nothing wrong with that scheme as such. As an
>> alternative, we could easily teach e.g pg_waldump to treat RM_HEAP_ID and
>> RM_HEAP2_ID the same for statistics purposes.
>
> Yeah, I'd rather keep heap2 as well. As long as there is more room
> for the record IDs, we're still going to need it in the long run.

IMO if we do expand xl_info so that we have a full byte for
RMGR-specific info, then it does make sense to get rid of RM_HEAP2_ID
like this patch does. But if that was the only reason for changing the
WAL record header format, I don't think it's worth it.

>> This patch consumes one of the padding bytes. That's not entirely free, as
>> there is an opportunity cost: we could squeeze out the padding bytes and
>> save 2 bytes on every WAL record instead.
>
> Do you recall an alternative where it would have been possible to save
> 2 bytes for each record by removing the padding, and still have the
> full byte of xl_info be usable freely by each RMGR? I cannot recall
> any magic based on how XLogRecord is designed now, but perhaps I
> have missed an argument.

I don't know how to do that. My point was that if we *don't* consume a
full byte for RMGR-specific info, we could remove the two padding bytes
instead and make every WAL record 2 bytes smaller.

- Heikki

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2025-10-15 14:39:38 Re: get rid of RM_HEAP2_ID
Previous Message Srinath Reddy Sadipiralla 2025-10-15 14:26:56 Re: Making pg_rewind faster