Re: On disable_cost
Laurenz Albe <laurenz.albe@cybertec.at>
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: David Rowley <dgrowleyml@gmail.com>, Heikki Linnakangas
<hlinnaka@iki.fi>, Peter Geoghegan <pg@bowt.ie>, PostgreSQL Hackers
<pgsql-hackers@lists.postgresql.org>
Date: 2024-09-27T08:42:32Z
Lists: pgsql-hackers
On Wed, 2024-08-21 at 10:29 -0400, Robert Haas wrote:
> I went ahead and committed these patches. I know there's some debate
> over whether we want to show the # of disabled nodes and if so whether
> it should be controlled by COSTS, and I suspect I haven't completely
> allayed David's concerns about the initial_cost_XXX functions although
> I think that I did the right thing. But, I don't have the impression
> that anyone is desperately opposed to the basic concept, so I think it
> makes sense to put these into the tree and see what happens. We have
> quite a bit of time left in this release cycle to uncover bugs, hear
> from users or other developers, etc. about what problems there may be
> with this. If we end up deciding to reverse course or need to fix a
> bunch of stuff, so be it, but let's see what the feedback is.
I am somewhat unhappy about the "Disabled Nodes" in EXPLAIN.
First, the commit message confused me: it claims that the information
is displayed with EXPLAIN ANALYZE, but it's shown with every EXPLAIN.
But that's not important. My complaints are:
1. The "disabled nodes" are always displayed.
I'd be happier if it were only shown for COSTS ON, but I think it
would be best if they were only shown with VERBOSE ON.
After all, the messages are pretty verbose...
2. The "disabled nodes" are not only shown at the nodes where nodes
were actually disabled, but also at every nodes above these nodes.
This would be fine:
Sort
-> Nested Loop Join
-> Hash Join
-> Index Scan
Disabled Nodes: 1
-> Hash
-> Index Scan
Disabled Nodes: 1
-> Index Scan
Disabled Nodes: 1
This is annoying:
Sort
Disabled Nodes: 3
-> Nested Loop Join
Disabled Nodes: 3
-> Hash Join
Disabled Nodes: 2
-> Index Scan
Disabled Nodes: 1
-> Hash
-> Index Scan
Disabled Nodes: 1
-> Index Scan
Disabled Nodes: 1
I have no idea how #2 could be implemented, but it would be nice to have.
Please, please, can we show the "disabled nodes" only with VERBOSE?
Yours,
Laurenz Albe
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