From 811f019e471f7fc08ce8fa7b341f0040fbe9a570 Mon Sep 17 00:00:00 2001 From: shee <13843187+qzsee@users.noreply.github.com> Date: Fri, 6 May 2022 17:43:14 -0700 Subject: [PATCH] [performance][query]improve the performance of DISTINCT aggregation by using flat hash set replace unordered set (#9401) Co-authored-by: shizhiqiang03 --- be/src/exprs/aggregate_functions.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/be/src/exprs/aggregate_functions.cpp b/be/src/exprs/aggregate_functions.cpp index 590e07838a..257aca4a38 100644 --- a/be/src/exprs/aggregate_functions.cpp +++ b/be/src/exprs/aggregate_functions.cpp @@ -1346,7 +1346,8 @@ private: } }; - std::unordered_set _set; + phmap::flat_hash_set _set; + // Because Anyval does not provide the hash function, in order // to adopt the type different from the template, the pointer is used // HybridSetBase* _set; @@ -1503,7 +1504,8 @@ public: private: const int DECIMAL_BYTE_SIZE = 16; - std::unordered_set _set; + phmap::flat_hash_set _set; + FunctionContext::Type _type; }; @@ -1588,7 +1590,8 @@ private: const int DATETIME_PACKED_TIME_BYTE_SIZE = 8; const int DATETIME_TYPE_BYTE_SIZE = 4; - std::unordered_set _set; + phmap::flat_hash_set _set; + FunctionContext::Type _type; };