-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Optimize SortPreservingMergeStream to avoid SortKeyCursor sharing
#1624
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
alamb
left a comment
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.
tustvold
left a comment
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.
I really like this change 👍
That being said I think it would be good to rename some things and update the corresponding comments to avoid future confusion. I also think it is possible to remove the Arc but I could be missing something...
alamb
left a comment
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 like a great improvement to me 👍
|
Thanks again @yjshen |
Which issue does this PR close?
This PR is based on #1596 so please review that one first.Rationale for this change
In
SortPreservingMergeStream,SortKeyCursorshouldn't be shared betweenmin_heapand output batch buffer. The current sharing leads to the use ofAtomicUsize, which may harm performance.What changes are included in this PR?
RecordBatchinstead ofSortKeyCursorfor output batch buffering.cursor_finishedto make sure each input stream is pulled after a resume fromPending.AtomicUsizefrom SortKeyCursor.Are there any user-facing changes?
No.