-
Notifications
You must be signed in to change notification settings - Fork 6k
planner: optimize return type of partial sum for tiflash #59709
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
planner: optimize return type of partial sum for tiflash #59709
Conversation
b8a2bd8
to
43335ac
Compare
Signed-off-by: guo-shaoge <[email protected]>
43335ac
to
97251aa
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #59709 +/- ##
================================================
- Coverage 73.1282% 72.9424% -0.1858%
================================================
Files 1680 1709 +29
Lines 464584 499085 +34501
================================================
+ Hits 339742 364045 +24303
- Misses 103978 113181 +9203
- Partials 20864 21859 +995
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Signed-off-by: guo-shaoge <[email protected]>
Signed-off-by: guo-shaoge <[email protected]>
Signed-off-by: guo-shaoge <[email protected]>
Signed-off-by: guo-shaoge <[email protected]>
Signed-off-by: guo-shaoge <[email protected]>
Signed-off-by: guo-shaoge <[email protected]>
/retest |
Signed-off-by: guo-shaoge <[email protected]>
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
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.
Can we add an unit test case for TypeInfer4AvgSum ?
Signed-off-by: guo-shaoge <[email protected]>
[LGTM Timeline notifier]Timeline:
|
Signed-off-by: guo-shaoge <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hawkingrei, windtalker, XuHuaiyu 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 |
/retest |
1 similar comment
/retest |
@guo-shaoge: The following tests failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: close #59708
Problem Summary:
the type infer of
avg(col_decimal_15_2)
:plan builder
, call typeInfer4Avg, the return type of avg becomesdecimal(19, 6)
task.go
, trying to convert normalavg
to mppavg
, which will be spilit tocount() and sum(col_decimal_15_2)
(1 phase) andsum/count
(2 phase). And the return type of 1 phasesum(col_decimal_15_2)
isdecimal(41, 6)
because of calling TypeInfer4AvgSumdecimal(41, 6)
will use Int256 to compute, which is slow. So we need to optimize type infer.What changed and how does it work?
Workload: tpch50G
Query:
explain analyze select avg(l_quantity) from lineitem group by l_orderkey;
performance: 4-> 2.9 (+26%)
before:
after:
Check List
Tests
before: need to cast sum(table_scan_0) (which is Decimal(37, 2)) to Decimal(41, 6) in task1.
after: no cast is needed
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.