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): optimizing vanilla min/max on index/pk #8337

Merged
merged 6 commits into from
Mar 6, 2023

Conversation

y-wei
Copy link
Contributor

@y-wei y-wei commented Mar 4, 2023

Signed-off-by: Clearlove yifei.c.wei@gmail.comI hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Vanilla min and max on index/pk for batch execution is optimized.

  • Summarize your change (mandatory)
    An optimizer rule MinMaxOnIndexRule that optimizes "no group key, no distinct, no filter, no order_by, single-fielded" min and max.

Checklist For Contributors

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • I have demonstrated that backward compatibility is not broken by breaking changes and created issues to track deprecated features to be removed in the future. (Please refer to the issue)
  • All checks passed in ./risedev check (or alias, ./risedev c)

Checklist For Reviewers

  • I have requested macro/micro-benchmarks as this PR can affect performance substantially, and the results are shown.

Related Issues

#7991, #7481

y-wei added 2 commits March 4, 2023 14:46
Signed-off-by: Clearlove <yifei.c.wei@gmail.com>
Signed-off-by: Clearlove <yifei.c.wei@gmail.com>
@y-wei y-wei requested review from lmatz, chenzl25 and BugenZhao March 4, 2023 20:02
@y-wei y-wei changed the title feat (optimizer): optimizing vanilla min/max on index/pk feat(optimizer): optimizing vanilla min/max on index/pk Mar 4, 2023
Copy link
Contributor

@chenzl25 chenzl25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM. Good job!

Comment on lines 239 to 249
static ref AGG_ON_INDEX: OptimizationStage = OptimizationStage::new(
static ref TOP_N_ON_INDEX: OptimizationStage = OptimizationStage::new(
"Agg on Index",
vec![TopNOnIndexRule::create()],
ApplyOrder::TopDown,
);

static ref MIN_MAX_ON_INDEX: OptimizationStage = OptimizationStage::new(
"Min/Max on Index",
vec![MinMaxOnIndexRule::create()],
ApplyOrder::TopDown,
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please merge these two stages? I intend to group rules that serve a similar function together.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out!

y-wei and others added 2 commits March 5, 2023 23:10
Co-authored-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Clearlove <yifei.c.wei@gmail.com>
@y-wei y-wei added this pull request to the merge queue Mar 6, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 6, 2023
@lmatz lmatz added this pull request to the merge queue Mar 6, 2023
Merged via the queue into risingwavelabs:main with commit f5e41a1 Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants