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.96) (envelope-from ) id 1vks1L-003CEJ-2S for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Jan 2026 22:58:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vks1J-00GM1K-1F for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Jan 2026 22:58:49 +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.96) (envelope-from ) id 1vks1I-00GM1C-2u for pgsql-hackers@lists.postgresql.org; Tue, 27 Jan 2026 22:58:49 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vks1G-002dnC-19 for pgsql-hackers@lists.postgresql.org; Tue, 27 Jan 2026 22:58:48 +0000 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-6505d3adc3aso8255388a12.1 for ; Tue, 27 Jan 2026 14:58:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1769554726; cv=none; d=google.com; s=arc-20240605; b=NC5mcip1JX6JQxJdTdbhT+JrVUx5UwPvRybIknx3uStn7dc0F9VAsKZBK94/PSmYTG 0ydmVGjlpahixae79vXKfLAYiN0aG+kDByQ54aixFVoE+f8VYDOU+GhnNsZ5zBl3YNBr Y1dOKGwfxKeIUem975AhZqdTJZ/WpnumYRl2ZvkJV1h0A8dEcUPoZjSqwf0UFpIpsfE1 53kAdDTg+hZFTBLH6twgeRmq0vOG87Q9c1i33+2DtPXy+JfT9AkdRfC9oWB6Y1HMRIKc iHnXCrG44+1cOVVdgw/mBm5rmgnMXPtKP5VrnR9jNPjenk22YgjJk3R9dMZ5LNUjpO2X A57A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=klX8zSNaer2+T3cy/wwtKLFQqsJQOdl0ijndlheg0wc=; fh=0p1KYE4glqI3+7jxX73INIIS3uI0weO249GJ6LsNrOY=; b=bUOrWVSBPMwzg9IRoycDFL4kmuG8Wm3mFkirCm5LYiuRreb1OrkgXculY6if0xFh+q XN0HylsgLMdUnF4iYpqZFgxal0815Aqgb/2lDUpuqjPfYyB5YKrhaBVm7TK8ElpRP2mi KL6rFHvpz39ktUNMSHhzaIVPQ6zYNMhvfhcBjyqSPVEsF5np/yIQrWvwLnSlpd+D/JFl gdPRwkVwaEDM6vi0eHXv3jshidTgVVi02Tqe7eN4JzLrvZU5rVFoR5vO6hyPmo7ul9lB NEe179WsQLG0BR8O6DP2AM/ATQRS90UJjAPjADcWMJJr6kWfIbKDn9e4b3dX68QwUAdl A2Ug==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769554726; x=1770159526; 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=klX8zSNaer2+T3cy/wwtKLFQqsJQOdl0ijndlheg0wc=; b=eHG2LfFhplo+vy3OdFcV1tkNHlmccZAkAF755PAtODlpGMuZG4eIuBPGKdVEz3QaKe O5fo076zBLkjrrBT+mBJCIn4mDx7HhLQCF7rNiW7o4RRAr1b9u041nb9Yj0hQJdpA+fQ FMvIZTdagFPQc5J+OctUdn4qk6IIdk6KoVyQJO5529ASkpckN/gSimzA8Z4IqvgisY29 xSyi7haPRTZEDkemo5cv7zpyCDNh1qsM+dSVxLR9eqC+rFlP/wqM/eVs002qYan70JUu KixWGj7XRksvOyxUOjaqjzi19m9yZjJl4H2DVUgCoFaxRDBokQbPp5bBYMqA//RmI+xy MpIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769554726; x=1770159526; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=klX8zSNaer2+T3cy/wwtKLFQqsJQOdl0ijndlheg0wc=; b=V9L1oTUySeuX/1nFmln3ApWD7ezBULbK2ljw4m3y1ipLo89cg890pIQq4ovePES2JI 7pduJsQAQflYk8F5gunbTSzEECBzexGEyYN7F8nAnHEFlgLWj9o3veU1/2AtScsnqSPO NhecjIEudnRXajo/syjYsok84Gn3lZ6mJMSO40Unt3vJaLfHiE3ceCu40DZUpUIdSE39 uZ/e5lo719h3onZ6Q7H4WyDgSOP+ntMuZ9TsXXjDP+lxyeQxO9dRQuU9BWLLQmi8Rnc9 +0LQ6NqS+ldCC9dzKPQR9sccqQtOshI70iw0rWtSLGVEGOa7fDfxVYQrc4ob20CyN3Z8 eMOQ== X-Forwarded-Encrypted: i=1; AJvYcCUnumBq6IufUKSUQ0Pv+I/vvA8mhmv+YLQWMxhptv/Y60d1VvTQs1WFE30LkMnJOzelQxknjpdCYeqQgJ04@lists.postgresql.org X-Gm-Message-State: AOJu0Yy5mT455Zg0Jqy0hd8Vhl+PhKc0Om9QrnNtxPPlBjyTOvGSWq5M elZz4i2x0k1upgWdLnwMr+b3+5oTXnwBpccmT4YOp2e9xww2ekN1vJoNISD2idYyDf/nAZDAe2f AT9xB2t32TeCTbyu9yhhc88qAcNUbhLQ= X-Gm-Gg: AZuq6aK8NL6tRe1pZPCCNtS+BNghPgUqpdxCJDeutH+8a6swA7Q0Rs/yihnVkknH77X VKrG4ECnB0llMoVb3539IMw2fpFLxTnTkAEQrQ3XaLcqVr78yO++Rbs4+FNJVqnNLg7TXiZlz7x eQ9hD5SdF5XR9q7+OI6oNLn5O0TiCZjTuyVgeQAw1e/pYkv1RWfneJZNqTOosB3Vc7JeLxCPfsY SxnGrXW87u5L35b+CnSUttpHmPcLTKONcYOB4mcnYRXLEOFd4nPLrHe2qcn7azW0UTgMeDkxJvn xET2nrBOnF6XyeE2D3tet72Oun/eHtzlSstj9to= X-Received: by 2002:a05:6402:5215:b0:64b:73d5:e2b4 with SMTP id 4fb4d7f45d1cf-658a6014c98mr2369657a12.5.1769554725351; Tue, 27 Jan 2026 14:58:45 -0800 (PST) MIME-Version: 1.0 References: <2wk7jo4m4qwh5sn33pfgerdjfujebbccsmmlownybddbh6nawl@mdyyqpqzxjek> <6BC5DBAB-6084-4BB8-8450-52E9648AB021@gmail.com> <7F5BCD7A-764D-4D8D-8E27-6F2CAAEA1CEE@gmail.com> <4379FDA3-9446-4E2C-9C15-32EFE8D4F31B@yandex-team.ru> In-Reply-To: From: Melanie Plageman Date: Tue, 27 Jan 2026 17:58:33 -0500 X-Gm-Features: AZwV_QhmxZU3ucPn8-nwkFTqj2zduAgs7xPI3NimyoD0FNahkJXwVZTq3LUy7Kg Message-ID: Subject: Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access) To: Chao Li Cc: Andrey Borodin , Kirill Reshke , Xuneng Zhou , Andres Freund , Robert Haas , 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 Wed, Jan 7, 2026 at 3:15=E2=80=AFAM Chao Li wro= te: > > I believe the reason why we add Assert(TransactionIdIsValid(dead_after)) = under HEAPTUPLE_RECENTLY_DEAD is to ensure that when HeapTupleSatisfiesVacu= umHorizon() returns HEAPTUPLE_RECENTLY_DEAD, dead_after must be set. So the= goal of the assert is to catch bugs of HeapTupleSatisfiesVacuumHorizon(). > > From this perspective, I now feel dead_after should be initialized to Inv= alidTransactionId. Otherwise, say HeapTupleSatisfiesVacuumHorizon() has a b= ug and miss to set dead_after, then the assert mostly like won=E2=80=99t be= fired, because it holds a random value, most likely not be 0. Actually, thinking about it more, I decided to remove the assertions on dead_after from those patches entirely. I don't use dead_after and only pass it in because HeapTupleSatisfiesVacuumHorizon requires it. In fact, I don't care if the function correctly sets dead_after since I don't use it. > + /* set if the query doesn't modify the rel */ > + SO_HINT_REL_READ_ONLY =3D 1 << 10, > ``` > > Nit: I think it=E2=80=99s better to replace =E2=80=9Crel=E2=80=9D to =E2= =80=9Crelation=E2=80=9D. For a function comment, if there is a parameter na= med =E2=80=9Crel=E2=80=9D, then we can use it to refer to the parameter, wi= thout such a context, I guess here a while word is better. k I'm currently working on a new version that incorporates Andres' review feedback and will post soon. - Melanie