Re: On disable_cost
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
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-07T15:08:49Z
Lists: pgsql-hackers
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. Because I couldn't make up my mind what to do and didn't get clear feedback from anybody else, I did nothing. The thing is, if somebody says enable_mergejoin=false, presumably they REALLY, REALLY don't want a merge join. If we start using that same mechanism for other purposes -- like making sure that a hash join doesn't overrun work_mem -- then the user might get a merge join anyway because we've represented a hash join that is big, but not disabled, in the same way that we represent as merge join that is actually disabled. I'm pretty uncomfortable with that. Sure, the user probably doesn't want us to overrun work_mem either, but when push comes to shove, shouldn't a very explicit user instruction like "don't use a merge join, l don't want that!" take precedence over any sort of planner estimate? Estimates can be wrong, and the user is in charge. -- Robert Haas EDB: http://www.enterprisedb.com
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