@Immutable public class RewriteIdentityJoins extends Object implements OptimizerRule
optimizer rule
that rewrites JOIN nodes that have equi-join criteria
where
the columns involved in the equi-join are all identity columns (that is, they form a
key
for the table). This rewrite only happens when the left
and right children of the JOIN node are both SOURCE nodes.
The basic idea is that in these identity equi-join cases, the following structure:
... | JOIN / \ / \ SOURCE SOURCEis transformed into a simple SOURCE node:
... | SOURCENote that this rewriting removes a selector, and thus the nodes above the JOIN node that made use of the removed selector are also modified to reference the remaining selector.
Modifier and Type | Field and Description |
---|---|
static RewriteIdentityJoins |
INSTANCE |
Constructor and Description |
---|
RewriteIdentityJoins() |
Modifier and Type | Method and Description |
---|---|
PlanNode |
execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack)
Optimize the supplied plan using the supplied context, hints, and yet-to-be-run rules.
|
protected void |
rewriteJoinNode(QueryContext context,
PlanNode joinNode,
Map<SelectorName,SelectorName> rewrittenSelectors) |
String |
toString() |
public static final RewriteIdentityJoins INSTANCE
public PlanNode execute(QueryContext context, PlanNode plan, LinkedList<OptimizerRule> ruleStack)
OptimizerRule
execute
in interface OptimizerRule
context
- the context in which the query is being optimized; never nullplan
- the plan to be optimized; never nullruleStack
- the stack of rules that will be run after this rule; never nullprotected void rewriteJoinNode(QueryContext context, PlanNode joinNode, Map<SelectorName,SelectorName> rewrittenSelectors)
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.