Re: get rid of RM_HEAP2_ID - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: get rid of RM_HEAP2_ID
Date
Msg-id aO8xs2B6tOvCzAsO@paquier.xyz
Whole thread Raw
In response to Re: get rid of RM_HEAP2_ID  (John Naylor <johncnaylorls@gmail.com>)
List pgsql-hackers
On Wed, Oct 15, 2025 at 12:01:44PM +0700, John Naylor wrote:
> On Wed, Oct 15, 2025 at 6:55 AM Michael Paquier <michael@paquier.xyz> wrote:
>> We could move out xl_xid, which should not be required for all
>> records, shaving 4 bytes from the base XLogRecord.  I'm afraid of the
>> duplication this would create if we push this data to each RMGR, which
>> would, I guess, require a new RMGR callback to retrieve this field on
>> a per-record basis.  But perhaps it would not be that bad.
>
> I've wondered if it would be possible to make xl_tot_len a varint that
> starts in the last byte of the header, with the next bytes being like
> XLogRecordDataHeader[Short|Long], but likewise using a varint.

This suggestion gives me some shivers, TBH.  We've had a couple of
issues with the read of records that spawn across multiple pages,
relying now very strongly on xl_tot_len being the first field in
XLogRecord.  Making this field variable may be really tricky while the
code we have now in xlogreader.h is pretty stable.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Maxim Orlov
Date:
Subject: Re: Patch for migration of the pg_commit_ts directory
Next
From: Shinya Kato
Date:
Subject: Re: remove unnecessary include in src/backend/commands/policy.c