Re: On disable_cost
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Alena Rybakina <a.rybakina@postgrespro.ru>,
David Rowley <dgrowleyml@gmail.com>,
Laurenz Albe <laurenz.albe@cybertec.at>,
Heikki Linnakangas <hlinnaka@iki.fi>, Peter Geoghegan <pg@bowt.ie>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-10-07T22:41:42Z
Lists: pgsql-hackers
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
Commits
-
Doc: add detail about EXPLAIN's "Disabled" property
- 84b8fccbe5c2 18.0 landed
-
Adjust EXPLAIN's output for disabled nodes
- 161320b4b960 18.0 landed
-
Fix order of parameters in a cost_sort call
- 87b6c3c0b703 18.0 landed
-
Show number of disabled nodes in EXPLAIN ANALYZE output.
- c01743aa4866 18.0 landed
-
Treat number of disabled nodes in a path as a separate cost metric.
- e22253467942 18.0 landed
-
Remove grotty use of disable_cost for TID scan plans.
- e4326fbc60c4 18.0 landed