Re: On disable_cost
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Heikki Linnakangas <hlinnaka@iki.fi>, Peter Geoghegan <pg@bowt.ie>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-09-27T12:04:20Z
Lists: pgsql-hackers
Attachments
- poc_improve_disabled_nodes_explain_output.patch (application/octet-stream) patch
On Fri, 27 Sept 2024 at 20:42, Laurenz Albe <laurenz.albe@cybertec.at> wrote: > 2. The "disabled nodes" are not only shown at the nodes where nodes > were actually disabled, but also at every nodes above these nodes. I'm also not a fan either and I'd like to see this output improved. It seems like it's easy enough to implement some logic to detect when a given node is disabled just by checking if the disable_nodes count is higher than the sum of the disabled_node field of the node's children. If there are no children (a scan node) and disabed_nodes > 0 then it must be disabled. There's even a nice fast path where we don't need to check the children if disabled_nodes == 0. Here's a POC grade patch of how I'd rather see it looking. I opted to have a boolean field as I didn't see any need for an integer count. I also changed things around so we always display the boolean property in non-text EXPLAIN. Normally, we don't mind being more verbose there. I also fixed a bug in make_sort() where disabled_nodes isn't being set properly. I'll do an independent patch for that if this goes nowhere. David
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