Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
Signed-off-by: shuming.li <[email protected]>
  • Loading branch information
LiShuMing committed Aug 16, 2024
1 parent a17b580 commit eef41be
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,14 @@ public OptExpression optimize(ConnectContext connectContext,
// prepare for optimizer
prepare(connectContext, columnRefFactory, logicOperatorTree);

// prepare for mv rewrite
prepareMvRewrite(connectContext, logicOperatorTree, columnRefFactory, requiredColumns);
// try text based mv rewrite first before mv rewrite prepare so can deduce mv prepare time if it can be rewritten.
try (Timer ignored = Tracers.watchScope("MVTextRewrite")) {
logicOperatorTree = new TextMatchBasedRewriteRule(connectContext, stmt, optToAstMap)
.transform(logicOperatorTree, context).get(0);
}

// prepare for mv rewrite
prepareMvRewrite(connectContext, logicOperatorTree, columnRefFactory, requiredColumns);

logicOperatorTree = new TextMatchBasedRewriteRule(connectContext, stmt, optToAstMap)
.transform(logicOperatorTree, context).get(0);

OptExpression result = optimizerConfig.isRuleBased() ?
optimizeByRule(logicOperatorTree, requiredProperty, requiredColumns) :
optimizeByCost(connectContext, logicOperatorTree, requiredProperty, requiredColumns);
Expand Down

0 comments on commit eef41be

Please sign in to comment.