to show ddl logical plan.

This commit is contained in:
obdev
2023-06-08 04:42:19 +00:00
committed by ob-robot
parent 30b4cfd39a
commit 7fcdd9533f
2 changed files with 17 additions and 4 deletions

View File

@ -3212,10 +3212,6 @@ int ObStaticEngineCG::generate_spec(ObLogExchange &op, ObPxFifoCoordSpec &spec,
LOG_WARN("failed to generate basic transmit spec", K(ret));
} else if (OB_FAIL(generate_dynamic_sample_spec_if_need(op, spec))) {
LOG_WARN("generate px_coord_spec for dynamic sample failed", K(ret));
} else {
if (op.get_plan()->get_optimizer_context().is_online_ddl()) {
LOG_INFO("ddl plan", K(*op.get_plan()));
}
}
return ret;
}

View File

@ -3060,6 +3060,23 @@ int ObSql::generate_plan(ParseResult &parse_result,
} else if (OB_FAIL(prepare_outline_for_phy_plan(logical_plan,
phy_plan))) {
LOG_WARN("failed to prepare outline for phy plan", K(ret));
} else if (logical_plan->get_optimizer_context().is_online_ddl()) {
int tmp_ret = OB_SUCCESS;
ObExplainDisplayOpt option;
option.with_tree_line_ = false;
ObSqlPlan sql_plan(logical_plan->get_allocator());
ObSEArray<common::ObString, 64> plan_strs;
if (OB_TMP_FAIL(sql_plan.print_sql_plan(logical_plan,
EXPLAIN_EXTENDED,
option,
plan_strs))) {
LOG_WARN("failed to store sql plan", K(tmp_ret));
} else {
LOG_INFO("ddl plan");
for (int64_t i = 0; OB_SUCCESS == tmp_ret && i < plan_strs.count(); i++) {
_OB_LOG(INFO, "%*s", plan_strs.at(i).length(), plan_strs.at(i).ptr());
}
}
}
END_OPT_TRACE(session_info);
if (OB_SUCC(ret) && session_info->is_user_session()) {