Re: pg_plan_advice (now with transparent SQL plan performance overrides - pg_stash_advice) - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: pg_plan_advice (now with transparent SQL plan performance overrides - pg_stash_advice)
Date
Msg-id CAKFQuwaA09Kxfbv2tgh-SaaCXLD5+grYj3F9RNGQhTHsXz9ENw@mail.gmail.com
Whole thread Raw
In response to Re: pg_plan_advice (now with transparent SQL plan performance overrides - pg_stash_advice)  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: pg_plan_advice (now with transparent SQL plan performance overrides - pg_stash_advice)
List pgsql-hackers
On Tuesday, March 3, 2026, Robert Haas <robertmhaas@gmail.com> wrote:

>
> SEQ_SCAN(t1@minmax_1) /* matched, failed */

Because there's not a way to control aggregation behavior at present,
you can't directly conrol whether t1 or t1@minmax_1 appears in the
winning plan.

Ok, that’s what I was missing here, it saw the subplan in its options but the winning plan didn’t include it.  So “matched/failed” may produce a plan where the target having been matched isn’t actually visible to the user.

Maybe add a note like this to pg_plan_advice:

Generated advice is produced to a high level of specificity without knowing what limitations the advice interpreter has in applying that advice.  Therefore, generated advice targets may later fail for no other reason than cost-based decisions resulted in the originally chosen plan to no longer be chosen.  The planner will still likely see the original target on a now losing plan and thus the advice feedback will report matched even when the winning plan does not include the specific target.

David J.

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: change default default_toast_compression to lz4?
Next
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: [PATCH] Support automatic sequence replication