org.eigenbase.relopt.volcano
Class RelSet

java.lang.Object
  extended by org.eigenbase.relopt.volcano.RelSet

 class RelSet
extends Object

A RelSet is an equivalence-set of expressions; that is, a set of expressions which have identical semantics. We are generally interested in using the expression which has the lowest cost.

All of the expressions in an RelSet have the same calling convention.

Since:
16 December, 2001
Version:
$Id: //open/dev/farrago/src/org/eigenbase/relopt/volcano/RelSet.java#3 $
Author:
jhyde

Field Summary
(package private)  List<AbstractConverter> abstractConverters
          List of AbstractConverter objects which have not yet been satisfied.
(package private)  RelSet equivalentSet
          Set to the superseding set when this is found to be equivalent to another set.
(package private)  int id
           
(package private)  boolean inMetadataQuery
          Reentrancy flag.
(package private)  RelNode rel
           
(package private)  List<RelNode> rels
           
(package private)  List<RelSubset> subsets
           
private static Logger tracer
           
(package private)  Set<String> variablesPropagated
          Names of variables which are set by relational expressions in this set and available for use by parent and child expressions.
(package private)  Set<String> variablesUsed
          Names of variables which are used by relational expressions in this set.
 
Constructor Summary
RelSet()
           
 
Method Summary
 RelSubset add(RelNode rel)
          Adds a relational expression to a set, with its results available under a particular calling convention.
(package private)  void addInternal(RelNode rel)
          Adds an expression rel to this set, without creating a RelSubset.
(package private)  RelSubset getOrCreateSubset(RelOptCluster cluster, RelTraitSet traits)
           
 List<RelNode> getParentRels()
          Returns all of the RelNodes which reference RelNodes in this set.
 List<RelNode> getRelsFromAllSubsets()
           
 RelSubset getSubset(RelTraitSet traits)
           
(package private)  void mergeWith(VolcanoPlanner planner, RelSet otherSet)
          Merges otherSet into this RelSet.
(package private)  void obliterateRelNode(RelNode rel)
           
private  void postEquivalenceEvent(VolcanoPlanner planner, RelNode rel)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tracer

private static final Logger tracer

rels

final List<RelNode> rels

subsets

final List<RelSubset> subsets

abstractConverters

List<AbstractConverter> abstractConverters
List of AbstractConverter objects which have not yet been satisfied.


equivalentSet

RelSet equivalentSet
Set to the superseding set when this is found to be equivalent to another set.


rel

RelNode rel

variablesPropagated

Set<String> variablesPropagated
Names of variables which are set by relational expressions in this set and available for use by parent and child expressions.


variablesUsed

Set<String> variablesUsed
Names of variables which are used by relational expressions in this set.


id

int id

inMetadataQuery

boolean inMetadataQuery
Reentrancy flag.

Constructor Detail

RelSet

RelSet()
Method Detail

getParentRels

public List<RelNode> getParentRels()
Returns all of the RelNodes which reference RelNodes in this set.


getRelsFromAllSubsets

public List<RelNode> getRelsFromAllSubsets()
Returns:
all of the RelNodes contained by any subset of this set (does not include the subset objects themselves)

getSubset

public RelSubset getSubset(RelTraitSet traits)

obliterateRelNode

void obliterateRelNode(RelNode rel)

add

public RelSubset add(RelNode rel)
Adds a relational expression to a set, with its results available under a particular calling convention. An expression may be in the set several times with different calling conventions (and hence different costs).


getOrCreateSubset

RelSubset getOrCreateSubset(RelOptCluster cluster,
                            RelTraitSet traits)

postEquivalenceEvent

private void postEquivalenceEvent(VolcanoPlanner planner,
                                  RelNode rel)

addInternal

void addInternal(RelNode rel)
Adds an expression rel to this set, without creating a RelSubset. (Called only from RelSubset.add(org.eigenbase.rel.RelNode).

Parameters:
rel - Relational expression

mergeWith

void mergeWith(VolcanoPlanner planner,
               RelSet otherSet)
Merges otherSet into this RelSet.

One generally calls this method after discovering that two relational expressions are equivalent, and hence the RelSets they belong to are equivalent also.

After this method completes, otherSet is obsolete, its equivalentSet member points to this RelSet, and this RelSet is still alive.

Parameters:
planner - Planner
otherSet - RelSet which is equivalent to this one