Class CostBasedJoinPlanner.JoinComponent

  • Enclosing class:
    CostBasedJoinPlanner

    private static class CostBasedJoinPlanner.JoinComponent
    extends java.lang.Object
    This helper class is used to keep track of one "join component" in the dynamic programming algorithm. A join component is simply a query plan for joining one or more leaves of the query.

    In this context, a "leaf" may either be a base table or a subquery in the FROM-clause of the query. However, the planner will attempt to push conjuncts down the plan as far as possible, so even if a leaf is a base table, the plan may be a bit more complex than just a single file-scan.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.HashSet<Expression> conjunctsUsed
      This field specifies the collection of all conjuncts use by this join plan.
      PlanNode joinPlan
      This is the join plan itself, that joins together all leaves specified in the leavesUsed field.
      java.util.HashSet<PlanNode> leavesUsed
      This field specifies the collection of leaf-plans that are joined by the plan in this join-component.
    • Constructor Summary

      Constructors 
      Constructor Description
      JoinComponent​(PlanNode leafPlan, java.util.HashSet<Expression> conjunctsUsed)
      Constructs a new instance for a leaf node.
      JoinComponent​(PlanNode joinPlan, java.util.HashSet<PlanNode> leavesUsed, java.util.HashSet<Expression> conjunctsUsed)
      Constructs a new instance for a non-leaf node.
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • joinPlan

        public PlanNode joinPlan
        This is the join plan itself, that joins together all leaves specified in the leavesUsed field.
      • leavesUsed

        public java.util.HashSet<PlanNode> leavesUsed
        This field specifies the collection of leaf-plans that are joined by the plan in this join-component.
      • conjunctsUsed

        public java.util.HashSet<Expression> conjunctsUsed
        This field specifies the collection of all conjuncts use by this join plan. It allows us to easily determine what join conjuncts still remain to be incorporated into the query.
    • Constructor Detail

      • JoinComponent

        public JoinComponent​(PlanNode leafPlan,
                             java.util.HashSet<Expression> conjunctsUsed)
        Constructs a new instance for a leaf node. It should not be used for join-plans that join together two or more leaves. This constructor simply adds the leaf-plan into the leavesUsed collection.
        Parameters:
        leafPlan - the query plan for this leaf of the query.
        conjunctsUsed - the set of conjuncts used by the leaf plan. This may be an empty set if no conjuncts apply solely to this leaf, or it may be nonempty if some conjuncts apply solely to this leaf.
      • JoinComponent

        public JoinComponent​(PlanNode joinPlan,
                             java.util.HashSet<PlanNode> leavesUsed,
                             java.util.HashSet<Expression> conjunctsUsed)
        Constructs a new instance for a non-leaf node. It should not be used for leaf plans!
        Parameters:
        joinPlan - the query plan that joins together all leaves specified in the leavesUsed argument.
        leavesUsed - the set of two or more leaf plans that are joined together by the join plan.
        conjunctsUsed - the set of conjuncts used by the join plan. Obviously, it is expected that all conjuncts specified here can actually be evaluated against the join plan.