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): support expr visitable for plan node #13587

Merged
merged 2 commits into from
Nov 23, 2023

Conversation

chenzl25
Copy link
Contributor

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

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.

@chenzl25 chenzl25 requested a review from st1page November 22, 2023 08:07
@chenzl25 chenzl25 requested review from xiangjinwu, jetjinser, xxchan and BugenZhao and removed request for xiangjinwu November 22, 2023 08:07
@BugenZhao
Copy link
Member

If I understand correctly, the developers should manually ensure that the implementation is identical to ExprRewritable? Although it appears that there is no effective approach for reusing them in Rust.

@chenzl25
Copy link
Contributor Author

If I understand correctly, the developers should manually ensure that the implementation is identical to ExprRewritable? Although it appears that there is no effective approach for reusing them in Rust.

Yes. One is a mutable reference and the other one is an immutable reference.

Copy link

codecov bot commented Nov 22, 2023

Codecov Report

Attention: 192 lines in your changes are missing coverage. Please review.

Comparison is base (11011b1) 68.17% compared to head (3e86ae4) 68.12%.
Report is 1 commits behind head on main.

Files Patch % Lines
...nd/src/optimizer/plan_node/batch_table_function.rs 0.00% 7 Missing ⚠️
...c/frontend/src/optimizer/plan_node/batch_values.rs 0.00% 7 Missing ⚠️
.../frontend/src/optimizer/plan_node/stream_values.rs 0.00% 7 Missing ⚠️
...frontend/src/optimizer/plan_node/logical_insert.rs 0.00% 6 Missing ⚠️
...frontend/src/optimizer/plan_node/logical_source.rs 0.00% 6 Missing ⚠️
.../src/optimizer/plan_node/logical_table_function.rs 0.00% 6 Missing ⚠️
src/frontend/src/optimizer/plan_node/mod.rs 0.00% 6 Missing ⚠️
...rc/frontend/src/optimizer/plan_node/generic/agg.rs 0.00% 5 Missing ⚠️
...tend/src/optimizer/plan_node/logical_multi_join.rs 0.00% 5 Missing ⚠️
...ontend/src/optimizer/plan_node/batch_hop_window.rs 0.00% 4 Missing ⚠️
... and 44 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13587      +/-   ##
==========================================
- Coverage   68.17%   68.12%   -0.06%     
==========================================
  Files        1512     1513       +1     
  Lines      261145   261337     +192     
==========================================
- Hits       178040   178025      -15     
- Misses      83105    83312     +207     
Flag Coverage Δ
rust 68.12% <0.00%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@xxchan xxchan left a comment

Choose a reason for hiding this comment

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

If we can visit the plan node to check whether we actually need to rewrite exprs we can save CPU cost.

Can you do that together and demonstrate how much improvement it provides? 👀

Since this feat is solely for that optimization purpose, I'd rather confirm it works before adding this part.

@chenzl25
Copy link
Contributor Author

chenzl25 commented Nov 22, 2023

@xxchan Sure. It can reduce CPU from 2.2% to 0.1% for inline_now_proc_time.
Before:
image
After:
image

@chenzl25 chenzl25 added this pull request to the merge queue Nov 23, 2023
Merged via the queue into main with commit b3866b7 Nov 23, 2023
6 of 7 checks passed
@chenzl25 chenzl25 deleted the dylan/support_expr_visitable_for_plan_node branch November 23, 2023 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: support ExprVisitable for plan nodes
4 participants