Re: Using MyDatabaseId in SET_LOCKTAG_APPLY_TRANSACTION
Maxim Orlov <orlovmg@gmail.com>
From: Maxim Orlov <orlovmg@gmail.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-12-03T10:50:59Z
Lists: pgsql-hackers
On Wed, 3 Dec 2025 at 12:38, Heikki Linnakangas <hlinnaka@iki.fi> wrote: > > Even with 64-bit XIDs, you can't have transactions older than 2^31 still > running, right? So AFAICS you can continue using 32-bit XID in LOCKTAG. > > Actually, I can, and some brave people do just that. Although it is bad for a number of reasons. The issue is that I can't put on the same page tuples with XIDs that differ by more than 2^31 using the current design (with storing the XIDs "base" on the page). That is why I start thinking about "real" 64-bit XIDs. As for my original question, I think, the reason to have MyDatabaseId in the LOCKTAG is that it's cheaper to store it in the lock, than try to get it "on demand" in pg_lock_status() call by invoking GetSubscription(). -- Best regards, Maxim Orlov.