Re: On disable_cost

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Peter Geoghegan <pg(at)bowt(dot)ie>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: On disable_cost
Date: 2024-08-02 13:13:36
Message-ID: CAApHDvriW5ra-ACRoesr5U4Xq5uoQ7RMPupLpLZ9aD+Cjp-KVg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 3 Aug 2024 at 00:17, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
> On Thu, Aug 1, 2024 at 11:34 PM David Rowley <dgrowleyml(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-08-02 13:37:26 Re: pg_combinebackup does not detect missing files
Previous Message Nisha Moond 2024-08-02 12:58:13 Re: Conflict detection and logging in logical replication