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 1vTRlA-001s6i-0g for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Dec 2025 21:30:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vTRl8-0014uI-3A for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Dec 2025 21:30:07 +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 1vTRl8-0014uA-2F for pgsql-hackers@lists.postgresql.org; Wed, 10 Dec 2025 21:30:07 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vTRl6-0002qE-2G for pgsql-hackers@lists.postgresql.org; Wed, 10 Dec 2025 21:30:07 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-b79d0a0537bso31599266b.2 for ; Wed, 10 Dec 2025 13:30:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765402203; x=1766007003; 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=MRFknVfsgPDDTgGNGFKKM2zVpU3PHRibDAcdqGiaDlo=; b=dDFe1FAtttm68R8uneth+aNxkbiS+3BEW25mZoWZjh3d7ocvndpSHw/Zg5hL8fYMdW QyZ+vCvg6/yj1/kuEYxIZ/tiXp/7bU7GiDm7e4Sz9WKHrYLOURJ/uKHR8AdUj/ZoHuGn j+z8L6ynr7orYNiouIBOW5FYrRWKd7kUzH7YFLPRLqvcCRADPLLDh3+DsqoPVpPUUNKr VHAYlk/lB540tRl94Y2zH3T4Fc9WtA2LsgNHUZKDnKjZQ2FvJBqalDyMXnWBuL+XXVKb ITNbL+vAh+gDh3qVxZQgj9c4YVvhfrOHlQjTGLHXM8NYvf4gXvykSLozqAMAHL84R3ek rtJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765402203; x=1766007003; 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=MRFknVfsgPDDTgGNGFKKM2zVpU3PHRibDAcdqGiaDlo=; b=GiZP25+WlYZ4vfQM3wLyz48fNu40yNNZyXR5o5Kyhy506sDEtTx/sVYDdPYpveORex r5XATSFYT6pBXGpuae85elgC4itsLe1OmATW3zKSovvg8rtMo8/924BBLhF4pVn0veeJ L/aMxbWny3OHc53sQkL723evpMzLVWRs7WJFOoZFu0tXtRQRIX+fcTVl0QUmOh9RS4CP n3PWGH1pX7FvFnJeq9UodKqN8G50cWvIOZAo6Cif45eLxxOmFaLI4cUolJOrZv2eu1C7 46XACvvBS4eZvkl/exkcPuaXR9FKf6cPMLCCSgzDjAFH+nMQOaoYUoG6kJ2yc4rSoG8Q wesQ== X-Forwarded-Encrypted: i=1; AJvYcCVq4cPSLjkKDST1WgzmgqWt7CFxKNzoDhurwcnYUliAVLEB2P6zabS6/dcxcKqv3xt920yLQJ/iI4S9IQpA@lists.postgresql.org X-Gm-Message-State: AOJu0Yx/hulndxZjl8jbDg82KMtT/azaiAfPbFu0ODNyZGChmvP5MMZn Qw6F5kLsHX30sZV1MxXDDeod48WgEpa7su+KLSBelQWFANkMyAjBNIWAVYAXSyYWHnaVwfIj5l5 xRRx8IbbzvbpqJUTE+BOTFUTHB50dv24= X-Gm-Gg: ASbGncuCQ3NE9WId7OgCFJaJIm3aHrnumz0M3yIfNOS/Poy9/7IqWmfudcosV6fJCrl Sn0ZNNr5vKVleA+whSnEyTlrl5zYkogaIrzAGHEw1O7gOiEj9M5eqImt5+oXLBKLarkiwhKYumy B5adSYvMGc3p0GLpp8HkayCXOMRHc0uouVH1MvKF6yVklcWv/BXUzUvk00CQpPQCfUtYkJ59Rmc 3VXLX6hBEn+zEg53BYvLKZlbnxVv2nF1jq4lyQ8D+A/5LNPxsp4nY73gbRxmotUwIKcrMT70ZJO N4UhBBIIJ/L7Ln9Q4xw9KJ1eyHo= X-Google-Smtp-Source: AGHT+IHVOdYRDKJVFJVGGrdYremxlBJDEGZh6Gte8VXX/En0t1BS1WM9oCFL8MflfqkdPTAPf/aApF0IdleQqVF6BTo= X-Received: by 2002:a17:907:7e97:b0:b76:4c16:6afa with SMTP id a640c23a62f3a-b7ce83225d4mr416296266b.28.1765402203293; Wed, 10 Dec 2025 13:30:03 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Robert Haas Date: Wed, 10 Dec 2025 16:29:50 -0500 X-Gm-Features: AQt7F2qnsuLTcd2F6fTDJBwJRSCQR21WHpmZz5d8o-6sPEiawHs-X-RMfcxWldE Message-ID: Subject: Re: pg_plan_advice To: Corey Huinker Cc: Amit Langote , PostgreSQL Hackers 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, Dec 10, 2025 at 4:09=E2=80=AFPM Corey Huinker wrote: > I think the change would be worth the destabilization, because it makes i= t so much easier to talk about complex query plans. Additionally, it would = make it reasonable to programmatically extract portions of a plan, allowing= for much more fine-grained regression tests regarding plans. I'll wait for more votes before thinking about doing anything about this, because I have my doubts about whether the consensus will actually go in favor of such a large change. Or maybe someone else would like to try mocking it up (even if somewhat imperfectly) so we can all see just how large an impact it makes. >> > On the infrastructure patches (0001-0005): these look sensible. The >> > range table flattening info, elided node tracking, and append node > > One thing I am curious about is that by tracking the elided nodes, would = it make more sense in the long run to have the initial post-naming plan tre= e be immutable, and generate a separate copy minus the elided parts? Probably not. Having two entire copies of the plan tree would be pretty expensive. I think that we've bet on the right idea, namely, that the primary consumer of plan trees should be the executor, and the primary goal should be to create plan trees that make the executor run fast. I believe the right approach is basically what we do today: you're allowed to put things into the plan that aren't technically necessary for execution, if they're useful for instrumentation and observability purposes and they don't add an unreasonable amount of overhead. These patches basically just extend that existing principle to a few new things. --=20 Robert Haas EDB: http://www.enterprisedb.com