Interface QueryPlan

All Known Subinterfaces:
LogicalPlan, LogicalPlanWithBinaryRoot, LogicalPlanWithNaryRoot, LogicalPlanWithNullaryRoot, LogicalPlanWithUnaryRoot, PhysicalPlan, PhysicalPlanWithBinaryRoot, PhysicalPlanWithNaryRoot, PhysicalPlanWithNullaryRoot, PhysicalPlanWithUnaryRoot
All Known Implementing Classes:
BaseForQueryPlan, LogicalPlanWithBinaryRootImpl, LogicalPlanWithNaryRootImpl, LogicalPlanWithNullaryRootImpl, LogicalPlanWithUnaryRootImpl, PhysicalPlanWithBinaryRootImpl, PhysicalPlanWithNaryRootImpl, PhysicalPlanWithNullaryRootImpl, PhysicalPlanWithUnaryRootImpl

public interface QueryPlan
This interface captures aspects that are common both to logical plans and to physical plans. That is, every such plan has a unique ID, a root operator, and child plans that produce the input to the root operator. The child plans are plans themselves, also captured as objects of this interface. Moreover, every plan (and sub-plan) may be associated with query-planning-related information.

This interface serves purely an abstract purpose in the sense that it is not meant to be instantiated directly. Instead, LogicalPlan and PhysicalPlan) are the relevant specializations of this interfaces that are meant to be used throughout the code base.

  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the variables that can be expected in the solution mappings produced by this plan.
    int
    Returns an identifier of this (sub-)plan, which should be distinct from the identifiers of all other sub-plans within the same plan.
    Returns an object that captures query-planning-related information about this plan.
    Returns the root operator of this plan.
    getSubPlan(int i)
    Returns the i-th sub-plan of this plan, where i starts at index 0 (zero).
    boolean
    Returns true if this plan already has a QueryPlanningInfo object associated with it.
    default boolean
    Returns true if this plan is the same plan as the given one.
    int
    Returns the number of sub-plans that this plan has (considering sub-plans that are direct children of the root operator of this plan).
  • Method Details

    • getID

      int getID()
      Returns an identifier of this (sub-)plan, which should be distinct from the identifiers of all other sub-plans within the same plan.
    • getRootOperator

      QueryPlanOperator getRootOperator()
      Returns the root operator of this plan.
    • numberOfSubPlans

      int numberOfSubPlans()
      Returns the number of sub-plans that this plan has (considering sub-plans that are direct children of the root operator of this plan).
    • getSubPlan

      QueryPlan getSubPlan(int i) throws NoSuchElementException
      Returns the i-th sub-plan of this plan, where i starts at index 0 (zero). If the plan has fewer sub-plans (or no sub-plans at all), then a NoSuchElementException will be thrown.
      Throws:
      NoSuchElementException
    • getExpectedVariables

      ExpectedVariables getExpectedVariables()
      Returns the variables that can be expected in the solution mappings produced by this plan.
    • getQueryPlanningInfo

      QueryPlanningInfo getQueryPlanningInfo()
      Returns an object that captures query-planning-related information about this plan. This object is meant to be requested and populated by the query planner.

      If this plan does not yet have a QueryPlanningInfo object associated with it, then this function creates a new (empty) one and returns that.

    • hasQueryPlanningInfo

      boolean hasQueryPlanningInfo()
      Returns true if this plan already has a QueryPlanningInfo object associated with it.
    • isSamePlan

      default boolean isSamePlan(QueryPlan other)
      Returns true if this plan is the same plan as the given one. Plans are considered the same if they have the same root operator, the same number of sub-plans, and the sub-plans at every index are the same as well.

      Notice that the

      invalid reference
      #equals(Object)
      function cannot be used for the type of comparison provided by this function because
      invalid reference
      #equals(Object)
      takes the IDs of the plans into account (which essentially means that
      invalid reference
      #equals(Object)
      falls back to doing a == comparison, because the IDs are unique).