Class GroupExpressionRef<T extends RelationalExpression>

  • Type Parameters:
    T - the type of planner expression that is contained in this reference
    All Implemented Interfaces:
    Bindable, Correlated<ExpressionRef<T>>, ExpressionRef<T>

    @API(EXPERIMENTAL)
    public class GroupExpressionRef<T extends RelationalExpression>
    extends Object
    implements ExpressionRef<T>
    A Cascades-style group expression, representing the members of set of RelationalExpressions that belong to the same equivalence class.

    The memo data structure can compactly represent a large set of similar RelationalExpressions through careful memoization. The Cascades "group expression", represented by the GroupExpressionRef, is the key to that memoization by sharing optimization work on a sub-expression with other parts of the expression that reference the same sub-expression.

    The reference abstraction is designed to make it difficult for authors of rules to mutate group expressions directly, which is undefined behavior. Note that a GroupExpressionRef cannot be "dereferenced" using the get() method if it contains more than one member. Expressions with more than one member should not be used outside of the query planner, and get() should not be used inside the query planner.