summaryrefslogtreecommitdiff
path: root/src/test/regress/expected/aggregates.out
diff options
context:
space:
mode:
authorDavid Rowley2024-10-11 04:19:59 +0000
committerDavid Rowley2024-10-11 04:19:59 +0000
commit161320b4b960ee4fe918959be6529ae9b106ea5a (patch)
tree35fceff1c373c3e505d2d1180429fb1571e8bb73 /src/test/regress/expected/aggregates.out
parentc75c6f8d280a3364643fc51f9c9fdf2dee0213c2 (diff)
Adjust EXPLAIN's output for disabled nodes
c01743aa4 added EXPLAIN output to display the plan node's disabled_node count whenever that count is above 0. Seemingly, there weren't many people who liked that output as each parent of a disabled node would also have a "Disabled Nodes" output due to the way disabled_nodes is accumulated towards the root plan node. It was often hard and sometimes impossible to figure out which nodes were disabled from looking at EXPLAIN. You might think it would be possible to manually add up the numbers from the "Disabled Nodes" output of a given node's children to figure out if that node has a higher disabled_nodes count than its children, but that wouldn't have worked for Append and Merge Append nodes if some disabled child nodes were run-time pruned during init plan. Those children are not displayed in EXPLAIN. Here we attempt to improve this output by only showing "Disabled: true" against only the nodes which are explicitly disabled themselves. That seems to be the output that's desired by the most people who voiced their opinion. This is done by summing up the disabled_nodes of the given node's children and checking if that number is less than the disabled_nodes of the current node. This commit also fixes a bug in make_sort() which was neglecting to set the Sort's disabled_nodes field. This should have copied what was done in cost_sort(), but it hadn't been updated. With the new output, the choice to not maintain that field properly was clearly wrong as the disabled-ness of the node was attributed to the Sort's parent instead. Reviewed-by: Laurenz Albe, Alena Rybakina Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/test/regress/expected/aggregates.out')
-rw-r--r--src/test/regress/expected/aggregates.out27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/test/regress/expected/aggregates.out b/src/test/regress/expected/aggregates.out
index 495deb606e2..1e682565d13 100644
--- a/src/test/regress/expected/aggregates.out
+++ b/src/test/regress/expected/aggregates.out
@@ -2944,23 +2944,20 @@ GROUP BY c1.w, c1.z;
QUERY PLAN
-----------------------------------------------------
GroupAggregate
- Disabled Nodes: 2
Group Key: c1.w, c1.z
-> Sort
- Disabled Nodes: 2
Sort Key: c1.w, c1.z, c1.x, c1.y
-> Merge Join
- Disabled Nodes: 2
Merge Cond: (c1.x = c2.x)
-> Sort
Sort Key: c1.x
-> Seq Scan on group_agg_pk c1
- Disabled Nodes: 1
+ Disabled: true
-> Sort
Sort Key: c2.x
-> Seq Scan on group_agg_pk c2
- Disabled Nodes: 1
-(17 rows)
+ Disabled: true
+(14 rows)
SELECT avg(c1.f ORDER BY c1.x, c1.y)
FROM group_agg_pk c1 JOIN group_agg_pk c2 ON c1.x = c2.x
@@ -2982,24 +2979,21 @@ GROUP BY c1.y,c1.x,c2.x;
QUERY PLAN
-----------------------------------------------------
Group
- Disabled Nodes: 2
Group Key: c1.x, c1.y
-> Incremental Sort
- Disabled Nodes: 2
Sort Key: c1.x, c1.y
Presorted Key: c1.x
-> Merge Join
- Disabled Nodes: 2
Merge Cond: (c1.x = c2.x)
-> Sort
Sort Key: c1.x
-> Seq Scan on group_agg_pk c1
- Disabled Nodes: 1
+ Disabled: true
-> Sort
Sort Key: c2.x
-> Seq Scan on group_agg_pk c2
- Disabled Nodes: 1
-(18 rows)
+ Disabled: true
+(15 rows)
EXPLAIN (COSTS OFF)
SELECT c1.y,c1.x FROM group_agg_pk c1
@@ -3009,24 +3003,21 @@ GROUP BY c1.y,c2.x,c1.x;
QUERY PLAN
-----------------------------------------------------
Group
- Disabled Nodes: 2
Group Key: c2.x, c1.y
-> Incremental Sort
- Disabled Nodes: 2
Sort Key: c2.x, c1.y
Presorted Key: c2.x
-> Merge Join
- Disabled Nodes: 2
Merge Cond: (c1.x = c2.x)
-> Sort
Sort Key: c1.x
-> Seq Scan on group_agg_pk c1
- Disabled Nodes: 1
+ Disabled: true
-> Sort
Sort Key: c2.x
-> Seq Scan on group_agg_pk c2
- Disabled Nodes: 1
-(18 rows)
+ Disabled: true
+(15 rows)
RESET enable_nestloop;
RESET enable_hashjoin;