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 1w99r6-001E8w-1r for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Apr 2026 22:52:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w99r4-000gXw-36 for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Apr 2026 22:52:39 +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 1w99r4-000gXo-2B for pgsql-hackers@lists.postgresql.org; Sat, 04 Apr 2026 22:52:39 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w99r2-00000000dSI-0nzz for pgsql-hackers@lists.postgresql.org; Sat, 04 Apr 2026 22:52:38 +0000 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-65c0891f4e9so1094700a12.1 for ; Sat, 04 Apr 2026 15:52:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775343155; cv=none; d=google.com; s=arc-20240605; b=dGbsV5jn4h8hz2MWI5kLdihZ3uEX8WcbLKzLH3Ylh0ojMvgWbOsIybtbce394wi6kt VAuzLboN1yuu/CRZu/sZ4io+3kIQz2oLB4hDbZNUNCGL6OPNnjaCsCVq/JTstvEQpFQQ XjBzNJx/iLtN3g9l3FeDS1XN2JvlAsAhKaU+WLbNIXO9xVTGhYuS/NIFW1Mpz0HPKkrr vDGw+8qf0BBuPPdts/8LYFv142StMctSej82WyIhWNWfMYqnEtaPGfr+/+6NENQ8cvDQ pBhMm0TBQGx0ACxvK51yaVATRtQAlTXsOBjEXggA5L48ZtaGnbq9dd2BtQfd4VN+eEsN F0jw== 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=sgLSznV2hRJzL/RzZcAVWoojXdFmEH1qnCaNV8ukDhI=; fh=K/LhtLHF7Ha+Wms6bQq+E9O3bG01W9Yb9nUMmeZi2hs=; b=aWKSP3R9+HqzDmZhhvFWKYM785hUnIlxzjXEr64axSiaAf7Yuu76lSjSKN8R8MzQuN 0KcyPk31qWlcJIl2sgRObmphhsVpmCvgnEo8SeYWIyoLJ09GIztUOchY3TgQkrSC1Sge oYJohkPXsI6avhJ901XgfS83l83O1pgnGCfr9FEc9hNPKOpcB8AY3k203/oPRBdCXEJ5 UKXW6gFXthQ1hDxKUWEj2A6wsa9LTdISC6XCKe3rmMqlmZeGyN0CW1ufHLbk0weIbuoA DJJHn8H40aZFr46gB8F+zyxgQw2EYPCF9Rn0ZBdAHYbzVSk3XHKlbxqTlGGGaYvnl3d0 B97A==; 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=20251104; t=1775343155; x=1775947955; 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=sgLSznV2hRJzL/RzZcAVWoojXdFmEH1qnCaNV8ukDhI=; b=nk17fF/C0xf9deMHxH62VvAiUenXPkxBDBQ6nAmGfCL0eQEaGScMyVL8FoDwLYYwK+ JgoTSV7ToQMs5dhRFQ/rPFu9tUWx51mHOHufUtNIDJmyTc977TAynkNnR1V09ynACcHA FIObU7B66MQrqAYDfZe6AWpwRB4Nu7JsGi86VJyFHZ6PEOn/M2p/WUKrlgdmRCOwUAKa aCsCSx2hEqvQzvlBjGrMfYui3D4NmOcYXEsFGrNIBelWzqyPrPyc2+WObciys1SE7ws9 8Qx1aJ+UGfUg3JPPH4RIYZKlobudoC8IgI8T7mNDAe55MnI0AU3Qm0oOR24dDf7iDIeR rFxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775343155; x=1775947955; 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=sgLSznV2hRJzL/RzZcAVWoojXdFmEH1qnCaNV8ukDhI=; b=q2wo7128mE419rrvVwPlRuOfJLCTwt2xKu8nseYjfZcyFemAsrlEKYMiv+shfcUSkq BHAIUByTfuev9Qm0U4vJ1gSfBoElmTP5GQzr3wukkfOfVL56kBhX4UOBZ1YySayIYtXr KfEB0Dr8sIuftiXtIXrHKUl8MXgzcUbE3x2fben9YG5N8biS1HIhac6nzZYsxaDZ4QOy GR4HJsIXf7Wfl42T+0egKJGbcgxSwO0GhaS42H0SuG4j8gS+qyyA3O0vDxFy+2RVtrGD B0DdMtZ5FO/ZQquiZKfPmdDEDUXmt0TdG2H9rgnlD6SEYm020wAcrr183CUlrDBW53qj kIKA== X-Forwarded-Encrypted: i=1; AJvYcCUvvQSwyTZIZPaMW4X8NMwGax4tyibAi37KIURf2BIZFcoxf9zc+skXArS9kJkATxWv4eeoEUKb5gOBfDMx@lists.postgresql.org X-Gm-Message-State: AOJu0YyesS2exBYrv1DXcNmUYLkJV1IC66ZoSzoZhD70YS5xRhrow2n5 D8FjcldFO9aZx+Tn6abeVDBog5LgiEorMW69IE9AE+t/ckJyZz8ei3h6YUpE1bLNJuK9bWRdsac +d4okjOZ1bkU+ZVedXJ0Z0BMxX5tbvY8= X-Gm-Gg: AeBDietkICulLgIi+dncKr1KJSWD9Cy+uOmpq2/EKuFeLAjBwIN+6qqz9n7lr/JQOXR g9FWNSNDbDjm4WtkwNHz0n5urZLTY/oKljoVj3Yjv2QGDc8kBm+rFuFUTguWrm9SSNCVUPHobwV atjFe0QZ709tiZtSgtZl19LrGLTSUre5+Gg1WiTUgO0QTxcO9UDDiT3cWKAaGdkFoJIkx83d5/h EDir+RV5bB5IxSxbxDWw/m2YuOUPrMn97U3e7BuPWpZfvRki/UK6IGeRIImakaMB1JaGd9+/71Y Kp2qMUr+vLjWqLbFhUr/UQDnaGyCJfCUmN/7Zeg= X-Received: by 2002:a17:907:1b08:b0:b9b:452f:fd9 with SMTP id a640c23a62f3a-b9c676c8416mr405713866b.22.1775343154825; Sat, 04 Apr 2026 15:52:34 -0700 (PDT) MIME-Version: 1.0 References: <3683430.1775173413@sss.pgh.pa.us> <3817825.1775240432@sss.pgh.pa.us> <3877210.1775272486@sss.pgh.pa.us> <386d8c06-0f96-40bb-b1b1-107db209c676@gmail.com> <2e7bdb5d-68ba-4c65-9931-a865ab6fc3d2@gmail.com> In-Reply-To: <2e7bdb5d-68ba-4c65-9931-a865ab6fc3d2@gmail.com> From: Robert Haas Date: Sat, 4 Apr 2026 18:52:21 -0400 X-Gm-Features: AQROBzDzMOmiySttNxP902xAihfOt1Nq8jnGLnRQDjqfKJuFR5GtpJjSt48DmGk Message-ID: Subject: Re: pg_plan_advice To: Andrei Lepikhov Cc: Tom Lane , Alexander Lakhin , Lukas Fittl , 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 Sat, Apr 4, 2026 at 5:02=E2=80=AFPM Andrei Lepikhov = wrote: > That=E2=80=99s exactly what concerns me. I see it as a potential design f= law if > the extension has to make assumptions about possible plan configurations. > I=E2=80=99m not sure how it works in detail, of course. However, when I d= esigned > Postgres replanning in the past, and made similar core changes to what > you=E2=80=99ve done for pg_plan_advice, this kind of problem couldn=E2=80= =99t have > happened. So, I think it=E2=80=99s worth questioning the current approach= and > looking for other options. I mean, any plan stability feature is intrinsically tied to a particular planner. Nobody thinks you can use Aurora Postgres's Query Plan Management feature with MySQL or DB2 or Oracle. Those products obviously have to have their own features for plan stability. The same is true here. There's more overlap because you're creating the plan out of the same basic building blocks rather than an entirely different set of things, but if you assemble them in a way that PostgreSQL doesn't, then some things may not work. pg_plan_advice is one of those things; the executor is another. Of course, I don't think anybody here is keen to break stuff for no good reason, which is why I will take a look at the report you posted. But fundamentally, it's the same issue. If somebody uses a plugin that replaces large parts of the plan with a CustomScan, pg_plan_advice isn't going to work with that, either: how could it possibly? Maybe there could be some way to make pg_plan_advice pluggable so that if extensions fiddle with the planner they can also do matching fiddling with pg_plan_advice if they're so inclined, but having it "just work" would require magic. --=20 Robert Haas EDB: http://www.enterprisedb.com