-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
executor: some minor refine for hash join v2 build #54429
executor: some minor refine for hash join v2 build #54429
Conversation
Hi @windtalker. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/assign |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #54429 +/- ##
=================================================
- Coverage 72.6973% 55.0895% -17.6078%
=================================================
Files 1551 1672 +121
Lines 437184 609272 +172088
=================================================
+ Hits 317821 335645 +17824
- Misses 99756 250669 +150913
- Partials 19607 22958 +3351
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: XuHuaiyu, xzhangxian1008 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
/retest |
…or small query Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
8aa9eff
to
9df10ef
Compare
What problem does this PR solve?
Issue Number: ref #53127
Problem Summary:
What changed and how does it work?
During hash join v2 build, it will pre-allocate maxRowTableSegmentSize(which is 1024) rows for a new rowTableSegment
tidb/pkg/executor/join/join_row_table.go
Lines 87 to 95 in 634ac69
For small queries, it is a waste to pre allocate so many memories and may hurt the performance in high concurrency scenarios.
In this pr, when constructing a new rowTableSegment, it will use
chunk_row_number/partition_number * 1.2
as the row size hint for the first rowTableSegment, but still use maxRowTableSegmentSize as the row size hint for the following rowTableSegment.Add
maxRowTableSegmentByteSize
to control the max memory size of a rowTableSegment.Since rowTableSegment saves
rowStartOffset
directly, there is no need to save row offset inbuilder.startPosInRawData
, so removestartPosInRawData
inrowTableBuilder
rename
crrntSizeOfRowTable
torowNumberInCurrentRowTableSeg
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.