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 1uI12l-00EAmy-2S for pgsql-hackers@arkaria.postgresql.org; Thu, 22 May 2025 08:12:47 +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 1uI12j-00GcC3-Qz for pgsql-hackers@arkaria.postgresql.org; Thu, 22 May 2025 08:12:45 +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 1uI12j-00GcBv-DV for pgsql-hackers@lists.postgresql.org; Thu, 22 May 2025 08:12:45 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uI12g-000JBX-0m for pgsql-hackers@postgresql.org; Thu, 22 May 2025 08:12:44 +0000 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-30e8a968b15so5387237a91.3 for ; Thu, 22 May 2025 01:12:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747901560; x=1748506360; darn=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=IIq6LBDO6h76y/lirNeh0Tju024XUZx+y3AlGU74Wak=; b=TVyhORODdVhG0/j7whfLCDmnZccycx5nAje29q/k4lu2PFajZHIBqHHqWRLQ5aIZNN mNXXLXoMHF6RzZqAzdlxyw0aPOjb4Jy3H7BVfV45V7CsShihdV5v1phz8kslq6VoHFJK izzkraK0yJI9zCA9ByEV0ErFftfhNmk46Vd5hP1noXlSA69+CriyflMseaXRIqJ6/0AD ii3oA6OfuRLUuZ3xbrJ0s4cYFD7LnSLvqZWz7FYV8XKYBZ8Q3MO+kqXIrI8XgSBe4jKq cl/mPkAurSDwcyQkDX2mfX2HcAtvvS/FRHTZgkQcXfqMW01JO9Tzx6sPIrIHiTwobNW7 /xYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747901560; x=1748506360; 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=IIq6LBDO6h76y/lirNeh0Tju024XUZx+y3AlGU74Wak=; b=dzu2VeTfil46mo95GyRs0DqRay5BqMf0t8fOOsSZnhqG5B57NgThYzahJ807Q3qiPs 2jBXDvGpJhuQSUVPA5hIbnAVUv8L/ImPe/uAdVrLum50RRdkW29rvj2/2VKhEmkZdy6c 0Jq1CmKIQY+/e93pbcHxfG3/ocxV/FPBD3fwWg8LrVrIry9DzmGrERuhOiL+/zlVA4q+ b43qkfuFjDx6TRAtBqMDh8ir5a16bauCKEaKK1EJHz4GCfxkFfO80giVtgM85XMgnZFy YMh6uIVWzKEVPPYaJWtPxyFhm/FhN/4ksHrpYJfHoxbA6Abauxcu4GAdtHnrianKv7iQ 2h6Q== X-Forwarded-Encrypted: i=1; AJvYcCVmQZXmMqJgE6QHKEJm39iJ8RUuWxDfgdBUPxrlmA3weZKrYJZLOZ/A/1AOgvrXAcawoqcUwOkmIHQf+ds1@postgresql.org X-Gm-Message-State: AOJu0YxphcTvcBy1cjEJ4HnXA/AiFcp+nyR8xlgDV0CRVneyw2teT+AA 6VEg6J0UIWgNNZJY65rz3z7NVM4PY18p2fQBv6Ncc+eXY1Yt3lTAWswsV5J/QlDT3gHobnmmtL0 Z/AwmZiiMQkk3TUsHp9m7cI+TpRN7qEo= X-Gm-Gg: ASbGncszlxtY0YNshgJRNAFYkGb61O7liueWMk1GARRQJS9cqK2Na49lFdjNaXXVZcj e+E5eEnPrfR2Ms3kLvQ/Mfc4S3fazc2zkqRnWdAXzqrgPx41MgZ+SnVgENGSisZfJHt79jgLvEH XvlRqVvLUmGJ+AjXnt3jPhuLNL50nF9dIzf6dUPlqgSU+5 X-Google-Smtp-Source: AGHT+IHSOIk+d0iXeKMDF1o7VbWMTlj0wWbsWaaHbARPF4Asn+yhGyP42ZWfYT42YFDrGbUaY4ZYFv2A8qnmx+yM5LM= X-Received: by 2002:a17:90b:5410:b0:30e:823f:ef22 with SMTP id 98e67ed59e1d1-30e83215898mr35010999a91.24.1747901560443; Thu, 22 May 2025 01:12:40 -0700 (PDT) MIME-Version: 1.0 References: <54c35fb9-da3a-4754-ab8c-46ed0b612465@vondra.me> <684c70d7-180e-461d-9377-600c2db581ba@vondra.me> <605328.1747710381@sss.pgh.pa.us> <691261.1747755511@sss.pgh.pa.us> In-Reply-To: From: Amit Langote Date: Thu, 22 May 2025 17:12:24 +0900 X-Gm-Features: AX0GCFtxjUHbyqC7hkh-OYUMrPe99M_jYZ5p1x8xHzpK2c6ehNcg8tS70UFPQCw Message-ID: Subject: Re: generic plans and "initial" pruning To: Tom Lane Cc: Tender Wang , Alexander Lakhin , Tomas Vondra , Robert Haas , Alvaro Herrera , Andres Freund , Daniel Gustafsson , David Rowley , PostgreSQL Hackers , Thom Brown 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, May 21, 2025 at 7:22=E2=80=AFPM Amit Langote wrote: > Fair enough. I=E2=80=99ll revert this and some related changes shortly. = WIP > patch attached. I have pushed out the revert now. Note that I=E2=80=99ve only reverted the changes related to deferring locks= on prunable partitions. I=E2=80=99m 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. --=20 Thanks, Amit Langote