feat(cubesql): Add separate ungrouped_scan flag to wrapper replacer context #9120
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check List
Description of Changes Made (if issue reference is not provided)
It is used to track whether
WrappedSelect
actually wraps ungrouped scan as opposed to old flag, which is used as push to Cube enabler.Changes in cost are necessary because now ungrouped scans are tracked, we are getting proper values in
wrapped_select_ungrouped_scan
cost component, it would count theWrappedSelect(ungrouped_scan=true)
nodes in extracted plan. And with old cost it would turns any ungrouped scan under wrapper more expensive than plan with same amount of wrappers (usually it's just 1 anyway), but with more nodes outside wrapper. Consider consuming projection:Projection(WrappedSelect(ungrouped_scan=true))
vsWrappedSelect(from=WrappedSelect(ungrouped_scan=true), ungrouped_scan=true)
. Plan withProjection
would haveast_size_outside_wrapper=1 wrapped_select_ungrouped_scan=1
, plan withWrappedSelect
-ast_size_outside_wrapper=0 wrapped_select_ungrouped_scan=2
, and second one is preferrable.Also couple of related fixes: