refactor: consolidate multi-step planning, assembly and execution into QueryPlanner type - #1482
Draft
jkaczman wants to merge 5 commits into
Draft
refactor: consolidate multi-step planning, assembly and execution into QueryPlanner type#1482jkaczman wants to merge 5 commits into
jkaczman wants to merge 5 commits into
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
levkk
reviewed
Sep 2, 2026
levkk
reviewed
Sep 2, 2026
|
|
||
| /// Splitting of multi-tuple INSERT statements into | ||
| /// multiple queries. | ||
| pub(crate) insert_split: Vec<InsertSplit>, |
Collaborator
There was a problem hiding this comment.
We used to cache the rewrite previously. Now, we're performing it on each request, prepared statement or not. I suspect that would add some performance overhead to this step, worth benchmarking.
jkaczman
marked this pull request as ready for review
September 2, 2026 20:27
jkaczman
marked this pull request as draft
September 2, 2026 22:19
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
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.
@sgrif and I have been working on #1096 (subqueries), and as the first step to getting there, discussed how we can create an architecture for multi-step that...
DataRowreturning. Another example being, of course, subqueries.Parse/Bindhandled dynamic Steps, we don't need to pre-make requests for each before execution-time,InPlacevariant, so that we can just receive theQueryPlannerand handle it, and also, makingOffsetPlanindependent of this new struct, as it's not relevant (and can just be passed straight through)QueryEngineContextto work with now.No tests were removed. Added a couple of tests for a few things I wanted to make sure worked.
A lot of the diff is from moving pre-existing functions/tests around.
pgdog/src/frontend/router/parser/rewrite/statement/update.rs=>pgdog/src/frontend/client/query_engine/multi_step/test/sharding_key_update.rspgdog/src/frontend/router/parser/rewrite/statement/insert.rs=>pgdog/src/frontend/client/query_engine/multi_step/test/split_insert.rsTODO: Cache insert splits / subqueries / etc (relevant benchmark: #1484)