-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add a query planner for OxQL #7152
Merged
Merged
Conversation
This file contains 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
Collaborator
bnaecker
commented
Nov 22, 2024
- Add types to represent the plan tree and the currently-supported plan tree nodes. These mostly correspond to the existing query AST nodes, but include information about the expected schema for the input and output tables, along with the query AST nodes that "implement" that transformation.
- Add an explicit node for computing deltas from a cumulative timeseries, automatically after the node for fetching its data from the DB. This is currently implicitly done after fetching the data, but will be part of an explicit plan step going forward. The ultimate goal is to push that into the database itself where possible.
- Adds methods to optimize a query plan, which currently includes the predicate-pushdown and limit-pushdown tricks we already do to limit the amount of data we get from the database. Adds some tests to verify behavior of these optimizations, in particular that they don't change the planned output of the query itself.
- Add pretty-printing of the plan tree, and include a way to show that in the OxQL shell.
- Add detection of full table scans. Use the planner in OxQL queries, only to verify them and check that there are no scans. The queries themselves are executed in the original method today.
bnaecker
force-pushed
the
oxql-query-planner
branch
3 times, most recently
from
December 6, 2024 22:34
1b46272
to
4ed9011
Compare
- Add types to represent the plan tree and the currently-supported plan tree nodes. These mostly correspond to the existing query AST nodes, but include information about the expected schema for the input and output tables, along with the query AST nodes that "implement" that transformation. - Add an explicit node for computing deltas from a cumulative timeseries, automatically after the node for fetching its data from the DB. This is currently implicitly done after fetching the data, but will be part of an explicit plan step going forward. The ultimate goal is to push that into the database itself where possible. - Adds methods to optimize a query plan, which currently includes the predicate-pushdown and limit-pushdown tricks we already do to limit the amount of data we get from the database. Adds some tests to verify behavior of these optimizations, in particular that they don't change the _planned_ output of the query itself. - Add pretty-printing of the plan tree, and include a way to show that in the OxQL shell. - Add detection of full table scans. Use the planner in OxQL queries, _only to verify them_ and check that there are no scans. The queries themselves are executed in the original method today.
bnaecker
force-pushed
the
oxql-query-planner
branch
from
December 6, 2024 22:35
4ed9011
to
ce155ac
Compare
bnaecker
commented
Jan 16, 2025
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.
First-pass self-review
ahl
reviewed
Jan 17, 2025
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.
wow! looks like a lot of code
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.