Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uyBLR-004qSE-BY for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Sep 2025 15:42:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uyBLO-00CFLj-0f for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Sep 2025 15:42:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uyBLN-00CFLb-LB for pgsql-hackers@lists.postgresql.org; Mon, 15 Sep 2025 15:42:18 +0000 Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uyBLM-000Z0O-05 for pgsql-hackers@lists.postgresql.org; Mon, 15 Sep 2025 15:42:17 +0000 Received: by mail-qk1-x72c.google.com with SMTP id af79cd13be357-82b19440a50so5432585a.1 for ; Mon, 15 Sep 2025 08:42:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757950935; x=1758555735; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Qe80IF9p6vQjTmCzCbJ9V7WFfQMsT8LGjCKJ1TnL5Nk=; b=gzC38G8cGwYum5o+KorQ8bQnw1XeokAyFqnHyz/WoDnrpzR67+7txo8yJh7+cBqdeg GnHq0CNH9mdzc+WVYfmbmuX3F+y/8DXgN2iVowMFs3gCOUwlaO6AzwTROxO/3acL0SnO F9EM8HupMKJ5585lPxXj8tto1bxa0vCClgFQHmq5e9NedKd7wsnsJRZQIp62SuE4l9yM aqsMaZAiS1QHvEiSa33N5ClwTprOdpW/MKhYgpOnKREyESZJvpi+VnPaqvQLWrPNwdhd wLphr6G3SmJ+daDqj1+exkcyFhfNC7VlKZK9ozLB8omvIvmkGa6tqRS8JVW3Hyr3XQVX iuoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757950935; x=1758555735; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Qe80IF9p6vQjTmCzCbJ9V7WFfQMsT8LGjCKJ1TnL5Nk=; b=RbwXkcDQUPAFhxX/MtEW/5nk2GGA25ExSsezdYxSveqb+GNBrmb1qIkaBr15NV3B6S tq7INfFdKJ6PQ8bR2Jf2I6FBxnYv6R6ZQ6h6cIYglKx6tMGbfhhukLU3H/UsNywTWHKF J9riO8w+U1dRhNgnMZvK2IXVUstANHaHK95ZK95XLqXtoP5LNGUV1Djcw19CRrJmPa+X xn0KVFpZxsGbY1SBGA+7OF9IK9vDTekWD441AfWk7Qe0IugosDVE3zyA3crMoXLjEdP4 MXxf53zTk2moLuMSCxptuKBzzG29X8nh5asMJxDGdcCFmF3GSrAKbNmIAWejmuGy6oTv GpJw== X-Forwarded-Encrypted: i=1; AJvYcCVWb9Uj8t/blidcS3YIAYstW2nMx/8CknMAyZtdLXj643mHktsP5wGZPC+v9t214dpLDWppYn4CJePrRwvJ@lists.postgresql.org X-Gm-Message-State: AOJu0YxHCM6jvDtNiBrrA050svXcLqMus6zx6lv6Z0GCY8EYnve2iJtK 8dwijNObz5z8M86R1aihlO77XI0fDJcW7pbdg2vSyZd2bM/WxuqY04g4qtJDQYyhYxfCDNQ88kI gs1U42TRNbG9wzQa5+aFVuWozhmVH/uI= X-Gm-Gg: ASbGncvkxsitqXK3zkBLemdaaoXI76P48yokwG6iiLEF3rfOvaGHflTrgk/Qie+7dGk CLj+TncSMPj7FMpYP7nYorzX/dTNhWzmlazFcw8gKf/+x29FjaHarOECYFfRtJMiMaUcQAKO1Cp YRShopi3dBEJNgmorabeL3SFZT4WogY2ou33if+Yfatm/KG5L0U+bB0Eli4QnkIx4S7FppFwhJH zB4TjZHYy15fejo/A== X-Google-Smtp-Source: AGHT+IFL1j/EBTi6fZC3EJ7n5iLkxVjJlp5TkgDBstqEYWKcJe7lLGCh9DwbzhqVBI6wg9vqTdnVcw8F+HtlPCUL0lg= X-Received: by 2002:a05:620a:2993:b0:815:4b9c:61f5 with SMTP id af79cd13be357-823fbdead32mr973510385a.2.1757950934870; Mon, 15 Sep 2025 08:42:14 -0700 (PDT) MIME-Version: 1.0 References: <4535f3aa-3220-4760-b1f5-2bc91f248e03@iki.fi> <2bc58592-9d74-4af0-bdd1-1a88e8683f7c@iki.fi> <36531c0e-292c-409d-bbc7-a252cf6e910a@iki.fi> In-Reply-To: From: Maxim Orlov Date: Mon, 15 Sep 2025 18:42:00 +0300 X-Gm-Features: Ac12FXyDHR3TQ5JjNoUxuu0AcCkA9X2sZVcu5M0wx83sc5MbQsiUbHi5062ivgw Message-ID: Subject: Re: POC: make mxidoff 64 bits To: Alexander Korotkov Cc: Ashutosh Bapat , wenhui qiu , Heikki Linnakangas , Postgres hackers Content-Type: multipart/alternative; boundary="0000000000000175ef063ed8d933" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000000175ef063ed8d933 Content-Type: text/plain; charset="UTF-8" On Sat, 13 Sept 2025 at 16:34, Alexander Korotkov wrote: > > Therefore, we can change from each 8 of 32-bit multixact offsets > (takes 32-bytes) to one 64-bit offset + 7 of 24-bit offset increments > (takes 29-bytes). The actual multixact offsets can be calculated at > the fly, overhead shouldn't be significant. What do you think? > > Thank you for your review; I'm pleased to hear from you again. Yes, because the maximum number of mxoff is limited by the number of running transactions, we may do it that way. However, it is a bit wired to have offsets with the 7-byte "base". I believe we may take advantage of the 64XID patch's notion of putting a 8 byte base followed by 4 byte offsets for particular page. 32kB page may contain then 2^13-2 offsets, each is maxed by 2^18+1. Therefore, offset from base will never overflow 2^31 and will always fit uint32. It appears logical to me. -- Best regards, Maxim Orlov. --0000000000000175ef063ed8d933 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Sat, 13 Sept= 2025 at 16:34, Alexander Korotkov <aekorotkov@gmail.com> wrote:

Therefore, we can change from each 8 of 32-bit multixact offsets
(takes 32-bytes) to one 64-bit offset + 7 of 24-bit offset increments
(takes 29-bytes).=C2=A0 The actual multixact offsets can be calculated at the fly, overhead shouldn't be significant.=C2=A0 What do you think?

Thank you for your review; I'm pl= eased to hear from you again.

Yes, because the maximum number of mxo= ff is limited by the number of
running transactions, we may do it that = way.
However, it is a bit wired to have offsets with the 7-byte "ba= se".

I believe we may take advantage of the 64XID patch's n= otion of putting a=C2=A0
8 byte base followed by 4 byte offsets f= or particular page.=C2=A0

32kB page may contain th= en 2^13-2 offsets, each is maxed by 2^18+1.
Therefore, offset fro= m base will never overflow 2^31 and will always=C2=A0
fit=20 uint32.

It=C2=A0appears=C2=A0logical to me.
<= /div>


--
Best regards,
Maxim Orlov.
--0000000000000175ef063ed8d933--