Package org.apache.druid.sql.calcite.rel
Class CostEstimates
java.lang.Object
org.apache.druid.sql.calcite.rel.CostEstimates
Constants used by
PartialDruidQuery.estimateCost() and various
AbstractRelNode.computeSelfCost(RelOptPlanner, RelMetadataQuery) implementations.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleCost to compute an aggregation.static final doublePer-row base cost.static final doubleCost per GROUP BY dimension.static final doubleCost to compute and read an expression.static final doubleCost to perform a cross join.static final doubleCost to include a column in query output.static final doubleCost to add to a subquery.static final doubleMultiplier to apply when there is a WHERE filter.static final doubleMultiplier to apply when there is a LIMIT.static final doubleMultiplier to apply when there is an ORDER BY.static final doubleMultiplier to apply to an outer query viaDruidOuterQueryRel. -
Method Summary
-
Field Details
-
COST_BASE
public static final double COST_BASEPer-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_COLUMNCost to include a column in query output.- See Also:
-
COST_EXPRESSION
public static final double COST_EXPRESSIONCost to compute and read an expression.- See Also:
-
COST_AGGREGATION
public static final double COST_AGGREGATIONCost to compute an aggregation.- See Also:
-
COST_DIMENSION
public static final double COST_DIMENSIONCost per GROUP BY dimension.- See Also:
-
MULTIPLIER_FILTER
public static final double MULTIPLIER_FILTERMultiplier 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_BYMultiplier to apply when there is an ORDER BY. Encourages avoiding them when possible.- See Also:
-
MULTIPLIER_LIMIT
public static final double MULTIPLIER_LIMITMultiplier to apply when there is a LIMIT. Encourages pushing down limits when possible.- See Also:
-
MULTIPLIER_OUTER_QUERY
public static final double MULTIPLIER_OUTER_QUERYMultiplier to apply to an outer query viaDruidOuterQueryRel. 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_SUBQUERYCost 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_CROSSCost 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 thanCOST_SUBQUERY).- See Also:
-