1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-11-02 06:13:16 +03:00

chore(rbo,rules): fixed lost flag value result back propagation to resolve RBO logging and added recursive passes for projection list optimization.

This commit is contained in:
drrtuy
2025-08-12 15:24:11 +00:00
committed by Leonid Fedorov
parent fa76344cfc
commit 578c2b1db1
2 changed files with 8 additions and 2 deletions

View File

@@ -188,6 +188,12 @@ void derivedTableOptimization(gp_walk_info* gwip, SCSEP& csep)
} }
} }
} }
// recursively process the nested derived table
for (uint i = 0; i < csep->subSelectList().size(); i++)
{
SCSEP subselect(boost::dynamic_pointer_cast<CalpontSelectExecutionPlan>(csep->subSelectList()[i]));
derivedTableOptimization(gwip, subselect);
}
} }
FromSubQuery::FromSubQuery(gp_walk_info& gwip) : SubQuery(gwip) FromSubQuery::FromSubQuery(gp_walk_info& gwip) : SubQuery(gwip)

View File

@@ -76,7 +76,7 @@ bool Rule::apply(execplan::CalpontSelectExecutionPlan& root, optimizer::RBOptimi
{ {
changedThisRound = walk(root, ctx); changedThisRound = walk(root, ctx);
hasBeenApplied |= changedThisRound; hasBeenApplied |= changedThisRound;
if (ctx.logRules) if (ctx.logRules && changedThisRound)
{ {
std::cout << "MCS RBO: " << name << " has been applied this round." << std::endl; std::cout << "MCS RBO: " << name << " has been applied this round." << std::endl;
} }
@@ -132,7 +132,7 @@ bool Rule::walk(execplan::CalpontSelectExecutionPlan& csep, optimizer::RBOptimiz
if (mayApply(*current)) if (mayApply(*current))
{ {
rewrite = applyRule(*current, ctx); rewrite |= applyRule(*current, ctx);
++ctx.uniqueId; ++ctx.uniqueId;
} }
} }