Class LoptJoinTree


  • public class LoptJoinTree
    extends java.lang.Object
    Utility class used to store a Join 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.

    • Field Detail

      • joinTree

        private final RelNode joinTree
      • removableSelfJoin

        private final boolean removableSelfJoin
    • Constructor Detail

      • LoptJoinTree

        public LoptJoinTree​(RelNode joinTree,
                            int factorId)
        Creates a join-tree 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 join-tree.
        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 join-tree 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 join-tree 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()
      • getTreeOrder

        public java.util.List<java.lang.Integer> getTreeOrder()
      • getTreeOrder

        public void getTreeOrder​(java.util.List<java.lang.Integer> treeOrder)
      • isRemovableSelfJoin

        public boolean isRemovableSelfJoin()