-
Notifications
You must be signed in to change notification settings - Fork 830
MQE: add subquery support to range vector splitting #16444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
niktikhonov
wants to merge
23
commits into
main
Choose a base branch
from
nt/rvs-subquery-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 11 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
828f23c
MQE: add subquery support to range vector splitting
niktikhonov 2c76f67
MQE: add feature flag and increment plan-version for subquery splitting
niktikhonov 726414e
MQE: fix subquery splitting collision on nested subqueries and suppor…
niktikhonov 948d642
Merge branch 'main' into nt/rvs-subquery-support
niktikhonov c4da50e
MQE: require CSE for subquery splitting and move split-block dedup in…
niktikhonov 6e2776f
Merge branch 'main' into nt/rvs-subquery-support
niktikhonov 0af9367
fix CHANGELOG.md
niktikhonov 92e719a
fix index.md
niktikhonov af9c895
fix docs
niktikhonov 796f9a2
Merge branch 'main' into nt/rvs-subquery-support
niktikhonov bb04969
MQE: name the flags required for subquery splitting in its help
niktikhonov b183040
Merge branch 'main' into nt/rvs-subquery-support
niktikhonov 3d70352
pull sum_over_time precision fix
niktikhonov 240e25d
Merge branch 'main' into nt/rvs-subquery-support
niktikhonov 7bbf845
fix merge conflicts
niktikhonov 97cfaff
fix nits comments:
niktikhonov 56db183
fix crash when a DuplicateFilter is shared under a split subquery
niktikhonov 625c495
add subquery-splitting test for unsorted series from "or"
niktikhonov 90a0721
disable subquery splitting for non-relative nested selectors
niktikhonov 18ecefe
disable subquery splitting for smoothed vector selector
niktikhonov 0de82f7
disable subquery splitting for smoothed vector selector
niktikhonov b67c8e4
don't error on conflicting DropName across subquery splits
niktikhonov bd5a393
rename function
niktikhonov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
docs/sources/mimir/configure/configuration-parameters/index.md
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for reviewers: subqueries are evaluated internally as their own range query, with a step grid aligned to Unix epoch time 0. When splitting also applies to a subquery, that alignment means two different split blocks (or two different levels of subquery nesting, see tests) can make a nested
Subquery/StepInvariantExpressioncompute the exact same derived time range for its own child. Materializing and executing that child multiply times would be duplicate work and also breaks the invariant that a plan node is only materialized once (see singleUseOperatorFactory).To handle this, the child of any Subquery/StepInvariantExpression nested inside a split subquery is wrapped in a
Duplicatenode, so the different blocks share the one computation instead of redoing it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with this approach, though as a note though this could cause nodes to be "unnecessarily" wrapped with a duplicate node, even when the splits don't have colliding nested subqueries. I don't think that would add too much overhead though, and I guess the problem is we can't predict which nodes will collide until we look up cache entries to figure out cached and uncached splits.