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/07/04 08:16:29 UTC
[GitHub] [doris] englefly opened a new pull request, #10586: [enhancement] speed up week_of_year by pre_calc table
englefly opened a new pull request, #10586:
URL: https://github.com/apache/doris/pull/10586
# Proposed changes
select count(LO_ORDERDATE) FROM lineorder WHERE weekofyear(LO_ORDERDATE) = 6;
before: 13 sec
after: 19 sec
we make a static const uint8_t array week_of_year_table in VecDateTimeValue.
if the year is between [1950, 2029], we get the result from array week_of_year_table, otherwise calculate the result as before.
Issue Number: close #xxx
## Problem Summary:
Describe the overview of 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/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] kpfly commented on pull request #10586: [enhancement] speed up week_of_year by pre_calc table
Posted by GitBox <gi...@apache.org>.
kpfly commented on PR #10586:
URL: https://github.com/apache/doris/pull/10586#issuecomment-1173523156
Why does it have a negative impact on performance ?
--
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 #10586: [enhancement] speed up week_of_year by pre_calc table
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #10586:
URL: https://github.com/apache/doris/pull/10586#issuecomment-1173559388
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] github-actions[bot] commented on pull request #10586: [enhancement] speed up week_of_year by pre_calc table
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #10586:
URL: https://github.com/apache/doris/pull/10586#issuecomment-1173559438
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] Gabriel39 commented on a diff in pull request #10586: [enhancement] speed up week_of_year by pre_calc table
Posted by GitBox <gi...@apache.org>.
Gabriel39 commented on code in PR #10586:
URL: https://github.com/apache/doris/pull/10586#discussion_r912798485
##########
be/src/vec/runtime/vdatetime_value.cpp:
##########
@@ -837,6 +837,9 @@ bool VecDateTimeValue::to_format_string(const char* format, int len, char* to) c
}
uint8_t VecDateTimeValue::calc_week(const VecDateTimeValue& value, uint8_t mode, uint32_t* year) {
+ if (value._year >= 1949 && value._year < 2030) {
+ return week_of_year_table[value._year - 1950][value._month][value._day];
Review Comment:
`mode` also needs to be considered
--
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] englefly commented on a diff in pull request #10586: [enhancement] speed up week_of_year by pre_calc table
Posted by GitBox <gi...@apache.org>.
englefly commented on code in PR #10586:
URL: https://github.com/apache/doris/pull/10586#discussion_r912910189
##########
be/src/vec/runtime/vdatetime_value.cpp:
##########
@@ -837,6 +837,9 @@ bool VecDateTimeValue::to_format_string(const char* format, int len, char* to) c
}
uint8_t VecDateTimeValue::calc_week(const VecDateTimeValue& value, uint8_t mode, uint32_t* year) {
+ if (value._year >= 1949 && value._year < 2030) {
+ return week_of_year_table[value._year - 1950][value._month][value._day];
Review Comment:
in doris,mode is a hard-coded value 3.
--
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] englefly commented on pull request #10586: [enhancement] speed up week_of_year by pre_calc table
Posted by GitBox <gi...@apache.org>.
englefly commented on PR #10586:
URL: https://github.com/apache/doris/pull/10586#issuecomment-1173566073
> Why does it have a negative impact on performance ?
> Why does it have a negative impact on performance ?
>
> > before: 13 sec
> > after: 19 sec
>
> make slower?
> > before: 13 sec
> > after: 19 sec
>
> make slower?
sorry,笔误
--
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 #10586: [enhancement] speed up week_of_year by pre_calc table
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #10586:
URL: https://github.com/apache/doris/pull/10586#issuecomment-1174566221
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] yiguolei merged pull request #10586: [enhancement] speed up week_of_year by pre_calc table
Posted by GitBox <gi...@apache.org>.
yiguolei merged PR #10586:
URL: https://github.com/apache/doris/pull/10586
--
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