You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/09/29 05:22:52 UTC
[GitHub] [doris] BiteTheDDDDt opened a new pull request, #13049: [Enhancement](optimize) optimize for function multiply on decimalv2
BiteTheDDDDt opened a new pull request, #13049:
URL: https://github.com/apache/doris/pull/13049
# Proposed changes
TPCH Q6 0.8s->0.4s
```sql
select /*+SET_VAR(exec_mem_limit=8589934592, parallel_fragment_exec_instance_num=1, enable_vectorized_engine=true, batch_size=4096, disable_join_reorder=false, enable_cost_based_join_reorder=false, enable_projection=true) */
sum(l_extendedprice * l_discount) as revenue
from
lineitem
where
l_shipdate >= date '1994-01-01'
and l_shipdate < date '1994-01-01' + interval '1' year
and l_discount between .06 - 0.01 and .06 + 0.01
and l_quantity < 24;
```
before:
<img width="557" alt="图片" src="https://user-images.githubusercontent.com/7939630/192945331-acf4b30a-8495-43ea-bf3d-8bdb7f76991f.png">
after:
<img width="593" alt="图片" src="https://user-images.githubusercontent.com/7939630/192945516-9b2b0674-84ba-4d31-8d3c-3277e59d38f2.png">
## Problem summary
Describe your changes.
## Checklist(Required)
1. Does it affect the original behavior:
- [ ] Yes
- [ ] No
- [ ] I don't know
2. Has unit tests been added:
- [ ] Yes
- [ ] No
- [ ] No Need
3. Has document been added or modified:
- [ ] Yes
- [ ] No
- [ ] No Need
4. Does it need to update dependencies:
- [ ] Yes
- [ ] No
5. Are there any changes that cannot be rolled back:
- [ ] Yes (If Yes, please explain WHY)
- [ ] No
## Further comments
If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #13049: [Enhancement](optimize) optimize for function multiply on decimalv2
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #13049:
URL: https://github.com/apache/doris/pull/13049#issuecomment-1263058781
PR approved by anyone and no changes requested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #13049: [Enhancement](optimize) optimize for function multiply on decimalv2
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #13049:
URL: https://github.com/apache/doris/pull/13049#issuecomment-1263058761
PR approved by at least one committer and no changes requested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] Gabriel39 commented on a diff in pull request #13049: [Enhancement](optimize) optimize for function multiply on decimalv2
Posted by GitBox <gi...@apache.org>.
Gabriel39 commented on code in PR #13049:
URL: https://github.com/apache/doris/pull/13049#discussion_r983271273
##########
be/src/vec/functions/multiply.cpp:
##########
@@ -35,8 +35,8 @@ struct MultiplyImpl {
}
template <typename Result = DecimalV2Value>
- static inline DecimalV2Value apply(DecimalV2Value a, DecimalV2Value b) {
- return a * b;
+ static inline DecimalV2Value apply(const DecimalV2Value& a, const DecimalV2Value& b) {
+ return DecimalV2Value((a.value() * b.value() - 1) / DecimalV2Value::ONE_BILLION + 1);
Review Comment:
It's wrong if the result is negative
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org