Re: On disable_cost - Mailing list pgsql-hackers

From David Rowley
Subject Re: On disable_cost
Date
Msg-id CAApHDvriW5ra-ACRoesr5U4Xq5uoQ7RMPupLpLZ9aD+Cjp-KVg@mail.gmail.com
Whole thread Raw
In response to Re: On disable_cost  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: On disable_cost
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Nisha Moond
Date:
Subject: Re: Conflict detection and logging in logical replication
Next
From: Robert Haas
Date:
Subject: Re: pg_combinebackup does not detect missing files