This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch tpch500
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/tpch500 by this push:
new 79d6f40c537 Revert "[tmp] [opt](performance) Opt the null column query
performance #28809"
79d6f40c537 is described below
commit 79d6f40c537b8b90365f12d6e94377528edf45ea
Author: morningman <[email protected]>
AuthorDate: Thu Dec 28 17:23:11 2023 +0800
Revert "[tmp] [opt](performance) Opt the null column query performance
#28809"
This reverts commit 99ff64802ed41c1fe25bd3c3e7a5cc0fcc07d9e0.
---
be/src/exec/exec_node.cpp | 5 ++---
be/src/vec/aggregate_functions/aggregate_function_null.h | 16 ++++------------
be/src/vec/columns/column_nullable.h | 2 --
3 files changed, 6 insertions(+), 17 deletions(-)
diff --git a/be/src/exec/exec_node.cpp b/be/src/exec/exec_node.cpp
index b7e891fe29e..4681218dcae 100644
--- a/be/src/exec/exec_node.cpp
+++ b/be/src/exec/exec_node.cpp
@@ -557,11 +557,10 @@ Status ExecNode::do_projections(vectorized::Block*
origin_block, vectorized::Blo
reinterpret_cast<ColumnNullable*>(mutable_columns[i].get())
->insert_range_from_not_nullable(*column_ptr, 0, rows);
} else {
- std::swap(output_block->get_by_position(i).column,
-
origin_block->get_by_position(result_column_id).column);
+ mutable_columns[i]->insert_range_from(*column_ptr, 0, rows);
}
}
- DCHECK(output_block->rows() == rows);
+ DCHECK(mutable_block.rows() == rows);
}
return Status::OK();
diff --git a/be/src/vec/aggregate_functions/aggregate_function_null.h
b/be/src/vec/aggregate_functions/aggregate_function_null.h
index c5a7130fd2c..285c017e4ff 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_null.h
+++ b/be/src/vec/aggregate_functions/aggregate_function_null.h
@@ -213,23 +213,15 @@ public:
void add_batch(size_t batch_size, AggregateDataPtr* __restrict places,
size_t place_offset,
const IColumn** columns, Arena* arena, bool agg_many) const
override {
const ColumnNullable* column = assert_cast<const
ColumnNullable*>(columns[0]);
+ // The overhead introduced is negligible here, just an extra memory
read from NullMap
+ const auto* __restrict null_map_data =
column->get_null_map_data().data();
const IColumn* nested_column = &column->get_nested_column();
- if (column->can_skip_null_check()) {
- for (int i = 0; i < batch_size; ++i) {
+ for (int i = 0; i < batch_size; ++i) {
+ if (!null_map_data[i]) {
AggregateDataPtr __restrict place = places[i] + place_offset;
this->set_flag(place);
this->nested_function->add(this->nested_place(place),
&nested_column, i, arena);
}
- } else {
- // The overhead introduced is negligible here, just an extra
memory read from NullMap
- const auto* __restrict null_map_data =
column->get_null_map_data().data();
- for (int i = 0; i < batch_size; ++i) {
- if (!null_map_data[i]) {
- AggregateDataPtr __restrict place = places[i] +
place_offset;
- this->set_flag(place);
- this->nested_function->add(this->nested_place(place),
&nested_column, i, arena);
- }
- }
}
}
diff --git a/be/src/vec/columns/column_nullable.h
b/be/src/vec/columns/column_nullable.h
index ff2e1dbfc22..10b0951ab8b 100644
--- a/be/src/vec/columns/column_nullable.h
+++ b/be/src/vec/columns/column_nullable.h
@@ -325,8 +325,6 @@ public:
/// Check that size of null map equals to size of nested column.
void check_consistency() const;
- bool can_skip_null_check() const { return !_need_update_has_null &&
!_has_null; }
-
bool has_null() const override {
if (UNLIKELY(_need_update_has_null)) {
const_cast<ColumnNullable*>(this)->_update_has_null();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]