Re: POC: make mxidoff 64 bits

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Maxim Orlov <orlovmg(at)gmail(dot)com>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, wenhui qiu <qiuwenhuifx(at)gmail(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: POC: make mxidoff 64 bits
Date: 2025-11-04 15:10:31
Message-ID: CAPpHfduDFLXATvBkUiOjyvZUBZXhK_pj5zjVpxvrJzkRVq+8Lw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 30, 2025 at 6:17 PM Maxim Orlov <orlovmg(at)gmail(dot)com> wrote:
> On Thu, 30 Oct 2025 at 12:10, Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:
>>
>>
>> Oh I see, the 'base' is not necessarily the base offset of the first
>> multixact on the page, it's the base offset of the first multixid that
>> is written to the page. And the (short) offsets can be negative. That's
>> a frighteningly clever encoding scheme. One upshot of that is that WAL
>> redo might get construct the page with a different 'base'. I guess that
>> works, but it scares me. Could we come up with a more deterministic scheme?
>>
> Definitely! The most stable approach is the one we had before, which
> used actual 64-bit offsets in the SLRU. To be honest, I'm completely
> happy with it. After all, what's most important for me is to have 64-bit
> xids in Postgres, and this patch is a step towards that goal.

Yes, but why can't we have an encoding scheme which would both be
deterministic and provide compression? The attached is what I meant
in [1]. It's based on v19 and provide deterministic conversion of
each 8 of 64-bit offsets into a chunks containing 64-bit base and 7 of
24-bit increments. I didn't touch pg_upgrade code though.

Links.
1. https://www.postgresql.org/message-id/CAPpHfdtPybyMYBj-x3-Z5%3D4bj_vhYk2R0nezfy%3DVjcz4QBMDgw%40mail.gmail.com

------
Regards,
Alexander Korotkov
Supabase

Attachment Content-Type Size
v21-0001-Use-64-bit-multixact-offsets.patch application/octet-stream 33.4 KB
v21-0002-Add-pg_upgarde-for-64-bit-multixact-offsets.patch application/octet-stream 34.9 KB
v21-0003-Add-test-for-64-bit-mxoff-in-pg_resetwal.patch application/octet-stream 4.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Arseniy Mukhin 2025-11-04 15:13:19 Re: BRIN autosummarization lacking a snapshot
Previous Message Andrei Lepikhov 2025-11-04 14:46:35 Re: MergeAppend could consider sorting cheapest child path