-
Notifications
You must be signed in to change notification settings - Fork 633
feat(frontend): fearless recursion on deep plans #16279
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
Conversation
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
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.
Looks very cool! A common case of stack overflow is Lots of Unions
, e.g. select 1 union all select 1 ..... union all select
, Could you please test against it whether this PR could help?
Unfortunately not. 😕 I guess the most heaviest part of this query resides in other steps (like parsing or optimization), which are not covered in this PR. We have to find them out and wrap them with |
Will do this in following PRs. |
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
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.
LGTM!
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.
LGTM, Ancient Greek God of Recursion!
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.
LGTM.
BTW, IIRC in TiKV, the recursion limit of plan always exceeded when encode/decode from/to protobuf. To resolve that, they use reverse polish notation in the plan proto definitions.
Signed-off-by: Bugen Zhao [email protected]I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Use
stacker
to dynamically grow the stack for deep recursion. Check the documentation on the source code for the usage.Considering that growing the stack may lead to performance overhead, and we may fail to wrap all recursion when handling a deep plan. We warn to users if we find the recursion too deep in
to_stream_prost
orto_batch_prost
.Hide the whitespaces for better review experience.
Resolve #15916.
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.
Signed-off-by: Bugen Zhao