Class CostEstimates

java.lang.Object
org.apache.druid.sql.calcite.rel.CostEstimates

public class CostEstimates extends Object
Constants used by PartialDruidQuery.estimateCost() and various AbstractRelNode.computeSelfCost(RelOptPlanner, RelMetadataQuery) implementations.
  • Field Details

    • COST_BASE

      public static final double COST_BASE
      Per-row base cost. This represents the cost of walking through every row, but not actually reading anything from them or computing any aggregations.
      See Also:
    • COST_OUTPUT_COLUMN

      public static final double COST_OUTPUT_COLUMN
      Cost to include a column in query output.
      See Also:
    • COST_EXPRESSION

      public static final double COST_EXPRESSION
      Cost to compute and read an expression.
      See Also:
    • COST_AGGREGATION

      public static final double COST_AGGREGATION
      Cost to compute an aggregation.
      See Also:
    • COST_DIMENSION

      public static final double COST_DIMENSION
      Cost per GROUP BY dimension.
      See Also:
    • MULTIPLIER_FILTER

      public static final double MULTIPLIER_FILTER
      Multiplier to apply when there is a WHERE filter. Encourages pushing down filters and limits through joins and subqueries when possible.
      See Also:
    • MULTIPLIER_ORDER_BY

      public static final double MULTIPLIER_ORDER_BY
      Multiplier to apply when there is an ORDER BY. Encourages avoiding them when possible.
      See Also:
    • MULTIPLIER_LIMIT

      public static final double MULTIPLIER_LIMIT
      Multiplier to apply when there is a LIMIT. Encourages pushing down limits when possible.
      See Also:
    • MULTIPLIER_OUTER_QUERY

      public static final double MULTIPLIER_OUTER_QUERY
      Multiplier to apply to an outer query via DruidOuterQueryRel. Encourages pushing down time-saving operations to the lowest level of the query stack, because they'll have bigger impact there.
      See Also:
    • COST_SUBQUERY

      public static final double COST_SUBQUERY
      Cost to add to a subquery. Strongly encourages avoiding subqueries, since they must be inlined and then the join must run on the Broker.
      See Also:
    • COST_JOIN_CROSS

      public static final double COST_JOIN_CROSS
      Cost to perform a cross join. Strongly encourages pushing down filters into join conditions, even if it means we need to add a subquery (this is higher than COST_SUBQUERY).
      See Also: