Class RulePlanJoins
- java.lang.Object
-
- org.teiid.query.optimizer.relational.rules.RulePlanJoins
-
- All Implemented Interfaces:
OptimizerRule
public class RulePlanJoins extends Object implements OptimizerRule
Determines join orderings based upon dependency and cost information The algorithm works as follows: Stage 1. Find join regions. A join region is an set of inner and cross joins (with the join and intermediate criteria removed). Dependency Phase Stage 2. Determine if dependencies found can be satisfied. a. Throw an exception if a quick check fails. Stage 3. A satisfying set of access patterns and join ordering will be found for each join region. a. If this is not possible, an exception will be thrown b. only one possible set of access patterns will be considered Optimization Phase Stage 4. Heuristically push joins down. Join regions (with more than one join source) will be exhaustively searched (bottom up) for join pairs that can be pushed to a source. a. A join is eligible for pushing if the access node can be raised and there is at least one join criteria that can also be pushed. -- costing information is not considered at this point. b. Once a pair has been pushed, they will be replaced in the join region with a single access node. Stage 5. The remaining join regions will be ordered in a left linear tree based upon a an exhaustive, or random, algorithm that considers costing and criteria information.
-
-
Field Summary
Fields Modifier and Type Field Description static int
EXHAUSTIVE_SEARCH_GROUPS
-
Constructor Summary
Constructors Constructor Description RulePlanJoins()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PlanNode
execute(PlanNode plan, QueryMetadataInterface metadata, CapabilitiesFinder capabilitiesFinder, RuleStack rules, AnalysisRecord analysisRecord, CommandContext context)
String
toString()
-
-
-
Field Detail
-
EXHAUSTIVE_SEARCH_GROUPS
public static final int EXHAUSTIVE_SEARCH_GROUPS
- See Also:
- Constant Field Values
-
-
Method Detail
-
execute
public PlanNode execute(PlanNode plan, QueryMetadataInterface metadata, CapabilitiesFinder capabilitiesFinder, RuleStack rules, AnalysisRecord analysisRecord, CommandContext context) throws QueryPlannerException, QueryMetadataException, TeiidComponentException
- Specified by:
execute
in interfaceOptimizerRule
- Throws:
QueryPlannerException
QueryMetadataException
TeiidComponentException
- See Also:
OptimizerRule.execute(org.teiid.query.optimizer.relational.plantree.PlanNode, org.teiid.query.metadata.QueryMetadataInterface, org.teiid.query.optimizer.capabilities.CapabilitiesFinder, org.teiid.query.optimizer.relational.RuleStack, org.teiid.query.analysis.AnalysisRecord, org.teiid.query.util.CommandContext)
-
toString
public String toString()
- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
-