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 1utjSC-00DOXV-3b for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Sep 2025 09:06:57 +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 1utjSA-008OF7-SH for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Sep 2025 09:06:55 +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 1utjSA-008OEy-IG for pgsql-hackers@lists.postgresql.org; Wed, 03 Sep 2025 09:06:54 +0000 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1utjS9-000ItU-0G for pgsql-hackers@lists.postgresql.org; Wed, 03 Sep 2025 09:06:53 +0000 Received: by mail-qt1-x82b.google.com with SMTP id d75a77b69052e-4b30d09da3aso56677521cf.3 for ; Wed, 03 Sep 2025 02:06:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756890412; x=1757495212; 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=ELkEWIh/z9ptK3KCfPDhXQVH0RqIvbY2hjIjCZdLddg=; b=CAszMbt2Ml/zrnM3pwC8ynqpkZVYTICEEVxYzAHJ8z733k8rutgUXOw6lZxiAsOcGE miBFVAFSMRWCdcZsKHIRMHq28Ziyajkkpc/SHFvzycrxFaljHVa5LzQRZoGC9k3A8V2L La9+5JU9TXebVmmTh/CzUr01UO6nCbGbno0tqEdYqxxvDGs3eVz8HZBQ/OnoAtiJ2U6d hNnJH5+XaTsfGWJdpRUZyf4Ak7+uH2ABCGVirEtBEFb2C7RK8ff9T3chKiOrwjtuBiuh Fqs9kuEm3qhIw2Zjssmb4BZPwg7Ls9g1/MkIGY7E+qFlx/7Hs0jCtIaZlkZxAEWvEunH yrYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756890412; x=1757495212; 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=ELkEWIh/z9ptK3KCfPDhXQVH0RqIvbY2hjIjCZdLddg=; b=Dk6bG8N8bg8AF/AGfzjpnOxhOgZbmvYswnqBRE3hQ/pmF1iNZPskNYo/GZpy95ERfN tT9SDlCZqr2BHWNHEhEye7httDNYL6aT9/M2Kn6Sk7zZ85NWpg5DmZira8/vYMxUzp1C AE9VOVAajPy+/uGmbf44Vdf0DCUlki5jAiKo9BBQhvBVPOCAsaTA7Lc46YpWbsu1xUXz YxCx6O89zeHQv8XcjSjMTBm8dLNevvgknHccfQn+3kYZ9p7foN+1TRsnCKlwBc9kvSDw Qa9z4VCsop884UjHjA7Ff7tiFHCZCpRiOABXO+h2oWzJBdZcDD4zlciSS6wBuKk1Vhh0 C4zQ== X-Forwarded-Encrypted: i=1; AJvYcCUjNV7DPklu0uLWkIGjLH5i3EZS2hSgJVjoLC3klILloDv5xpCbuOcaOtZ/DrbQhPifUih1/9li5PZv6X7N@lists.postgresql.org X-Gm-Message-State: AOJu0Yy3+UWo2HVUiv+ds4cwOA9crpBeElM7gu/d4B+bz18/06Y9t3Kb px7tgvoFoBwMirV/VpPkDpwrORFrpLos03CkSQ156xYiHPseunRNC9bRVu57fFNxYPKUyJgxk1o 1+tj/vvgZORSLheou+pjEPmlhm4yIDfU= X-Gm-Gg: ASbGnctLB7RQfHnAxIitxbi2IlkTseAZJAhOzPESptX/f/ohsCwFP+6PEGxYFXd3vEv BU3e4wMwkcOZlWyMXrYzFgEBSL+PMD31HqjGdX+e+VkKggFtD39AAk7RYcj27XQq2YZZUwM8/Vd o2wCXYBdipri0IxOV2lTPrJnK3jBbzgMSMj5xBlRSwo2oP3Hu3m+NgAVT7BBO42kYoGTk0GluGu W6ISzqZtr1Dl7VKIb/GmJPQ/nuGxCF6AtgbgEz06vL1ltGFWA== X-Google-Smtp-Source: AGHT+IEGxHTw5dhme9X8pPyLi58UPRPQlE8sMKM6j1HzIB11YIUtphYyzZSNGwEjNK381j7WN6OXig23+h6U4/VYPN4= X-Received: by 2002:ac8:5a03:0:b0:4b3:48f2:b8d0 with SMTP id d75a77b69052e-4b348f2bc63mr61711511cf.59.1756890411659; Wed, 03 Sep 2025 02:06:51 -0700 (PDT) MIME-Version: 1.0 References: <87DD95AA-274F-4F4F-BAD9-7738E5B1F905@yandex-team.ru> In-Reply-To: From: Kirill Reshke Date: Wed, 3 Sep 2025 14:06:40 +0500 X-Gm-Features: Ac12FXxEYmNZYcAohuFkXWi3KC1vlSnBbJs6wF2EVfOahpiDtXFZTjmutxSX9xQ Message-ID: Subject: Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access) To: Melanie Plageman Cc: Andrey Borodin , PostgreSQL Hackers , Andres Freund , Robert Haas , Heikki Linnakangas 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 On Wed, 3 Sept 2025 at 04:11, Melanie Plageman wrote: > > On Tue, Sep 2, 2025 at 5:52=E2=80=AFPM Melanie Plageman > wrote: > > > > On Thu, Aug 28, 2025 at 5:12=E2=80=AFAM Kirill Reshke wrote: > > > > > > I did micro git-blame research here. I spotted only one related chang= e > > > [0]. Looks like before this change pin was indeed needed. > > > But not after this change, so this visibilitymap_pin is just an overs= ight? > > > Related thread is [1]. I quickly checked the discussion in this > > > thread, and it looks like no one was bothered about these lines or VM > > > logging changes (in this exact pin buffer aspect). The discussion was > > > of other aspects of this commit. > > > > Wow, thanks so much for doing that research. Looking at it myself, it > > does indeed seem like just an oversight. It isn't harmful since it > > won't take another pin, but it is confusing, so I think we should at > > least remove it in master. I'm not as sure about back branches. > > I've updated the commit message in the patch set to reflect the > research you did in attached v8. > > - Melanie Hi! small comments regarding new series 0001, 0002, 0017 LGTM In 0015: ``` reshke@yezzey-cbdb-bench:~/postgres$ git diff src/backend/access/heap/pruneheap.c diff --git a/src/backend/access/heap/pruneheap.c b/src/backend/access/heap/pruneheap.c index 05b51bd8d25..0794af9ae89 100644 --- a/src/backend/access/heap/pruneheap.c +++ b/src/backend/access/heap/pruneheap.c @@ -1398,7 +1398,7 @@ heap_prune_record_unchanged_lp_normal(Page page, PruneState *prstate, OffsetNumb /* * For now always use prstate->cutoffs for this test, because * we only update 'all_visible' when freezing is requested. We - * could use GlobalVisTestIsRemovableXid instead, if a + * could use GlobalVisXidVisibleToAll instead, if a * non-freezing caller wanted to set the VM= bit. */ Assert(prstate->cutoffs); ``` Also, maybe GlobalVisXidTestAllVisible is a slightly better name? (The term 'all-visible' is one that we occasionally utilize) --=20 Best regards, Kirill Reshke