adapter: Subscribe on the frontend peek path#35756
Merged
bkirwi merged 13 commits intoMaterializeInc:mainfrom Mar 30, 2026
Merged
adapter: Subscribe on the frontend peek path#35756bkirwi merged 13 commits intoMaterializeInc:mainfrom
bkirwi merged 13 commits intoMaterializeInc:mainfrom
Conversation
The copy-to and regular paths were interleaved with shared logic, which complicated the control flow and required a bunch of Either wrapping. This shifts a bunch of code around to get to a more linear flow with less branching.
Subscribe statements capture the full select now
Contributor
|
Thanks for opening this PR! Here are a few tips to help make the review process smooth for everyone. PR title guidelines
Pre-merge checklist
|
5a62336 to
ded2162
Compare
antiguru
approved these changes
Mar 27, 2026
ded2162 to
5de031f
Compare
ggevay
approved these changes
Mar 30, 2026
Contributor
ggevay
left a comment
There was a problem hiding this comment.
Thank you, looks great! Just some minor comments, especially around transactions.
And I think a feature flag would be great. It could be enabled by default, but it's good to have an escape hatch, at least for a few weeks.
Contributor
Author
|
Glad this makes sense to you! I'll get some followups up today. |
This reverts commit ac5ec9a.
1aac6cb to
f16bc6d
Compare
This moves us more in line with how selects work without actually inlining a select plan.
f16bc6d to
a85d992
Compare
c911f91 to
155d321
Compare
Contributor
Author
|
Thanks for the feedback! Made the suggested changes and added a flag; happy to follow up if needed. |
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.
This PR adds subscribes to the list of things that can run on the frontend peek path.
This was largely done to support directing "fast-path" subscribes to use the peek machinery for faster queries, but IIUC it's independently valuable to have support for more things on this more scalable path, so I'm posting it separately.
This involved some refactoring, so I've tried to split up the code movement from the new functionality as much as possible. You may wish to review commit-by-commit.
Motivation
https://linear.app/materializeinc/project/adapt-peek-optimizations-to-subscribes-fde3ad359795
Verification
Clean nightlies: https://buildkite.com/materialize/nightly/builds/15898#019d303a-522d-4bcc-a784-78ccb96fac69
I suspect we want to enable this behind a feature flag. Let me know if that's interesting, and whether it should be on by default.