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 1uxQPQ-00EAl8-Ly for pgsql-hackers@arkaria.postgresql.org; Sat, 13 Sep 2025 13:35:20 +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 1uxQOO-005vh7-JS for pgsql-hackers@arkaria.postgresql.org; Sat, 13 Sep 2025 13:34:17 +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 1uxQOO-005vgu-1H for pgsql-hackers@lists.postgresql.org; Sat, 13 Sep 2025 13:34:16 +0000 Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uxQOM-000Cdh-1x for pgsql-hackers@lists.postgresql.org; Sat, 13 Sep 2025 13:34:15 +0000 Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-88f2740619bso92470339f.2 for ; Sat, 13 Sep 2025 06:34:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757770454; x=1758375254; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=9uGIVNjN9PBzvY/pkjd/l1XLywlX8XWFJjlHU4wpoi0=; b=TphbSU2SA1iKyG04au65sNyN9HnuMkePseGof6j18lPukkEYmJ+SwvzWravlblfi5N xpk04PhWwId0FQ+lWcEQQl76B3NRevvUA5BLfaDB5gYvbua9meFtWD0iU5fr9FDVN/9W 9DZSVagmhJkQik1XZ15K9eG2xSrP3Xz2IKOSWc7I2Rl1S/GH2Ozp6ALKlTfS3VPghSZj zahgUJcWiHWiWiiPtTAZjayitv2fByr9983OMrz9PE+cHga8yCJ68qpdfRo6crgaRtSV YqNjvaYMkbx/F2Joux8eiFf8frDlWI/k6MYYO0HxfJ7ge/xrOJSL4sqrQU7EUFECrZth xvjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757770454; x=1758375254; h=content-transfer-encoding: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=9uGIVNjN9PBzvY/pkjd/l1XLywlX8XWFJjlHU4wpoi0=; b=teobbHAu7saDseBwcKse2oUqzePh/jY/Db+5Gy74TjNnN9ufNa9PAtI1y6jqJgynAg rMPE3zv/dAXhuJQrQ75PuDJdqPvL6GJH2NA9BVFeisKEQ4QNXtLwstdTYQu2L4d4ZB8+ FNpfX0MlddN1QP1zLx8Ni+dWGGAsgWc+AFhMhkDKcw5gTh159tqAiPOaLI6AQByA/nTG YR32Qf1RMYGb6WQMjTRAFiUnFUAEaMc/ek9izHNdU4TIKO/secvI/EPpyAqZVUzxagWP pd4Dx9g8kKBm6U4KDU2rpDpJfJNE13URVzq31aQmi+G4rSHZNB1aDiG8wIX+QxCbT8uf faHQ== X-Forwarded-Encrypted: i=1; AJvYcCWa+VFqD/kS/lkuSdTIvlwZYBLw3PDGw8yUZaKa4WQZ4QakHmSauKGBKjsxCHqUEqjQ+VRDzYe5UluWFSuR@lists.postgresql.org X-Gm-Message-State: AOJu0YyVrl4J7jbRuRQTAQZLPWbCxoKvzBZ+kLoub0/Pdwfeos7S4iT5 xasKkGI0z3o82t9gXVfcORylNGY7ZcWGFkgVzNYfJyrMovqPyjM+Fq4AsXHSWP9JeaaEBuH/c4l FJeQDD6P4oDSqMzDMlIljUAYg4rc4G/g= X-Gm-Gg: ASbGncuvLC2+8ZxDasfIwYepRBPFhGKa0g0fbr/YVnKTXvFczYgC3uEScFOO5IMP1WZ s0pZX3pCmIsfnyqj+12PBuGqm3jMz8ZOF3T0lr/si+8wkVLB0OyjHKaGrH//kmb3OcjtElxcsYh r3hlkvBIwf5T9350OxVcpKK9CSI/mrvIdhb9esoC42y9/BYKIg5yG95cHBIbbQHf44tEpi2Fniv 3L/AsBKoBRHpnanMg== X-Google-Smtp-Source: AGHT+IHveUqKiOi0mCQGEfXlpCfpCz3r4kD/vTwNkfEQ4Ww7Q2a1lHQeUkHTC1w3DfgzFGnL2S3Icr7XICclSpKOK8U= X-Received: by 2002:a05:6e02:4615:b0:422:bf42:bfc3 with SMTP id e9e14a558f8ab-422bf42c146mr54455575ab.27.1757770453678; Sat, 13 Sep 2025 06:34:13 -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: Alexander Korotkov Date: Sat, 13 Sep 2025 16:34:01 +0300 X-Gm-Features: Ac12FXylj_v2fazAAdpfOBUozHcK2Vu2it0P77J44dhGGO7ZAB20QpJNzg14H9Q Message-ID: Subject: Re: POC: make mxidoff 64 bits To: Maxim Orlov Cc: Ashutosh Bapat , wenhui qiu , Heikki Linnakangas , Postgres hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Maxim! On Thu, Sep 11, 2025 at 11:58=E2=80=AFAM Maxim Orlov wr= ote: > > Once again, @ 8191e0c16a Thank you for your work on this subject. Multixact members can really grow much faster than multixact offsets, and avoiding wraparound just here might make sense. At the same time, making multixact offsets 64-bit is local and doesn't require changing the tuple xmin/xmax interpretation. I went through the patchset. The shape does not look bad, but I have a concern about the size of the multixact offsets. As I understand, this patchset grows multixact offsets twice; each multixact offset grows from 32 bits to 64 bits. This seems quite a price for avoiding the Multixact members' wraparound. We can try to squeeze multixact offsets given it's ascending sequence each time increased by a multixact size. But how many members can a multixact contain at maximum? Looking at MultiXactIdExpand(), I get that we're keeping locks from in-progress transactions, and committed non-lock transactions (I guess the latter could be only one). The number of transactions running by backends should fit MAX_BACKENDS (2^18 - 1), and the number of prepared transactions should also fit MAX_BACKENDS. So, I guess we can cap the total number of one multixact members to 2^24. 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? ------ Regards, Alexander Korotkov Supabase