You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-10-31 18:30:33 +03:00
chore(rbo): simplistic rulle application logging.
This commit is contained in:
@@ -7478,7 +7478,7 @@ int cs_get_select_plan(ha_columnstore_select_handler* handler, THD* thd, SCSEP&
|
||||
derivedTableOptimization(&gwi, csep);
|
||||
|
||||
{
|
||||
optimizer::RBOptimizerContext ctx(gwi, *thd);
|
||||
optimizer::RBOptimizerContext ctx(gwi, *thd, csep->traceOn());
|
||||
bool csepWasOptimized = optimizer::optimizeCSEP(*csep, ctx);
|
||||
if (csep->traceOn() && csepWasOptimized)
|
||||
{
|
||||
|
||||
@@ -55,11 +55,11 @@ bool optimizeCSEP(execplan::CalpontSelectExecutionPlan& root, optimizer::RBOptim
|
||||
|
||||
if (get_unstable_optimizer(&ctx.thd))
|
||||
{
|
||||
optimizer::Rule parallelCES{"parallelCES", optimizer::parallelCESFilter, optimizer::applyParallelCES};
|
||||
optimizer::Rule parallelCES{"parallel_ces", optimizer::parallelCESFilter, optimizer::applyParallelCES};
|
||||
rules.push_back(parallelCES);
|
||||
}
|
||||
|
||||
optimizer::Rule predicatePushdown{"predicatePushdown", optimizer::predicatePushdownFilter,
|
||||
optimizer::Rule predicatePushdown{"predicate_pushdown", optimizer::predicatePushdownFilter,
|
||||
optimizer::applyPredicatePushdown};
|
||||
rules.push_back(predicatePushdown);
|
||||
|
||||
@@ -76,6 +76,10 @@ bool Rule::apply(execplan::CalpontSelectExecutionPlan& root, optimizer::RBOptimi
|
||||
{
|
||||
changedThisRound = walk(root, ctx);
|
||||
hasBeenApplied |= changedThisRound;
|
||||
if (ctx.logRules)
|
||||
{
|
||||
std::cout << "MCS RBO: " << name << " has been applied this round." << std::endl;
|
||||
}
|
||||
} while (changedThisRound && !applyOnlyOnce);
|
||||
|
||||
return hasBeenApplied;
|
||||
|
||||
@@ -32,12 +32,13 @@ namespace optimizer {
|
||||
class RBOptimizerContext {
|
||||
public:
|
||||
RBOptimizerContext() = delete;
|
||||
RBOptimizerContext(cal_impl_if::gp_walk_info& walk_info, THD& thd) : gwi(walk_info), thd(thd) {}
|
||||
RBOptimizerContext(cal_impl_if::gp_walk_info& walk_info, THD& thd, bool logRules) : gwi(walk_info), thd(thd), logRules(logRules) {}
|
||||
// gwi lifetime should be longer than optimizer context.
|
||||
// In plugin runtime this is always true.
|
||||
cal_impl_if::gp_walk_info& gwi;
|
||||
THD& thd;
|
||||
uint64_t uniqueId {0};
|
||||
bool logRules {false};
|
||||
};
|
||||
|
||||
struct Rule
|
||||
|
||||
Reference in New Issue
Block a user