Add tp to force group by pushdown to storage layer

This commit is contained in:
XIAO-HOU 2024-08-12 15:44:42 +00:00 committed by ob-robot
parent 3d3db4c67f
commit 5c56b88b5b

View File

@ -91,6 +91,9 @@ using share::schema::ObColumnSchemaV2;
using share::schema::ObSchemaGetterGuard;
#include "sql/optimizer/ob_join_property.map"
ERRSIM_POINT_DEF(EN_FORCE_GBY_PUSHDOWN_STORAGE, "force pushdown group by to storage layer");
static const char *ExplainColumnName[] =
{
"ID",
@ -5933,7 +5936,7 @@ int ObLogPlan::check_storage_groupby_pushdown(const ObIArray<ObAggFunRawExpr *>
can_push = false;
} else if (group_exprs.count() != 1) {
can_push = false;
} else if (aggrs.count() > 5) {
} else if (OB_LIKELY(!EN_FORCE_GBY_PUSHDOWN_STORAGE) && aggrs.count() > 5) {
can_push = false;
} else if (OB_ISNULL(groupby_column = group_exprs.at(0))) {
ret = OB_ERR_UNEXPECTED;
@ -5994,6 +5997,9 @@ int ObLogPlan::check_table_columns_can_storage_pushdown(const uint64_t tenant_id
OB_UNLIKELY(!pushdown_groupby_columns.at(0)->is_column_ref_expr())) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("get unexpected null", K(ret));
} else if (OB_UNLIKELY(EN_FORCE_GBY_PUSHDOWN_STORAGE)) {
can_push = true;
LOG_TRACE("force pushdown group by to storage layer", K(ret), K(can_push));
} else if (OB_FALSE_IT(column = static_cast<ObColumnRefRawExpr*>(pushdown_groupby_columns.at(0)))) {
} else if (!ObColumnStatParam::is_valid_opt_col_type(column->get_data_type())) {
can_push = false;