Package io.trino.cost

Class PlanCostEstimate

java.lang.Object
io.trino.cost.PlanCostEstimate

public final class PlanCostEstimate extends Object
  • Constructor Details

    • PlanCostEstimate

      public PlanCostEstimate(double cpuCost, double maxMemory, double maxMemoryWhenOutputting, double networkCost)
    • PlanCostEstimate

      public PlanCostEstimate(double cpuCost, double maxMemory, double maxMemoryWhenOutputting, double networkCost, LocalCostEstimate rootNodeLocalCostEstimate)
  • Method Details

    • infinite

      public static PlanCostEstimate infinite()
    • unknown

      public static PlanCostEstimate unknown()
    • zero

      public static PlanCostEstimate zero()
    • getCpuCost

      public double getCpuCost()
      Returns CPU component of the cost.

      Unknown value is represented by Double.NaN

    • getMaxMemory

      public double getMaxMemory()
      Returns maximal memory usage of a query plan (or subplan).

      Unknown value is represented by Double.NaN

    • getMaxMemoryWhenOutputting

      public double getMaxMemoryWhenOutputting()
      Returns maximal memory usage of a query plan (or subplan) after a first output row was produced. When this cost represents a cost of a subplan, this information can be used to determine maximum memory usage (and maximum memory usage after a first output row was produced) for plan nodes higher up in the plan tree.

      Unknown value is represented by Double.NaN.

    • getNetworkCost

      public double getNetworkCost()
      Returns network component of the cost.

      Unknown value is represented by Double.NaN

    • getRootNodeLocalCostEstimate

      public LocalCostEstimate getRootNodeLocalCostEstimate()
      Returns local cost estimate for the root plan node.
    • hasUnknownComponents

      public boolean hasUnknownComponents()
      Returns true if this cost has unknown components.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object