public class RelOptCostImpl extends Object implements RelOptCost
RelOptCost
interface. It it defined in terms of a single scalar quantity; somewhat
arbitrarily, it returns this scalar for rows processed and zero for both CPU
and I/O.| Modifier and Type | Field and Description |
|---|---|
static RelOptCostFactory |
FACTORY |
| Constructor and Description |
|---|
RelOptCostImpl(double value) |
| Modifier and Type | Method and Description |
|---|---|
double |
divideBy(RelOptCost cost)
Computes the ratio between this cost and another cost.
|
boolean |
equals(@Nullable Object obj) |
boolean |
equals(RelOptCost other)
Compares this to another cost.
|
double |
getCpu()
Returns usage of CPU resources.
|
double |
getIo()
Returns usage of I/O resources.
|
double |
getRows()
Returns the number of rows processed; this should not be
confused with the row count produced by a relational expression
(
RelNode.estimateRowCount(org.apache.calcite.rel.metadata.RelMetadataQuery)). |
int |
hashCode() |
boolean |
isEqWithEpsilon(RelOptCost other)
Compares this to another cost, allowing for slight roundoff errors.
|
boolean |
isInfinite()
Returns whether this cost represents an expression that hasn't actually
been implemented (e.g.
|
boolean |
isLe(RelOptCost other)
Compares this to another cost.
|
boolean |
isLt(RelOptCost other)
Compares this to another cost.
|
RelOptCost |
minus(RelOptCost other)
Subtracts another cost from this.
|
RelOptCost |
multiplyBy(double factor)
Multiplies this cost by a scalar factor.
|
RelOptCost |
plus(RelOptCost other)
Adds another cost to this.
|
String |
toString()
Forces implementations to override
Object.toString() and provide a
good cost rendering to use during tracing. |
public static final RelOptCostFactory FACTORY
public double getRows()
RelOptCostRelNode.estimateRowCount(org.apache.calcite.rel.metadata.RelMetadataQuery)).getRows in interface RelOptCostpublic double getIo()
RelOptCostgetIo in interface RelOptCostpublic double getCpu()
RelOptCostgetCpu in interface RelOptCostpublic boolean isInfinite()
RelOptCostisInfinite in interface RelOptCostpublic boolean isLe(RelOptCost other)
RelOptCostisLe in interface RelOptCostother - another costpublic boolean isLt(RelOptCost other)
RelOptCostisLt in interface RelOptCostother - another costpublic boolean equals(RelOptCost other)
RelOptCostequals in interface RelOptCostother - another costpublic boolean isEqWithEpsilon(RelOptCost other)
RelOptCostisEqWithEpsilon in interface RelOptCostother - another costpublic RelOptCost minus(RelOptCost other)
RelOptCostminus in interface RelOptCostother - another costpublic RelOptCost plus(RelOptCost other)
RelOptCostplus in interface RelOptCostother - another costpublic RelOptCost multiplyBy(double factor)
RelOptCostmultiplyBy in interface RelOptCostfactor - scalar factorpublic double divideBy(RelOptCost cost)
RelOptCostdivideBy is the inverse of RelOptCost.multiplyBy(double). For any
finite, non-zero cost and factor f,
cost.divideBy(cost.multiplyBy(f)) yields 1 / f.
divideBy in interface RelOptCostcost - Other costpublic String toString()
RelOptCostObject.toString() and provide a
good cost rendering to use during tracing.toString in interface RelOptCosttoString in class ObjectCopyright © 2012-2022 Apache Software Foundation. All Rights Reserved.