[opt](function) optimize from_unixtime/date_format by specially format str#40821
[opt](function) optimize from_unixtime/date_format by specially format str#40821HappenLee merged 5 commits intoapache:masterfrom
Conversation
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
|
run buildall |
TPC-H: Total hot run time: 42981 ms |
|
TeamCity be ut coverage result: |
TPC-DS: Total hot run time: 195149 ms |
ClickBench: Total hot run time: 31.46 s |
|
run buildall |
|
TeamCity be ut coverage result: |
TPC-H: Total hot run time: 42617 ms |
|
run performance |
TPC-H: Total hot run time: 42938 ms |
TPC-DS: Total hot run time: 194889 ms |
ClickBench: Total hot run time: 30.97 s |
| #include <variant> | ||
|
|
||
| #include "vec/common/string_ref.h" | ||
| namespace doris::vectorized { |
There was a problem hiding this comment.
doris::vectorized::time_format_type
| namespace time_format_type { | ||
|
|
||
| template <typename T> | ||
| void inline put_year(T y, char* buf, int& i) { |
There was a problem hiding this comment.
no need inline, the template func must be inline
| res_data.reserve(len * format.size + len); | ||
| null_map.resize_fill(len, false); | ||
|
|
||
| if (!format_state->is_valid) { |
There was a problem hiding this comment.
is_valid should set null, is danger behavioer
|
run buildall |
TPC-H: Total hot run time: 43291 ms |
|
TeamCity be ut coverage result: |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
|
run performance |
TPC-H: Total hot run time: 41228 ms |
TPC-DS: Total hot run time: 198385 ms |
ClickBench: Total hot run time: 33.73 s |
…t str (#40821) ``` mysql [test]>select count(date_format(a, 'yyyyMMdd')) from date_format_tmp; +-----------------------------------+ | count(date_format(a, 'yyyyMMdd')) | +-----------------------------------+ | 16000000 | +-----------------------------------+ 1 row in set (0.53 sec) mysql [test]>select count(date_format(a, 'yyyyMMdd')) from date_format_tmp; +-----------------------------------+ | count(date_format(a, 'yyyyMMdd')) | +-----------------------------------+ | 16000000 | +-----------------------------------+ 1 row in set (0.28 sec) ```
Proposed changes