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 1uI5bQ-00FWSg-QH for pgsql-hackers@arkaria.postgresql.org; Thu, 22 May 2025 13:04:52 +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 1uI5bP-0021kP-Jv for pgsql-hackers@arkaria.postgresql.org; Thu, 22 May 2025 13:04:51 +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 1uI5bP-0021kH-AE for pgsql-hackers@lists.postgresql.org; Thu, 22 May 2025 13:04:51 +0000 Received: from relay2-d.mail.gandi.net ([217.70.183.194]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uI5bM-000LRk-0b for pgsql-hackers@postgresql.org; Thu, 22 May 2025 13:04:50 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id CB69F430B7; Thu, 22 May 2025 13:04:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vondra.me; s=gm1; t=1747919087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iRKe3p0AlQ07wQP9NY7gmtzoiHaIO4S/zc1qqFqMOS4=; b=e7FcIESI6n1rIFb/UsxFJzjLcOpBnyZkCVGcIP7TBjADkX7hJDeytxwzV+g0lhQaLs7YIE yWhWy2XQnooojqNDOD8Ejk8Jl2km4Z1ybWkWC/+i/qNI1eSjIEj5n2MecTeJTfWRWt5UVN akk+qqshlpk0V8bLSKYJGFWDmFCtzF5D+OZFD2PZxAsNeixUtonzvcpFT7sCWz1iichNoS +xMXluOXF03EPGFx9qf7ZlsnhELW1T5R3anoSAeW+bMMT2n6qf6zhuR/ozG+5SfZzWe2gJ NqUPZOTSqlCk6+FsyA+DQ6yuRAWG99VWFXpo3srbztIH5eyxAFw6ChxyDppZhg== Message-ID: Date: Thu, 22 May 2025 15:04:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: generic plans and "initial" pruning To: Amit Langote , Tom Lane Cc: Tender Wang , Alexander Lakhin , Robert Haas , Alvaro Herrera , Andres Freund , Daniel Gustafsson , David Rowley , PostgreSQL Hackers , Thom Brown References: <605328.1747710381@sss.pgh.pa.us> <691261.1747755511@sss.pgh.pa.us> Content-Language: en-US From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddtgdeitdefucdltddurdegfedvrddttddmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttddvjeenucfhrhhomhepvfhomhgrshcugghonhgurhgruceothhomhgrshesvhhonhgurhgrrdhmvgeqnecuggftrfgrthhtvghrnhepuedvvdeifefffeekudeggfdtieeglefggeduheffveeihefggfehgfdvudetffevnecukfhppeekiedrgeelrddvfedtrddvtdeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepkeeirdegledrvdeftddrvddtiedphhgvlhhopegluddtrddufeejrddtrddvngdpmhgrihhlfhhrohhmpehtohhmrghssehvohhnughrrgdrmhgvpdhnsggprhgtphhtthhopeduuddprhgtphhtthhopegrmhhithhlrghnghhothgvtdelsehgmhgrihhlrdgtohhmpdhrtghpthhtohepthhglhesshhsshdrphhghhdrphgrrdhushdprhgtphhtthhopehtnhgurhifrghnghesghhmrghilhdrtghomhdprhgtphhtthhopegvgigtlhhushhiohhnsehgmhgrihhlrdgtohhmpdhrtghpthhtoheprhhosggvrhhtmhhhrggrshesghhmrghilhdrtghomhdprhgtphhtthhopegrlhhvhhgvrhhrvgesrghlv hhhrdhnohdqihhprdhorhhgpdhrtghpthhtoheprghnughrvghssegrnhgrrhgriigvlhdruggvpdhrtghpthhtohepuggrnhhivghlseihvghsqhhlrdhsvg X-GND-Sasl: tomas@vondra.me List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 5/22/25 10:12, Amit Langote wrote: > On Wed, May 21, 2025 at 7:22 PM Amit Langote wrote: >> Fair enough. I’ll revert this and some related changes shortly. WIP >> patch attached. > > I have pushed out the revert now. > Thank you. > Note that I’ve only reverted the changes related to deferring locks on > prunable partitions. I’m planning to leave the preparatory commits > leading up to that one in place unless anyone objects. For reference, > here they are in chronological order (the last 3 are bug fixes): > > bb3ec16e14d Move PartitionPruneInfo out of plan nodes into PlannedStmt > d47cbf474ec Perform runtime initial pruning outside ExecInitNode() > cbc127917e0 Track unpruned relids to avoid processing pruned relations > 75dfde13639 Fix an oversight in cbc127917 to handle MERGE correctly > cbb9086c9ef Fix bug in cbc127917 to handle nested Append correctly > 28317de723b Ensure first ModifyTable rel initialized if all are pruned > > I think separating initial pruning from plan node initialization is > still worthwhile on its own, as evidenced by the improvements in > cbc127917e. > I'm OK with that in principle, assuming the benefits outweigh the risk of making backpatching harder. The patches don't seem exceptionally large / invasive, but I don't know how often we modify these parts. regards -- Tomas Vondra