This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new c009468214d branch-3.0: [opt] Optimization for short circuit of
CompoundPred #45422 (#46240)
c009468214d is described below
commit c009468214d8c04bb4fce7cfd82ece0066cfad73
Author: zhiqiang <[email protected]>
AuthorDate: Thu Jan 2 09:26:01 2025 +0800
branch-3.0: [opt] Optimization for short circuit of CompoundPred #45422
(#46240)
cherry pick from #45422
---
be/src/vec/exprs/vcompound_pred.h | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/be/src/vec/exprs/vcompound_pred.h
b/be/src/vec/exprs/vcompound_pred.h
index 9e39533a7ae..86aa9ee07d7 100644
--- a/be/src/vec/exprs/vcompound_pred.h
+++ b/be/src/vec/exprs/vcompound_pred.h
@@ -229,24 +229,27 @@ public:
auto vector_vector_null = [&]<bool is_and_op>() {
auto col_res = ColumnUInt8::create(size);
auto col_nulls = ColumnUInt8::create(size);
+
auto* __restrict res_datas =
assert_cast<ColumnUInt8*>(col_res)->get_data().data();
auto* __restrict res_nulls =
assert_cast<ColumnUInt8*>(col_nulls)->get_data().data();
ColumnPtr temp_null_map = nullptr;
// maybe both children are nullable / or one of children is
nullable
- lhs_null_map = create_null_map_column(temp_null_map, lhs_null_map);
- rhs_null_map = create_null_map_column(temp_null_map, rhs_null_map);
+ auto* __restrict lhs_null_map_tmp =
create_null_map_column(temp_null_map, lhs_null_map);
+ auto* __restrict rhs_null_map_tmp =
create_null_map_column(temp_null_map, rhs_null_map);
+ auto* __restrict lhs_data_column_tmp = lhs_data_column;
+ auto* __restrict rhs_data_column_tmp = rhs_data_column;
if constexpr (is_and_op) {
for (size_t i = 0; i < size; ++i) {
- res_nulls[i] = apply_and_null(lhs_data_column[i],
lhs_null_map[i],
- rhs_data_column[i],
rhs_null_map[i]);
- res_datas[i] = lhs_data_column[i] & rhs_data_column[i];
+ res_nulls[i] = apply_and_null(lhs_data_column_tmp[i],
lhs_null_map_tmp[i],
+ rhs_data_column_tmp[i],
rhs_null_map_tmp[i]);
+ res_datas[i] = lhs_data_column_tmp[i] &
rhs_data_column_tmp[i];
}
} else {
for (size_t i = 0; i < size; ++i) {
- res_nulls[i] = apply_or_null(lhs_data_column[i],
lhs_null_map[i],
- rhs_data_column[i],
rhs_null_map[i]);
- res_datas[i] = lhs_data_column[i] | rhs_data_column[i];
+ res_nulls[i] = apply_or_null(lhs_data_column_tmp[i],
lhs_null_map_tmp[i],
+ rhs_data_column_tmp[i],
rhs_null_map_tmp[i]);
+ res_datas[i] = lhs_data_column_tmp[i] |
rhs_data_column_tmp[i];
}
}
auto result_column = ColumnNullable::create(std::move(col_res),
std::move(col_nulls));
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]