Class RelSet

  • class RelSet
    extends java.lang.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.

    • Field Detail

      • LOGGER

        private static final org.slf4j.Logger LOGGER
      • rels

        final java.util.List<RelNode> rels
      • parents

        final java.util.List<RelNode> parents
        Relational expressions that have a subset in this set as a child. This is a multi-set. If multiple relational expressions in this set have the same parent, there will be multiple entries.
      • subsets

        final java.util.List<RelSubset> subsets
      • equivalentSet

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

        final java.util.Set<CorrelationId> variablesPropagated
        Variables that are set by relational expressions in this set and available for use by parent and child expressions.
      • variablesUsed

        final java.util.Set<CorrelationId> variablesUsed
        Variables that are used by relational expressions in this set.
      • id

        final int id
      • inMetadataQuery

        boolean inMetadataQuery
        Reentrancy flag.
    • Constructor Detail

    • Method Detail

      • getParentRels

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

        public java.util.List<RelNode> getRelsFromAllSubsets()
        all of the RelNodes contained by any subset of this set (does not include the subset objects themselves)
      • obliterateRelNode

        void obliterateRelNode​(RelNode rel)
        Removes all references to a specific RelNode in both the subsets and their parent relationships.
      • 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).
      • 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.

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