Re: pg_plan_advice - Mailing list pgsql-hackers

From Robert Haas
Subject Re: pg_plan_advice
Date
Msg-id CA+TgmoaZtZQ7o_e7XP=8TDuqaF-c7tHE0bFT3Hsqu7+RAA_Hug@mail.gmail.com
Whole thread Raw
In response to Re: pg_plan_advice  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Thu, Mar 19, 2026 at 4:38 PM Robert Haas <robertmhaas@gmail.com> wrote:
> skink has a failure that looks like this:
>
> +WARNING:  supplied plan advice was not enforced
> +DETAIL:  advice NESTED_LOOP_MEMOIZE(nt) feedback is "matched, failed"
>
> I think this is caused by a minor bug in the pgs_mask infrastructure.
> get_memoize_path() exits quickly when outer_path->parent->rows < 2, on
> the theory that the resulting path must lose on cost. But that
> presumes that we could do a plain nested loop instead, i.e. that
> PGS_NESTLOOP_PLAIN is set. And it might not be. Before the pgs_mask
> stuff, that case couldn't happen: enable_nestloop=off disabled all
> nested loops, and enable_memoize=off disabled only the memoized
> version, but there wasn't any way to disable only the non-memoized
> version (which, of course, was part of the point of the whole thing).
> I think the fix is as attached.

The new test in that version was exactly backwards. I have corrected
that issue and committed this.

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Cliff Clark
Date:
Subject: [PATCH] Auto vacuum should still run when clock is set back
Next
From: Nathan Bossart
Date:
Subject: Re: [PATCH] Fix wrong argument to SOFT_ERROR_OCCURRED in timestamptz_date