When distributing aggregations which are part of a subquery, we need to use subquery opts rather than the root query opts.
The approach is not completely optimal since we need to reassemble the parent path and jump through a bunch of pointers. As a follow up we can modify the TraverseBottomUp function to pass in the entire parent path instead of only the immediate parent.
When distributing aggregations which are part of a subquery, we need to use subquery opts rather than the root query opts.
The approach is not completely optimal since we need to reassemble the parent path and jump through a bunch of pointers. As a follow up we can modify the
TraverseBottomUp
function to pass in the entire parent path instead of only the immediate parent.