Class Planner


  • public class Planner
    extends java.lang.Object
    Various methods for forming query plans on SQL queries.
    Author:
    Tobias Downer
    • Constructor Summary

      Constructors 
      Constructor Description
      Planner()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static QueryPlanNode formQueryPlan​(DatabaseConnection db, TableSelectExpression expression, com.mckoi.database.interpret.TableExpressionFromSet from_set, java.util.ArrayList order_by)
      Forms a query plan (QueryPlanNode) from the given TableSelectExpression and TableExpressionFromSet.
      static QueryPlanNode planForOrderBy​(QueryPlanNode plan, java.util.ArrayList order_by, com.mckoi.database.interpret.TableExpressionFromSet from_set, java.util.ArrayList s_col_list)
      Plans an ORDER BY set.
      • Methods inherited from class java.lang.Object

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

      • Planner

        public Planner()
    • Method Detail

      • formQueryPlan

        public static QueryPlanNode formQueryPlan​(DatabaseConnection db,
                                                  TableSelectExpression expression,
                                                  com.mckoi.database.interpret.TableExpressionFromSet from_set,
                                                  java.util.ArrayList order_by)
                                           throws DatabaseException
        Forms a query plan (QueryPlanNode) from the given TableSelectExpression and TableExpressionFromSet. The TableSelectExpression describes the SELECT query (or sub-query), and the TableExpressionFromSet is used to resolve expression references.

        The 'order_by' argument is a list of ByColumn objects that represent an optional ORDER BY clause. If this is null or the list is empty, no ordering is done.

        Throws:
        DatabaseException
      • planForOrderBy

        public static QueryPlanNode planForOrderBy​(QueryPlanNode plan,
                                                   java.util.ArrayList order_by,
                                                   com.mckoi.database.interpret.TableExpressionFromSet from_set,
                                                   java.util.ArrayList s_col_list)
                                            throws DatabaseException
        Plans an ORDER BY set. This is given its own function because we may want to plan this at the end of a number of composite functions.

        NOTE: s_col_list is optional.

        Throws:
        DatabaseException