com.metamatrix.query.optimizer.relational.rules
Class RulePlanJoins
java.lang.Object
com.metamatrix.query.optimizer.relational.rules.RulePlanJoins
- All Implemented Interfaces:
- OptimizerRule
public class RulePlanJoins
- extends java.lang.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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
EXHAUSTIVE_SEARCH_GROUPS
public static final int EXHAUSTIVE_SEARCH_GROUPS
- See Also:
- Constant Field Values
RulePlanJoins
public RulePlanJoins()
execute
public PlanNode execute(PlanNode plan,
QueryMetadataInterface metadata,
CapabilitiesFinder capabilitiesFinder,
RuleStack rules,
AnalysisRecord analysisRecord,
CommandContext context)
throws QueryPlannerException,
QueryMetadataException,
MetaMatrixComponentException
- Specified by:
execute
in interface OptimizerRule
- Throws:
QueryPlannerException
QueryMetadataException
MetaMatrixComponentException
- See Also:
OptimizerRule.execute(com.metamatrix.query.optimizer.relational.plantree.PlanNode, com.metamatrix.query.metadata.QueryMetadataInterface, com.metamatrix.query.optimizer.capabilities.CapabilitiesFinder, com.metamatrix.query.optimizer.relational.RuleStack, com.metamatrix.query.analysis.AnalysisRecord, com.metamatrix.query.util.CommandContext)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
- See Also:
Object.toString()
Copyright © 2009. All Rights Reserved.