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 1w55wu-002tA7-16 for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2026 17:53: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 1w55wr-008IMG-10 for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2026 17:53:49 +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.96) (envelope-from ) id 1w55wr-008IM8-03 for pgsql-hackers@lists.postgresql.org; Tue, 24 Mar 2026 17:53:49 +0000 Received: from fout-b5-smtp.messagingengine.com ([202.12.124.148]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w55wo-00000000uvR-2fRU for pgsql-hackers@lists.postgresql.org; Tue, 24 Mar 2026 17:53:49 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id 343251D00090; Tue, 24 Mar 2026 13:53:45 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Tue, 24 Mar 2026 13:53:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1774374824; x=1774461224; bh=inPANa50XE COI5iWw7OoPN8AxU/0xieMvPZlZqsqaBo=; b=e3Wg88TnAaRit/aHXtCqtxaobm ftfXfqSjfXgcE9LkkjOhQtq2aecpDes9WKJdb+gI8YouMrWOaD9AsyDQiUJL2VV0 m719VFuIAu88x1xfjtdddssIEHCHw0rHyBz6grhCdFdu7KqEL9ZOIOoF4wQ7hhVy beEqIVJwVmVkUMAQf0MDrZ01k3BipV8gxTmH+3L65kiEjxWc83vEYReiuBLOyNGz MrSLifn5knyjCsSQRLxgxG7Or4ROJrSy3LumDFzX9+fhAETF18PT3H0F6H4hmPSk Rdr664KAXaMRAXqXkhCamKNVIh21gv6fKCUHeICiI6jm3/9pK4oPnoIpcu0g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1774374824; x=1774461224; bh=inPANa50XECOI5iWw7OoPN8AxU/0xieMvPZ lZqsqaBo=; b=tcVWYJKBqUvitegkobSZZdF1fX4mIfd75440UK7dYFpwIJYQxzr HvnLGQx+MN3yRTyfzmZJdAa+lrdwuYRELF3Vr5Q0KYIA7IfgbdG+oD7IwkjncxuB I5+qBTEFBe8p4ecHhG8shH8WDfkxM6ffgfvm4U0KewNubkrPK0ULAJiKuZ4emQqe 8cm0KK5KMKuc/Hz6r/ME3qAojQCxHq0qWT8iMdu6dQy7OpQCRSPFBSsQvgNRUuMC OFTowIJA3abGpo7CbrrPaMg2QxzFbospP2sLqsEf08SyrDXEDfk67pFiH1TAYi/X DqYTw3JM8mVoKFSNbo36+V51wR6D6jd5fbQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefvddvvdefucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggujgesthdtsfdttddtvdenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnhepfeffgfelvdffgedtveelgfdtgefghfdvkefggeetieevjeekteduleevjefh ueegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hnughrvghssegrnhgrrhgriigvlhdruggvpdhnsggprhgtphhtthhopeekpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehlihdrvghvrghnrdgthhgrohesghhmrghilhdrtg homhdprhgtphhtthhopehmvghlrghnihgvphhlrghgvghmrghnsehgmhgrihhlrdgtohhm pdhrtghpthhtoheprhgvshhhkhgvkhhirhhilhhlsehgmhgrihhlrdgtohhmpdhrtghpth htoheprhhosggvrhhtmhhhrggrshesghhmrghilhdrtghomhdprhgtphhtthhopeiguhhn vghnghiihhhouhesghhmrghilhdrtghomhdprhgtphhtthhopehhlhhinhhnrghkrgesih hkihdrfhhipdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphho shhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepgiegmhhmmheshigrnhguvgigqdhtvg grmhdrrhhu X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 24 Mar 2026 13:53:44 -0400 (EDT) Date: Tue, 24 Mar 2026 13:53:43 -0400 From: Andres Freund To: Melanie Plageman Cc: Kirill Reshke , Chao Li , Andrey Borodin , Xuneng Zhou , Robert Haas , PostgreSQL Hackers , Heikki Linnakangas Subject: Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access) Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2026-03-23 17:54:13 -0400, Melanie Plageman wrote: > I've made some significant changes to 0006 and realized I need some > help. 0006 tracks what relations are modified by a query. This new > version (v44) uses relation oids instead of rt indexes to handle cases > where the same relation appears more than once in the range table > (e.g. INSERT INTO foo SELECT * FROM foo; foo appears twice). It > computes modifiedRelOids (a list of relation OIDs modified by the > query) in the planner and stores them in the PlannedStmt. There is one > big issue I'm not sure how to solve: I'm not entirely sure this is something we need to catch and therefore not sure that modifiedRelOids is worth the trouble over just having the RT indexes. > For queries like INSERT INTO ptable SELECT * FROM ptable, where ptable > is a partitioned table, though we scan ptable, we don't know when > executing that scan that we will then modify ptable with the insert. But does that matter? If such a query inserts a meaningful amount of rows it's going to insert into different pages than the ones you selected from? > In my patch, I've added find_all_inheritors() when populating > modifiedRelOids, but I realize this probably isn't acceptable to add > to planner from a performance perspective. Agreed. Greetings, Andres Freund