Robert Haas <robertmhaas@gmail.com> writes:
> On Sat, Oct 5, 2024 at 3:35 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> BTW, getting off the question of EXPLAIN output for a moment,
>> I don't understand why disable_cost is still a thing. The
>> one remaining usage seems trivial to replace, as attached.
> I believe I commented on that somewhere upthread, but maybe I meant to
> and didn't or maybe you didn't see it in the flurry of emails.
> Basically, I wasn't confident that it made sense to treat this as the
> same kind of thing as other cases where we increment disabled_nodes.
I don't buy your argument that this case is so special that it
warrants preserving disable_cost. I certainly didn't think it
was special when I added it.
There may be another way to do this that doesn't rely on disabling
the path in the same way as the user-accessible knobs do, but
I don't really believe it's worth the trouble to think of one.
And I definitely don't want to keep disable_cost around even for
just one usage, because then we've not fixed the user-experience
aspect of this (that is, "why does this plan have a ridiculously high
cost?"), nor have we fixed all the concerns you had about higher-level
planning decisions being skewed by that cost.
One other point here is that if disable_cost remains exposed as a
global variable (as it is in HEAD), there is no reason to expect
that any extensions that are using it will get on board with the
new approach.
regards, tom lane