On Sat, 3 Aug 2024 at 00:17, Robert Haas <robertmhaas@gmail.com> wrote:
>
> On Thu, Aug 1, 2024 at 11:34 PM David Rowley <dgrowleyml@gmail.com> wrote:
> > I'm not planning on pushing this any further. I've just tried to
> > highlight that there's the possibility of a behavioural change. You're
> > claiming there isn't one. I claim there is.
>
> I don't know what to tell you. The original version of the patch
> didn't change this stuff, and the result did not work. So I looked
> into the problem and fixed it. I may have done that wrongly, or there
> may be debatable points, but it seems like your argument is
> essentially that I shouldn't have done any of this and I should just
> take it all back out, and I know that doesn't work because it's the
> first thing I tried.
I've just read what you wrote again and I now realise something I didn't before.
I now think neither of us got it right. I now think what you'd need to
do to be aligned to the current behaviour is have
initial_cost_nestloop() add the disabled_nodes for the join's subnodes
*only* and have final_cost_nestloop() add the additional
disabled_nodes if enable_nestloop = off. That way you maintain the
existing behaviour of not optimising for disabled node types and don't
risk plan changes if the final cost comes out cheaper than the initial
cost.
David