batch patch to opensource

This commit is contained in:
raywill
2021-09-22 19:31:35 +08:00
committed by wangzelin.wzl
parent b276491a6c
commit b2e66c1cd8
7 changed files with 29 additions and 8 deletions

View File

@ -304,10 +304,6 @@ int ObOptimizer::check_pdml_supported_feature(const ObDMLStmt& stmt, const ObSQL
} else if (table_schema->get_foreign_key_infos().count() > 0) {
LOG_TRACE("dml has foreign key, disable pdml", K(ret));
is_use_pdml = false;
} else if (stmt::T_DELETE == stmt.get_stmt_type()) {
// https://code.aone.alibaba-inc.com/oceanbase/oceanbase/codereview/5345309
// if no trigger, no foreign key, delete can do pdml, even if with local unique index
is_use_pdml = true;
} else if (!session.use_static_typing_engine() && stmt.get_check_constraint_exprs_size() > 0) {
LOG_TRACE("dml has constraint, old engine, disable pdml", K(ret));
is_use_pdml = false;

View File

@ -182,10 +182,22 @@ int ObPxResourceAnalyzer::analyze(ObLogicalOperator& root_op, int64_t& max_paral
LOG_WARN("fail convert log plan to nested px tree", K(ret));
} else if (OB_FAIL(walk_through_px_trees(px_trees, max_parallel_thread_group_count))) {
LOG_WARN("fail calc max parallel thread group count for resource reservation", K(ret));
} else {
release();
}
return ret;
}
void ObPxResourceAnalyzer::release()
{
for (int64_t i = 0; i < dfos_.count(); ++i) {
DfoInfo* dfo = dfos_.at(i);
if (OB_LIKELY(nullptr != dfo)) {
dfo->~DfoInfo();
}
}
}
int ObPxResourceAnalyzer::convert_log_plan_to_nested_px_tree(ObIArray<PxInfo>& px_trees, ObLogicalOperator& root_op)
{
int ret = OB_SUCCESS;
@ -296,6 +308,8 @@ int ObPxResourceAnalyzer::create_dfo(DfoInfo*& dfo, int64_t dop)
} else if (nullptr == (dfo = new (mem_ptr) DfoInfo())) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("Null ptr unexpected", KP(mem_ptr), K(ret));
} else if (OB_FAIL(dfos_.push_back(dfo))) {
LOG_WARN("fail push dfo. no memory!", K(ret));
} else {
dfo->set_dop(dop);
}

View File

@ -139,10 +139,12 @@ private:
int walk_through_px_trees(common::ObIArray<PxInfo>& px_trees, int64_t& max_parallel_thread_group_count);
int walk_through_dfo_tree(PxInfo& px_root, int64_t& max_parallel_thread_group_count);
int create_dfo(DfoInfo*& dfo, int64_t dop);
void release();
private:
/* variables */
common::ObArenaAllocator dfo_allocator_;
common::ObArray<DfoInfo*> dfos_;
DISALLOW_COPY_AND_ASSIGN(ObPxResourceAnalyzer);
};