Class SubqueryList

  • All Implemented Interfaces:
    java.lang.Iterable<SubqueryNode>, Visitable

    class SubqueryList
    extends QueryTreeNodeVector<SubqueryNode>
    A SubqueryList represents a list of subqueries within a specific clause (select, where or having) in a DML statement. It extends QueryTreeNodeVector.
    • Method Detail

      • optimize

        void optimize​(DataDictionary dataDictionary,
                      double outerRows)
               throws StandardException
        Optimize the subqueries in this list.
        Parameters:
        dataDictionary - The data dictionary to use for optimization
        outerRows - The optimizer's estimate of the number of times this subquery will be executed.
        Throws:
        StandardException - Thrown on error
      • referencesTarget

        boolean referencesTarget​(java.lang.String name,
                                 boolean baseTable)
                          throws StandardException
        Search to see if a query references the specifed table name.
        Parameters:
        name - Table name (String) to search for.
        baseTable - Whether or not name is for a base table
        Returns:
        true if found, else false
        Throws:
        StandardException - Thrown on error
      • setPointOfAttachment

        void setPointOfAttachment​(int pointOfAttachment)
                           throws StandardException
        Set the point of attachment in all subqueries in this list.
        Parameters:
        pointOfAttachment - The point of attachment
        Throws:
        StandardException - Thrown on error
      • decrementLevel

        void decrementLevel​(int decrement)
        Decrement (query block) level (0-based) for all of the tables in this subquery list. This is useful when flattening a subquery.
        Parameters:
        decrement - The amount to decrement by.
      • markHavingSubqueries

        void markHavingSubqueries()
        Mark all of the subqueries in this list as being part of a having clause, so we can avoid flattening later.
      • markWhereSubqueries

        void markWhereSubqueries()
        Mark all of the subqueries in this list as being part of a where clause so we can avoid flattening later if needed.