Class GreedyBasedReordering
java.lang.Object
se.liu.ida.hefquin.engine.queryproc.impl.loptimizer.heuristics.GreedyBasedReordering
- All Implemented Interfaces:
HeuristicForLogicalOptimization
Implement a greedy algorithm to determine the join order of sub-plans.
For a given logical plan, when a sub-plan with LogicalOpMultiwayJoin or LogicalOpJoin as the root operator is found,
the order of sub-plans is determined by the unrestrictiveness score (so-called cost):
starting with the sub-plan with the smallest cost and continuing with the next sub-plan with the smallest cost.
Any of the defined formulas can be used for calculating the cost value to find the optimal order.
One example of such formulas is
JoinAwareWeightedUnboundVariableCount.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(LogicalPlan inputPlan) Applies this heuristics to the given plan and returns the resulting, potentially rewritten plan.protected LogicalPlanconstructBinaryPlan(List<QueryAnalyzer> selectedSubPlans) protected QueryAnalyzerfindNextPlan(List<QueryAnalyzer> selectedSubPlans, List<QueryAnalyzer> candidatePlans) protected LogicalPlanreorderSubPlans(LogicalPlan inputPlan)
-
Field Details
-
formula
-
-
Constructor Details
-
GreedyBasedReordering
-
-
Method Details
-
apply
Description copied from interface:HeuristicForLogicalOptimizationApplies this heuristics to the given plan and returns the resulting, potentially rewritten plan.- Specified by:
applyin interfaceHeuristicForLogicalOptimization
-
reorderSubPlans
-
findNextPlan
protected QueryAnalyzer findNextPlan(List<QueryAnalyzer> selectedSubPlans, List<QueryAnalyzer> candidatePlans) -
constructBinaryPlan
-