From 1a0e793ec13c1759fc7bccc5e856fda7d75e82ab Mon Sep 17 00:00:00 2001 From: lucky-sinx <2549261744@qq.com> Date: Wed, 26 Jun 2024 15:46:29 +0000 Subject: [PATCH] =?UTF-8?q?serialization=20occupy=20in=20mergegroupby?= =?UTF-8?q?=E3=80=81windowfunction=E3=80=81hashgroupby?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sql/engine/aggregate/ob_groupby_op.cpp | 1 + src/sql/engine/aggregate/ob_groupby_op.h | 2 ++ src/sql/engine/aggregate/ob_merge_groupby_op.cpp | 4 +++- src/sql/engine/aggregate/ob_merge_groupby_op.h | 6 +++++- src/sql/engine/window_function/ob_window_function_op.cpp | 3 ++- src/sql/engine/window_function/ob_window_function_op.h | 4 +++- 6 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/sql/engine/aggregate/ob_groupby_op.cpp b/src/sql/engine/aggregate/ob_groupby_op.cpp index 03298edffd..1e01b153b7 100644 --- a/src/sql/engine/aggregate/ob_groupby_op.cpp +++ b/src/sql/engine/aggregate/ob_groupby_op.cpp @@ -34,6 +34,7 @@ OB_SERIALIZE_MEMBER((ObGroupBySpec, ObOpSpec), aggr_code_expr_, by_pass_enabled_, support_fast_single_row_agg_, + skew_detection_enabled_, // FARM COMPAT WHITELIST llc_ndv_est_enabled_); DEF_TO_STRING(ObGroupBySpec) diff --git a/src/sql/engine/aggregate/ob_groupby_op.h b/src/sql/engine/aggregate/ob_groupby_op.h index c6dbd67e0b..2a2764d2fc 100644 --- a/src/sql/engine/aggregate/ob_groupby_op.h +++ b/src/sql/engine/aggregate/ob_groupby_op.h @@ -36,6 +36,7 @@ public: aggr_code_expr_(nullptr), by_pass_enabled_(false), support_fast_single_row_agg_(false), + skew_detection_enabled_(false), llc_ndv_est_enabled_(false) { } @@ -59,6 +60,7 @@ public: bool by_pass_enabled_; // COUNT/SUM/MIN/MAX can use fast single row agg bool support_fast_single_row_agg_; + bool skew_detection_enabled_; bool llc_ndv_est_enabled_; }; diff --git a/src/sql/engine/aggregate/ob_merge_groupby_op.cpp b/src/sql/engine/aggregate/ob_merge_groupby_op.cpp index 3df96d4b0a..174c6d213c 100644 --- a/src/sql/engine/aggregate/ob_merge_groupby_op.cpp +++ b/src/sql/engine/aggregate/ob_merge_groupby_op.cpp @@ -37,7 +37,9 @@ OB_SERIALIZE_MEMBER((ObMergeGroupBySpec, ObGroupBySpec), sort_exprs_, sort_collations_, sort_cmp_funcs_, - enable_encode_sort_ + enable_encode_sort_, + est_rows_per_group_, + enable_hash_base_distinct_ ); DEF_TO_STRING(ObMergeGroupBySpec) diff --git a/src/sql/engine/aggregate/ob_merge_groupby_op.h b/src/sql/engine/aggregate/ob_merge_groupby_op.h index ee4d5a932c..eb2a912826 100644 --- a/src/sql/engine/aggregate/ob_merge_groupby_op.h +++ b/src/sql/engine/aggregate/ob_merge_groupby_op.h @@ -40,7 +40,9 @@ public: sort_exprs_(alloc), sort_collations_(alloc), sort_cmp_funcs_(alloc), - enable_encode_sort_(false) + enable_encode_sort_(false), + est_rows_per_group_(0), + enable_hash_base_distinct_(false) { } @@ -79,6 +81,8 @@ public: ObSortCollations sort_collations_; ObSortFuncs sort_cmp_funcs_; bool enable_encode_sort_; + int64_t est_rows_per_group_; + bool enable_hash_base_distinct_; }; // 输入数据已经按照groupby列排序 diff --git a/src/sql/engine/window_function/ob_window_function_op.cpp b/src/sql/engine/window_function/ob_window_function_op.cpp index b16df3cd44..09a85cc3c3 100644 --- a/src/sql/engine/window_function/ob_window_function_op.cpp +++ b/src/sql/engine/window_function/ob_window_function_op.cpp @@ -72,7 +72,8 @@ OB_SERIALIZE_MEMBER((ObWindowFunctionSpec, ObOpSpec), role_type_, wf_aggr_status_expr_, input_rows_mem_bound_ratio_, - estimated_part_cnt_); + estimated_part_cnt_, + enable_hash_base_distinct_); OB_SERIALIZE_MEMBER(ObWindowFunctionOpInput, local_task_count_, total_task_count_, wf_participator_shared_info_); diff --git a/src/sql/engine/window_function/ob_window_function_op.h b/src/sql/engine/window_function/ob_window_function_op.h index 0d44232fe2..ae81035f6c 100644 --- a/src/sql/engine/window_function/ob_window_function_op.h +++ b/src/sql/engine/window_function/ob_window_function_op.h @@ -229,7 +229,8 @@ public: role_type_(0), wf_aggr_status_expr_(NULL), input_rows_mem_bound_ratio_(0.5), - estimated_part_cnt_(1) + estimated_part_cnt_(1), + enable_hash_base_distinct_(false) { } DECLARE_VIRTUAL_TO_STRING; @@ -293,6 +294,7 @@ public: // The percentage of memory used by input_rows to the total memory used by input_rows and res_rows double input_rows_mem_bound_ratio_; int64_t estimated_part_cnt_; + bool enable_hash_base_distinct_; private: // disallow copy