update rewrite rules

* adjust re est cost for nestloop semi/anti join

* add threshold for cost base transform
This commit is contained in:
zs
2021-06-16 11:36:24 +08:00
committed by MizuhaHimuraki
parent cbeee6568e
commit 03001c1fe3
6 changed files with 70 additions and 84 deletions

View File

@ -167,7 +167,7 @@ int ObTransformRule::accept_transform(
LOG_WARN("failed to evaluate cost for the origin stmt", K(ret));
}
if (OB_SUCC(ret)) {
if (trans_stmt_cost < stmt_cost_) {
if (trans_stmt_cost < stmt_cost_ * COST_BASE_TRANSFORM_THRESHOLD) {
LOG_TRACE("accept transform because the cost is decreased", K_(stmt_cost), K(trans_stmt_cost));
stmt = trans_stmt;
stmt_cost_ = trans_stmt_cost;

View File

@ -129,6 +129,7 @@ struct ObParentDMLStmt {
class ObTransformRule {
public:
static constexpr const double COST_BASE_TRANSFORM_THRESHOLD = 0.999;
static const int64_t TRANSFORMER_DEFAULT_MAX_RECURSIVE_LEVEL = 150;
static const uint64_t ALL_TRANSFORM_RULES = TRANSFORM_TYPE_COUNT_PLUS_ONE - 1;
static const uint64_t ALL_HEURISTICS_RULES = SIMPLIFY | ANYALL | AGGR | ELIMINATE_OJ | VIEW_MERGE | WHERE_SQ_PULL_UP |