com.lucidera.opt
Class LoptJoinTree

java.lang.Object
  extended by com.lucidera.opt.LoptJoinTree

public class LoptJoinTree
extends Object

LoptJoinTree implements a utility class used to store a JoinRel tree and the factors that make up the tree. Because RelNodes can be duplicated in a query when you have a self-join, factor ids are needed to distinguish between the different join inputs that correspond to identical tables. The class associates factor ids with a join tree, matching the order of the factor ids with the order of those factors in the join tree.

Version:
$Id: //open/dev/farrago/src/com/lucidera/opt/LoptJoinTree.java#10 $
Author:
Zelaine Fong

Nested Class Summary
protected  class LoptJoinTree.BinaryTree
          Simple binary tree class that stores an id in the leaf nodes and keeps track of the parent LoptJoinTree object associated with the binary tree.
 
Field Summary
private  LoptJoinTree.BinaryTree factorTree
           
private  RelNode joinTree
           
private  boolean removableSelfJoin
           
 
Constructor Summary
LoptJoinTree(RelNode joinTree, int factorId)
          Creates a jointree consisting of a single node
LoptJoinTree(RelNode joinTree, LoptJoinTree.BinaryTree factorTree, boolean removableSelfJoin)
          Associates the factor ids with a jointree
LoptJoinTree(RelNode joinTree, LoptJoinTree.BinaryTree leftFactorTree, LoptJoinTree.BinaryTree rightFactorTree)
          Associates the factor ids with a jointree given the factors corresponding to the left and right subtrees of the join
LoptJoinTree(RelNode joinTree, LoptJoinTree.BinaryTree leftFactorTree, LoptJoinTree.BinaryTree rightFactorTree, boolean removableSelfJoin)
          Associates the factor ids with a jointree given the factors corresponding to the left and right subtrees of the join.
 
Method Summary
 LoptJoinTree.BinaryTree getFactorTree()
           
 RelNode getJoinTree()
           
 LoptJoinTree getLeft()
           
 LoptJoinTree getRight()
           
 void getTreeOrder(List<Integer> treeOrder)
           
 boolean isRemovableSelfJoin()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factorTree

private LoptJoinTree.BinaryTree factorTree

joinTree

private RelNode joinTree

removableSelfJoin

private boolean removableSelfJoin
Constructor Detail

LoptJoinTree

public LoptJoinTree(RelNode joinTree,
                    int factorId)
Creates a jointree consisting of a single node

Parameters:
joinTree - RelNode corresponding to the single node
factorId - factor id of the node

LoptJoinTree

public LoptJoinTree(RelNode joinTree,
                    LoptJoinTree.BinaryTree factorTree,
                    boolean removableSelfJoin)
Associates the factor ids with a jointree

Parameters:
joinTree - RelNodes corresponding to the join tree
factorTree - tree of the factor ids
removableSelfJoin - whether the join corresponds to a removable self-join

LoptJoinTree

public LoptJoinTree(RelNode joinTree,
                    LoptJoinTree.BinaryTree leftFactorTree,
                    LoptJoinTree.BinaryTree rightFactorTree)
Associates the factor ids with a jointree given the factors corresponding to the left and right subtrees of the join

Parameters:
joinTree - RelNodes corresponding to the join tree
leftFactorTree - tree of the factor ids for left subtree
rightFactorTree - tree of the factor ids for the right subtree

LoptJoinTree

public LoptJoinTree(RelNode joinTree,
                    LoptJoinTree.BinaryTree leftFactorTree,
                    LoptJoinTree.BinaryTree rightFactorTree,
                    boolean removableSelfJoin)
Associates the factor ids with a jointree given the factors corresponding to the left and right subtrees of the join. Also indicates whether the join is a removable self-join.

Parameters:
joinTree - RelNodes corresponding to the join tree
leftFactorTree - tree of the factor ids for left subtree
rightFactorTree - tree of the factor ids for the right subtree
removableSelfJoin - true if the join is a removable self-join
Method Detail

getJoinTree

public RelNode getJoinTree()

getLeft

public LoptJoinTree getLeft()

getRight

public LoptJoinTree getRight()

getFactorTree

public LoptJoinTree.BinaryTree getFactorTree()

getTreeOrder

public void getTreeOrder(List<Integer> treeOrder)

isRemovableSelfJoin

public boolean isRemovableSelfJoin()