Class SubqueryList

All Implemented Interfaces:
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.
  • Constructor Details

  • Method Details

    • addSubqueryNode

      void addSubqueryNode(SubqueryNode subqueryNode) throws StandardException
      Add a subquery to the list.
      Parameters:
      subqueryNode - A SubqueryNode to add to the list
      Throws:
      StandardException
    • 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
    • modifyAccessPaths

      void modifyAccessPaths() throws StandardException
      Modify the access paths for all subqueries in this list.
      Throws:
      StandardException - Thrown on error
      See Also:
    • referencesTarget

      boolean referencesTarget(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
    • referencesSessionSchema

      public boolean referencesSessionSchema() throws StandardException
      Return true if the node references SESSION schema tables (temporary or permanent)
      Overrides:
      referencesSessionSchema in class QueryTreeNode
      Returns:
      true if references SESSION schema tables, 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.