Class DrillCostBase

java.lang.Object
org.apache.drill.exec.planner.cost.DrillCostBase
All Implemented Interfaces:
org.apache.calcite.plan.RelOptCost, DrillRelOptCost

public class DrillCostBase extends Object implements DrillRelOptCost
Implementation of the DrillRelOptCost, modeled similar to VolcanoCost
  • Field Details

    • BASE_CPU_COST

      public static final int BASE_CPU_COST
      NOTE: the multiplication factors below are not calibrated yet...these are chosen based on approximations for now. For reference purposes, assume each disk on a server can have a sustained I/O throughput of 100 MBytes/sec. Suppose there is an array of 16 disks per server..theoretically one could get 1.6GBytes/sec. Suppose network speed is 1GBit/sec which is 128MBytes/sec, although actual transfer rate over the network may be lower. We are only concerned with relative costs, not absolute values. For relative costing, let's assume sending data over the network is about 16x slower than reading/writing to an array of local disks.
      See Also:
    • BYTE_DISK_READ_COST

      public static final int BYTE_DISK_READ_COST
      See Also:
    • BYTE_NETWORK_COST

      public static final int BYTE_NETWORK_COST
      See Also:
    • SVR_CPU_COST

      public static final int SVR_CPU_COST
      See Also:
    • FUNC_CPU_COST

      public static final int FUNC_CPU_COST
      See Also:
    • PROJECT_CPU_COST

      public static final int PROJECT_CPU_COST
      See Also:
    • HASH_CPU_COST

      public static final int HASH_CPU_COST
      See Also:
    • MEMORY_TO_CPU_RATIO

      public static final double MEMORY_TO_CPU_RATIO
      See Also:
    • RANGE_PARTITION_CPU_COST

      public static final int RANGE_PARTITION_CPU_COST
      See Also:
    • COMPARE_CPU_COST

      public static final int COMPARE_CPU_COST
      See Also:
    • AVG_FIELD_WIDTH

      public static final int AVG_FIELD_WIDTH
      See Also:
  • Constructor Details

    • DrillCostBase

      public DrillCostBase(double rowCount, double cpu, double io, double network)
    • DrillCostBase

      public DrillCostBase(double rowCount, double cpu, double io, double network, double memory)
  • Method Details

    • getRows

      public double getRows()
      Specified by:
      getRows in interface org.apache.calcite.plan.RelOptCost
    • getCpu

      public double getCpu()
      Specified by:
      getCpu in interface org.apache.calcite.plan.RelOptCost
    • getIo

      public double getIo()
      Specified by:
      getIo in interface org.apache.calcite.plan.RelOptCost
    • getNetwork

      public double getNetwork()
      Specified by:
      getNetwork in interface DrillRelOptCost
    • getMemory

      public double getMemory()
      Specified by:
      getMemory in interface DrillRelOptCost
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object that)
      Overrides:
      equals in class Object
    • isInfinite

      public boolean isInfinite()
      Specified by:
      isInfinite in interface org.apache.calcite.plan.RelOptCost
    • equals

      public boolean equals(org.apache.calcite.plan.RelOptCost other)
      Specified by:
      equals in interface org.apache.calcite.plan.RelOptCost
    • isEqWithEpsilon

      public boolean isEqWithEpsilon(org.apache.calcite.plan.RelOptCost other)
      Specified by:
      isEqWithEpsilon in interface org.apache.calcite.plan.RelOptCost
    • isLe

      public boolean isLe(org.apache.calcite.plan.RelOptCost other)
      Specified by:
      isLe in interface org.apache.calcite.plan.RelOptCost
    • isLt

      public boolean isLt(org.apache.calcite.plan.RelOptCost other)
      Specified by:
      isLt in interface org.apache.calcite.plan.RelOptCost
    • plus

      public org.apache.calcite.plan.RelOptCost plus(org.apache.calcite.plan.RelOptCost other)
      Specified by:
      plus in interface org.apache.calcite.plan.RelOptCost
    • minus

      public org.apache.calcite.plan.RelOptCost minus(org.apache.calcite.plan.RelOptCost other)
      Specified by:
      minus in interface org.apache.calcite.plan.RelOptCost
    • multiplyBy

      public org.apache.calcite.plan.RelOptCost multiplyBy(double factor)
      Specified by:
      multiplyBy in interface org.apache.calcite.plan.RelOptCost
    • divideBy

      public double divideBy(org.apache.calcite.plan.RelOptCost cost)
      Specified by:
      divideBy in interface org.apache.calcite.plan.RelOptCost
    • toString

      public String toString()
      Specified by:
      toString in interface org.apache.calcite.plan.RelOptCost
      Overrides:
      toString in class Object