This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 1c9ce29440 [improvement]Avoid frequently allocating and releasing 
flags in InListPredicate (#10248)
1c9ce29440 is described below

commit 1c9ce294408e3d14489e62b2a3fa70d20fd9db9b
Author: Jerry Hu <mrh...@gmail.com>
AuthorDate: Mon Jun 20 09:08:02 2022 +0800

    [improvement]Avoid frequently allocating and releasing flags in 
InListPredicate (#10248)
---
 be/src/olap/in_list_predicate.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/be/src/olap/in_list_predicate.h b/be/src/olap/in_list_predicate.h
index de47a655c3..c8574092e4 100644
--- a/be/src/olap/in_list_predicate.h
+++ b/be/src/olap/in_list_predicate.h
@@ -295,8 +295,7 @@ private:
                 auto* nested_col_ptr = vectorized::check_and_get_column<
                         
vectorized::ColumnDictionary<vectorized::Int32>>(column);
                 auto& data_array = nested_col_ptr->get_data();
-                std::vector<vectorized::UInt8> selected;
-                nested_col_ptr->find_codes(_values, selected);
+                nested_col_ptr->find_codes(_values, _value_in_dict_flags);
 
                 for (uint16_t i = 0; i < *size; i++) {
                     uint16_t idx = sel[i];
@@ -310,11 +309,11 @@ private:
                     }
 
                     if constexpr (is_opposite != (PT == 
PredicateType::IN_LIST)) {
-                        if (selected[data_array[idx]]) {
+                        if (_value_in_dict_flags[data_array[idx]]) {
                             sel[new_size++] = idx;
                         }
                     } else {
-                        if (!selected[data_array[idx]]) {
+                        if (!_value_in_dict_flags[data_array[idx]]) {
                             sel[new_size++] = idx;
                         }
                     }
@@ -356,6 +355,7 @@ private:
     }
 
     phmap::flat_hash_set<T> _values;
+    mutable std::vector<vectorized::UInt8> _value_in_dict_flags;
 };
 
 template <class T>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to