1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-10-31 18:30:33 +03:00

feat(rbo,rules): rule matcher has been replaced with csep filter for a rule to relax rule filter predicates and endless loop has been fixed in pushdown predicates.

This commit is contained in:
drrtuy
2025-08-08 12:44:29 +00:00
committed by Leonid Fedorov
parent 67ac7f2f75
commit bbac8e70a1
7 changed files with 43 additions and 30 deletions

View File

@@ -42,14 +42,16 @@ public:
struct Rule
{
using RuleMatcher = bool (*)(execplan::CalpontSelectExecutionPlan&);
using RuleApplier = void (*)(execplan::CalpontSelectExecutionPlan&, RBOptimizerContext&);
// returns true if rule may be applied
using RuleApplierFilter = bool (*)(execplan::CalpontSelectExecutionPlan&);
// returns true if rule was applied
using RuleApplier = bool (*)(execplan::CalpontSelectExecutionPlan&, RBOptimizerContext&);
Rule(std::string&& name, RuleMatcher matchRule, RuleApplier applyRule)
: name(name), matchRule(matchRule), applyRule(applyRule) {};
Rule(std::string&& name, RuleApplierFilter mayApply, RuleApplier applyRule)
: name(name), mayApply(mayApply), applyRule(applyRule) {};
std::string name;
RuleMatcher matchRule;
RuleApplierFilter mayApply;
RuleApplier applyRule;
// TODO Wrap CSEP into Nodes to be able to navigate up and down the tree and remove this flag
bool applyOnlyOnce = true;