You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
c01743a added EXPLAIN output to display the plan node's disabled_nodecount whenever that count is above 0. Seemingly, there weren't manypeople who liked that output as each parent of a disabled node wouldalso have a "Disabled Nodes" output due to the way disabled_nodes isaccumulated towards the root plan node. It was often hard and sometimesimpossible to figure out which nodes were disabled from looking atEXPLAIN. You might think it would be possible to manually add up thenumbers from the "Disabled Nodes" output of a given node's children tofigure out if that node has a higher disabled_nodes count than itschildren, but that wouldn't have worked for Append and Merge Append nodesif some disabled child nodes were run-time pruned during init plan. Thosechildren 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. Thatseems to be the output that's desired by the most people who voicedtheir opinion. This is done by summing up the disabled_nodes of thegiven node's children and checking if that number is less than thedisabled_nodes of the current node.This commit also fixes a bug in make_sort() which was neglecting to setthe Sort's disabled_nodes field. This should have copied what was donein cost_sort(), but it hadn't been updated. With the new output, thechoice to not maintain that field properly was clearly wrong as thedisabled-ness of the node was attributed to the Sort's parent instead.Reviewed-by: Laurenz Albe, Alena RybakinaDiscussion:https://postgr.es/m/9e4ad616bebb103ec2084bf6f724cfc739e7fabb.camel@cybertec.at