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

refactor(over window): use new table.iter_with_prefix in streaming OverWindow #12872

Merged
merged 2 commits into from
Oct 17, 2023

Conversation

stdrc
Copy link
Member

@stdrc stdrc commented Oct 16, 2023

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

What's changed and what's your intention?

After #12364 we now have a new and handy StateTable::iter_with_prefix method to iterate a given range within a pk prefix. This PR utilize it to simplify OverPartition. Fixes #12583.

Checklist

  • 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).
  • 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.

@codecov
Copy link

codecov bot commented Oct 16, 2023

Codecov Report

Merging #12872 (14d938e) into main (0f61b00) will decrease coverage by 0.01%.
The diff coverage is 75.43%.

@@            Coverage Diff             @@
##             main   #12872      +/-   ##
==========================================
- Coverage   69.15%   69.15%   -0.01%     
==========================================
  Files        1489     1489              
  Lines      245901   245879      -22     
==========================================
- Hits       170052   170031      -21     
+ Misses      75849    75848       -1     
Flag Coverage Δ
rust 69.15% <75.43%> (-0.01%) ⬇️

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

Files Coverage Δ
src/stream/src/executor/over_window/general.rs 86.95% <ø> (ø)
.../stream/src/executor/over_window/over_partition.rs 78.15% <75.43%> (-0.49%) ⬇️

... and 4 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@wcy-fdu wcy-fdu left a comment

Choose a reason for hiding this comment

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

LGTM!
Do we need some perf test for this PR? IIRC, after using state table sub_range interface, over window will scan less items.

@stdrc
Copy link
Member Author

stdrc commented Oct 17, 2023

Do we need some perf test for this PR? IIRC, after using state table sub_range interface, over window will scan less items.

Actually we don't have a good benchmark query specifically for OverWindow yet. I'll run nexmark q6-group-top1 and q19, hope they can give some basic sense for the performance impact of this PR.

Copy link
Contributor

@st1page st1page left a comment

Choose a reason for hiding this comment

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

LGTM, we can bench it after using the reverse iterator later.

@stdrc stdrc added this pull request to the merge queue Oct 17, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Oct 17, 2023
@stdrc stdrc added this pull request to the merge queue Oct 17, 2023
Merged via the queue into main with commit 57b4641 Oct 17, 2023
@stdrc stdrc deleted the rc/use-state-table-iter-with-prefix branch October 17, 2023 15:54
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.

refactor: use StateTable::iter_row_with_pk_prefix_sub_range in the OverWindow's range cache
3 participants