-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[Performance](opt) opt the order by performance in permutation #38985
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
run buildall |
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.
clang-tidy made some suggestions
std::partial_sort(res.begin(), sort_end, res.end(), | ||
[this](size_t a, size_t b) { return data[a] < data[b]; }); | ||
} else { | ||
if (reverse) |
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.
warning: statement should be inside braces [readability-braces-around-statements]
if (reverse) | |
if (reverse) { |
be/src/vec/columns/column_decimal.h:283:
- else
+ } else
if (reverse) | ||
pdqsort(res.begin(), res.end(), | ||
[this](size_t a, size_t b) { return data[a] > data[b]; }); | ||
else |
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.
warning: statement should be inside braces [readability-braces-around-statements]
else | |
else { |
be/src/vec/columns/column_decimal.h:285:
- [this](size_t a, size_t b) { return data[a] < data[b]; });
+ [this](size_t a, size_t b) { return data[a] < data[b]; });
+ }
limit = 0; | ||
} | ||
// std::partial_sort need limit << s can get performance benefit | ||
if (limit > (s / 8.0)) limit = 0; |
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.
warning: statement should be inside braces [readability-braces-around-statements]
if (limit > (s / 8.0)) limit = 0; | |
if (limit > (s / 8.0)) { limit = 0; | |
} |
@@ -236,7 +236,8 @@ void ColumnVector<T>::get_permutation(bool reverse, size_t limit, int nan_direct | |||
|
|||
if (s == 0) return; | |||
|
|||
if (limit >= s) limit = 0; | |||
// std::partial_sort need limit << s can get performance benefit | |||
if (limit > (s / 8.0)) limit = 0; |
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.
warning: statement should be inside braces [readability-braces-around-statements]
if (limit > (s / 8.0)) limit = 0; | |
if (limit > (s / 8.0)) { limit = 0; | |
} |
run buildall |
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.
clang-tidy made some suggestions
std::partial_sort(res.begin(), sort_end, res.end(), | ||
[this](size_t a, size_t b) { return data[a] < data[b]; }); | ||
} else { | ||
if (reverse) |
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.
warning: statement should be inside braces [readability-braces-around-statements]
if (reverse) | |
if (reverse) { |
be/src/vec/columns/column_decimal.h:284:
- else
+ } else
if (reverse) | ||
pdqsort(res.begin(), res.end(), | ||
[this](size_t a, size_t b) { return data[a] > data[b]; }); | ||
else |
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.
warning: statement should be inside braces [readability-braces-around-statements]
else | |
else { |
be/src/vec/columns/column_decimal.h:286:
- [this](size_t a, size_t b) { return data[a] < data[b]; });
+ [this](size_t a, size_t b) { return data[a] < data[b]; });
+ }
run buildall |
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.
clang-tidy made some suggestions
@@ -21,6 +21,7 @@ | |||
#pragma once | |||
|
|||
#include <glog/logging.h> |
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.
warning: 'glog/logging.h' file not found [clang-diagnostic-error]
#include <glog/logging.h>
^
run performance |
TPC-H: Total hot run time: 42442 ms
|
TPC-DS: Total hot run time: 169462 ms
|
ClickBench: Total hot run time: 29.91 s
|
## Proposed changes cherry pick #38985 <!--Describe your changes.-->
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
Issue Number: cherry pick #38985
…e#38985) ## Proposed changes Before: ``` select l_quantity from lineitem order by l_quantity limit 10000020; +--------------+ | ReturnedRows | +--------------+ | 10000020 | +--------------+ 1 row in set (2 min 24.42 sec) ``` after: ``` mysql [tpch]>select l_quantity from lineitem order by l_quantity limit 10000020; +--------------+ | ReturnedRows | +--------------+ | 10000020 | +--------------+ 1 row in set (28.42 sec) ``` <!--Describe your changes.-->
## Proposed changes Issue Number: cherry pick #38985 <!--Describe your changes.-->
…e#39092) Issue Number: cherry pick apache#38985
Proposed changes
Before:
after: