public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andrei Lepikhov <[email protected]>
To: Lukas Fittl <[email protected]>
Cc: pgsql-bugs <[email protected]>
Cc: Robert Haas <[email protected]>
Subject: Re: pg_plan_advice fails when NestLoop outer side is Sort over FunctionScan
Date: Sat, 4 Apr 2026 22:56:42 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAP53Pkw2Lw0bavkCR-ygmaGACBjwmY3Voq0Yhwo9rVOBWxQuyw@mail.gmail.com>
References: <[email protected]>
	<CAP53Pkw2Lw0bavkCR-ygmaGACBjwmY3Voq0Yhwo9rVOBWxQuyw@mail.gmail.com>

On 4/4/26 20:52, Lukas Fittl wrote:
> Hi Andrei,
> it seems to me this is caused by the join analysis tree walker in
> pgpa_join.c / pgpa_decompose_join being a bit too specific to what the
> core planner will produce, i.e. it only assumes Merge Joins will have
> Sort nodes directly underneath them.

My initial concern was about the design of the pg_plan_advice extension 
in general. It seems flawed if it must follow the core plan-building 
logic. Explore pg_hint_plan - their general concept is just to increase 
the probability of a template subtree to maximum, not to assume that 
some constructions are possible or not.

> Btw, is your extension available somewhere? That could help verify
> that the extension also works as expected with the fix.
This is the stage of core patch development. If the community rejects 
the feature, I will convert it into an extension module (on request). - 
It is too expensive to support each optimisation when you do it 'just 
for fun'.

-- 
regards, Andrei Lepikhov,
pgEdge






reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: pg_plan_advice fails when NestLoop outer side is Sort over FunctionScan
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox