Skip to content
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

feat(optimizer): improve scalar subqueries optimization time #16966

Merged
merged 4 commits into from
May 29, 2024

refactor

0c794e9
Select commit
Loading
Failed to load commit list.
Merged

feat(optimizer): improve scalar subqueries optimization time #16966

refactor
0c794e9
Select commit
Loading
Failed to load commit list.
Task list completed / task-list-completed Started 2024-05-29 05:21:25 ago

0 / 8 tasks completed

8 tasks still to be completed

Details

Required Tasks

Task Status
Resolve #16952 Incomplete
Multi-scalar subqueries are very common queries written by users. However, in some special cases, it can lead to an exponential increase in optimization time as the number of scalar subqueries grows. The root cause is that multi-scalar subqueries are constructed as a chain of Apply. As a result, it is hard to find the original domain for the upper Apply operator. In this PR, we try to translate the Apply in a top-down order and simplify the domain by extracting the domain from the apply input. In this way, optimization time could linearly increase as the number of scalar subqueries grows. Incomplete
I have written necessary rustdoc comments Incomplete
I have added necessary unit tests and integration tests Incomplete
I have added test labels as necessary. See details. Incomplete
I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features #7934). Incomplete
My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future). Incomplete
All checks passed in ./risedev check (or alias, ./risedev c) Incomplete
My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details) Incomplete
My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users) Incomplete