You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by ga...@apache.org on 2026/04/30 01:43:43 UTC

(doris) branch master updated: [Improvement](minor) Reduce memory in predicates (#62794)

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

Gabriel39 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 0a40a41b671 [Improvement](minor) Reduce memory in predicates (#62794)
0a40a41b671 is described below

commit 0a40a41b6715489fc78b26b25f2b7644b8e55e15
Author: Gabriel <li...@selectdb.com>
AuthorDate: Thu Apr 30 09:43:35 2026 +0800

    [Improvement](minor) Reduce memory in predicates (#62794)
---
 be/src/storage/predicate/in_list_predicate.h | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/be/src/storage/predicate/in_list_predicate.h b/be/src/storage/predicate/in_list_predicate.h
index 3f8906d045b..cfe4f8ed794 100644
--- a/be/src/storage/predicate/in_list_predicate.h
+++ b/be/src/storage/predicate/in_list_predicate.h
@@ -93,11 +93,9 @@ public:
             while (iter->has_next()) {
                 const auto* value = (const StringRef*)(iter->get_value());
                 if constexpr (Type == TYPE_CHAR) {
-                    _temp_datas.emplace_back("");
-                    _temp_datas.back().resize(std::max(char_length, value->size));
-                    memcpy(_temp_datas.back().data(), value->data, value->size);
-                    const std::string& str = _temp_datas.back();
-                    _values->insert((void*)str.data(), str.length());
+                    std::string padded(std::max(char_length, value->size), '\0');
+                    memcpy(padded.data(), value->data, value->size);
+                    _values->insert((void*)padded.data(), padded.length());
                 } else {
                     _values->insert((void*)value->data, value->size);
                 }
@@ -128,7 +126,6 @@ public:
         _values = other._values;
         _min_value = other._min_value;
         _max_value = other._max_value;
-        _temp_datas = other._temp_datas;
         DCHECK(_segment_id_to_value_in_dict_flags.empty());
     }
     InListPredicateBase(const InListPredicateBase<Type, PT, N>& other) = delete;
@@ -658,8 +655,5 @@ private:
             _segment_id_to_value_in_dict_flags;
     T _min_value;
     T _max_value;
-
-    // temp string for char type column
-    std::list<std::string> _temp_datas;
 };
 } //namespace doris


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