On Thu, Oct 30, 2025 at 6:17 PM Maxim Orlov <[email protected]> wrote:
> On Thu, 30 Oct 2025 at 12:10, Heikki Linnakangas <[email protected]> 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: v21-0001-Use-64-bit-multixact-offsets.patch
Description: Binary data

Attachment: v21-0002-Add-pg_upgarde-for-64-bit-multixact-offsets.patch
Description: Binary data

Attachment: v21-0003-Add-test-for-64-bit-mxoff-in-pg_resetwal.patch
Description: Binary data

Reply via email to