|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.rel.AbstractRelNode org.eigenbase.relopt.volcano.RelSubset
public class RelSubset
A RelSubset
is set of expressions in a set which have the same
calling convention. An expression may be in more than one sub-set of a set;
the same expression is used.
Nested Class Summary | |
---|---|
(package private) class |
RelSubset.CheapestPlanReplacer
Visitor which walks over a tree of RelSet s, replacing each node
with the cheapest implementation of the expression. |
Field Summary | |
---|---|
(package private) boolean |
active
whether findBestPlan is being called |
(package private) RelNode |
best
best known plan |
(package private) RelOptCost |
bestCost
cost of best known plan (it may have improved since) |
(package private) boolean |
boosted
Flag indicating whether this RelSubset's importance was artificially boosted. |
(package private) List<RelNode> |
parents
List of the relational expressions for which this subset is an input. |
(package private) List<RelNode> |
rels
The relational expressions in this subset. |
(package private) RelSet |
set
The set this subset belongs to. |
(package private) long |
timestamp
Timestamp for metadata validity |
private static Logger |
tracer
|
Fields inherited from class org.eigenbase.rel.AbstractRelNode |
---|
digest, id, rowType, traits |
Fields inherited from interface org.eigenbase.rel.RelNode |
---|
emptyArray |
Constructor Summary | |
---|---|
RelSubset(RelOptCluster cluster,
RelSet set,
RelTraitSet traits)
|
Method Summary | |
---|---|
(package private) void |
add(RelNode rel)
Adds expression rel to this subset. |
(package private) RelNode |
buildCheapestPlan(VolcanoPlanner planner)
Recursively builds a tree consisting of the cheapest plan at each node. |
RelSubset |
clone()
A RelSubSet is its own clone. |
void |
collectVariablesSet(Set<String> variableSet)
Collects variables set by this expression. |
void |
collectVariablesUsed(Set<String> variableSet)
Collects variables known to be used by this expression or its descendants. |
protected String |
computeDigest()
Computes the digest. |
RelOptCost |
computeSelfCost(RelOptPlanner planner)
Returns the cost of this plan (not including children). |
protected RelDataType |
deriveRowType()
|
void |
explain(RelOptPlanWriter pw)
|
RelNode |
getBest()
|
(package private) Collection<RelSubset> |
getParentSubsets()
|
List<RelNode> |
getRels()
Returns the rel nodes in this rel subset. |
double |
getRows()
Returns an estimate of the number of rows this relational expression will return. |
(package private) RelSet |
getSet()
|
Set<String> |
getVariablesSet()
There are no children, as such. |
Set<String> |
getVariablesUsed()
|
boolean |
isDistinct()
Returns whether the same value will not come out twice. |
void |
propagateBoostRemoval(VolcanoPlanner planner)
|
(package private) void |
propagateCostImprovements(VolcanoPlanner planner,
RelNode rel,
Set<RelSubset> activeSet)
Checks whether a relexp has made its subset cheaper, and if it so, recursively checks whether that subset's parents have gotten cheaper. |
Methods inherited from class org.eigenbase.rel.AbstractRelNode |
---|
childrenAccept, cloneTraits, getChildExps, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getInputs, getOrCreateCorrelVariable, getQuery, getRelTypeName, getRowType, getTable, getTraits, getVariablesStopped, inheritTraitsFrom, isAccessTo, isValid, onRegister, recomputeDigest, register, registerCorrelVariable, replaceInput, setCorrelVariable, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final Logger tracer
final List<RelNode> parents
final List<RelNode> rels
RelOptCost bestCost
final RelSet set
RelNode best
boolean active
long timestamp
boolean boosted
Constructor Detail |
---|
RelSubset(RelOptCluster cluster, RelSet set, RelTraitSet traits)
Method Detail |
---|
public Set<String> getVariablesSet()
RelSubset
s.
public Set<String> getVariablesUsed()
public RelNode getBest()
public RelSubset clone()
RelSubSet
is its own clone.
clone
in interface RelNode
clone
in class AbstractRelNode
public RelOptCost computeSelfCost(RelOptPlanner planner)
RelNode
NOTE jvs 29-Mar-2006: Don't call this method directly. Instead, use
RelMetadataQuery.getNonCumulativeCost(org.eigenbase.rel.RelNode)
, which gives plugins a
chance to override the rel's default ideas about cost.
computeSelfCost
in interface RelNode
computeSelfCost
in class AbstractRelNode
public double getRows()
RelNode
NOTE jvs 29-Mar-2006: Don't call this method directly. Instead, use
RelMetadataQuery.getRowCount(org.eigenbase.rel.RelNode)
, which gives plugins a chance to
override the rel's default ideas about row count.
getRows
in interface RelNode
getRows
in class AbstractRelNode
public void explain(RelOptPlanWriter pw)
explain
in interface RelNode
explain
in class AbstractRelNode
protected String computeDigest()
AbstractRelNode
computeDigest
in class AbstractRelNode
protected RelDataType deriveRowType()
deriveRowType
in class AbstractRelNode
public boolean isDistinct()
RelNode
false
, derived classes should override.
isDistinct
in interface RelNode
isDistinct
in class AbstractRelNode
Collection<RelSubset> getParentSubsets()
RelSet getSet()
void add(RelNode rel)
rel
to this subset.
RelNode buildCheapestPlan(VolcanoPlanner planner)
void propagateCostImprovements(VolcanoPlanner planner, RelNode rel, Set<RelSubset> activeSet)
planner
- Plannerrel
- Relational expression whose cost has improvedactiveSet
- Set of active subsets, for cycle detectionpublic void propagateBoostRemoval(VolcanoPlanner planner)
public void collectVariablesUsed(Set<String> variableSet)
RelNode
collectVariablesUsed
in interface RelNode
collectVariablesUsed
in class AbstractRelNode
variableSet
- receives variables usedpublic void collectVariablesSet(Set<String> variableSet)
RelNode
collectVariablesSet
in interface RelNode
collectVariablesSet
in class AbstractRelNode
variableSet
- receives variables known to be set bypublic List<RelNode> getRels()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |