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 1v8Vkv-001uMT-JL for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Oct 2025 03:31: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 1v8Vks-009ykE-Vb for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Oct 2025 03:31:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v8Vks-009yk5-Jf for pgsql-hackers@lists.postgresql.org; Tue, 14 Oct 2025 03:31:19 +0000 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v8Vkr-0022ml-1H for pgsql-hackers@lists.postgresql.org; Tue, 14 Oct 2025 03:31:19 +0000 Received: by mail-qk1-x731.google.com with SMTP id af79cd13be357-87808473c3bso890431685a.1 for ; Mon, 13 Oct 2025 20:31:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760412676; x=1761017476; 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=Qjb4RZesJFFYfhXXKsvYMhKwQ2BIxdk7ZUxnK3s6+mU=; b=Nq1GTY4S14mFak0I3TNcjyLdwPsYEtEvQ1VL1Fd9L0gFO0fMdgXucDqFcXhrb6GfYx vK8FIntWqqiDmgi1vdQaphVjQcgVxui6WHHESnZMS/ax6FDsYmmU1uqL34c75IiTniCI OT31lFKemYvjCVZPYPp580TVFjHLNd4L9L/bybDhbQ7mi/YNRZfrEUHJC0L2or9OsWT9 w3v4P2vFYTiTDSUTVLTswtHV+MhfcphV7NzbZisoSVrp1v50khJ7z46pT0E3ullSske2 h8mLyreIymdDuu4anXUzdUsjawjwyRqIjp1Lxx07hJJ5BJ4u7iBR3KNkG7csxZYGWUOm tKxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760412676; x=1761017476; 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=Qjb4RZesJFFYfhXXKsvYMhKwQ2BIxdk7ZUxnK3s6+mU=; b=fvcwGF8Xy/uGlBrktEgtWqEdszOAQO/8KrDjCj68KT5EWWza0kPZQaMZbdSKPthZpW 6dXxhaPD16YEYDFUsNUtLSLde0GyGdPjkl/LS+g3rRgl0MWa29t4BECxTsZZFas7R1Cs jjH2PaaWMY/AziNjwRYsmVWNkXhvIn168L9uDZoaBfGfP9gQ9o4ZhWYEK8u/kTfdrdgN 6Sv2pdHTYsAr44B5HkNDXaHVXlSOC6HkYFFOcUsxdAoC7fnbphtLiQk3YCyRdZa2iZ8Z 7RFDcDIVjfvMgCS1L8wyGdL3Voweva35lEiAOeeE1TZnLkm7iIN4o2Qv4pTbD7vifzik N/cg== X-Forwarded-Encrypted: i=1; AJvYcCVkbSNg08dc/eqsINN5bNe44xdkd2ccKc/iMK+yBYiKcO7Qksf7bUU/p3ZraPPxnbjGF41NJfVYoyHn3T2Q@lists.postgresql.org X-Gm-Message-State: AOJu0YxZtETH1Ko116BCVJgkCbhdLHdo2Zcw7n8IgngbSlfREMnX3iCe FxkFBgl0AofHzbbqUS4M02xbqMUMheFJYrocSOynnRubSvS7E/C5r460CBD4GkDIPNNnYA/YPeK kkSW8eu3sMqF3HtQYzE5i/oTpvveO/UE= X-Gm-Gg: ASbGnct4Y5SSxR2NHY0wcLAIre/bocNKgzi8ackEQ9QGITm7HI8pVavT8mNPfA59BgO jLk0tV83T60D/2B7H0a36Ecw/cyzFJZkGlBfFUkfKWQXHTSscpZLs30MBlLMCHPkmg3Noc4Dqh8 tZhwq2MSMCRK+mQZ65uU+DETf1SJO4FLinSLGEYIM1hLVNADWZPSpojoviDgwEx5wrLv8oSQAbv +oF77BZfs0RJy7GcmRY+vPLFB8/IXyAW14TTPaYJm1+eX4q X-Google-Smtp-Source: AGHT+IFT6+HG1ETekMVpW0B9fH7DXSnihZVtzaOSB90C1Fwj0tYmBySxC8UWFTpVdlhQpHpXXgRtURce1J0RRgkZh/g= X-Received: by 2002:a05:622a:19a5:b0:4e0:5918:a476 with SMTP id d75a77b69052e-4e6ead6b52dmr316826581cf.79.1760412675770; Mon, 13 Oct 2025 20:31:15 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Kirill Reshke Date: Tue, 14 Oct 2025 08:31:04 +0500 X-Gm-Features: AS18NWCLg8IdJmfLGwm1mDjxg8TwGReU_1PiXfdrgYepI2gZ7HLm_rqlX7HTm2M Message-ID: Subject: Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access) To: Melanie Plageman Cc: Robert Haas , Andres Freund , Andrey Borodin , PostgreSQL Hackers , 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 Thu, 9 Oct 2025 at 03:54, Melanie Plageman w= rote: > > On Mon, Oct 6, 2025 at 6:40=E2=80=AFPM Melanie Plageman > wrote: > > > > In attached v16, I=E2=80=99ve reverted to removing XLOG_HEAP2_VISIBLE > > entirely, rather than first removing each caller's heap page from the > > VM WAL chain. I reordered changes and squashed several refactoring > > patches to improve patch-by-patch readability. This should make the > > set read differently from earlier versions that removed > > XLOG_HEAP2_VISIBLE and had more step-by-step mechanical refactoring. > > > > I think if we plan to go all the way with removing XLOG_HEAP2_VISIBLE, > > having intermediate patches that just set PD_ALL_VISIBLE when making > > other heap pages are more confusing than helpful. Also, I think having > > separate flags for setting PD_ALL_VISIBLE in the WAL record > > over-complicated the code. > > I decided to reorder the patches to remove XLOG_HEAP2_VISIBLE from > vacuum phase III before removing it from vacuum phase I because > removing it from phase III doesn't require preliminary refactoring > patches. I've done that in the attached v17. > > I've also added an experimental patch on the end that refactors large > chunks of heap_page_prune_and_freeze() into helpers. I got some > feedback off-list that heap_page_prune_and_freeze() is too unwieldy > now. I'm not sure how I feel about them yet, so I haven't documented > them or moved them up in the patch set to before changes to > heap_page_prune_and_freeze(). > > 0001: Eliminate XLOG_HEAP2_VISIBLE from COPY FREEZE > 0002: Eliminate XLOG_HEAP2_VISIBLE from phase III of vacuum > 0003 - 0006: cleanup and refactoring to prepare for 0007 > 0007: Eliminate XLOG_HEAP2_VISIBLE from vacuum prune/freeze > 0008 - 0009: Remove XLOG_HEAP2_VISIBLE > 0010 - 0012: refactoring to prepare for 0013 > 0013: Set VM on-access > 0014: Set pd_prune_xid on insert > 0015: Experimental refactoring of heap_page_prune_and_freeze into helpers > > - Melanie Hi! Should we also bump XLOG_PAGE_MAGIC after d96f87332 & add323da40a or do we wait for full set to be committed? --=20 Best regards, Kirill Reshke