opt adaptive hash gby calc simple aggr func (count/sum/min/max)

This commit is contained in:
obdev
2022-11-03 11:10:27 +00:00
committed by wangzelin.wzl
parent 92fffa7357
commit 741643eb40
8 changed files with 255 additions and 51 deletions

View File

@ -4969,8 +4969,12 @@ int ObStaticEngineCG::fill_aggr_infos(ObLogGroupBy &op,
}
//4.add aggr columns
spec.support_fast_single_row_agg_ = true;
for (int64_t i = 0; OB_SUCC(ret) && i < all_aggr_exprs.count(); ++i) {
ObAggrInfo &aggr_info = spec.aggr_infos_.at(i);
if (!is_simple_aggr_expr(aggr_exprs.at(i)->get_expr_type())) {
spec.support_fast_single_row_agg_ = false;
}
if (OB_FAIL(fill_aggr_info(*static_cast<ObAggFunRawExpr *>(aggr_exprs.at(i)),
*all_aggr_exprs.at(i),
aggr_info,

View File

@ -457,6 +457,10 @@ private:
int add_output_datum_check_flag(ObOpSpec &spec);
int generate_calc_part_id_expr(const ObRawExpr &src, const ObDASTableLocMeta *loc_meta, ObExpr *&dst);
int check_only_one_unique_key(const ObLogPlan &log_plan, const ObTableSchema* table_schema, bool& only_one_unique_key);
bool is_simple_aggr_expr(const ObItemType &expr_type) { return T_FUN_COUNT == expr_type
|| T_FUN_SUM == expr_type
|| T_FUN_MAX == expr_type
|| T_FUN_MIN == expr_type; }
private:
ObPhysicalPlan *phy_plan_;
ObOptimizerContext *opt_ctx_;