|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RelOptCost
RelOptCost defines an interface for optimizer cost in terms of number of rows processed, CPU cost, and I/O cost. Optimizer implementations may use all of this information, or selectively ignore portions of it. The specific units for all of these quantities are rather vague; most relational expressions provide a default cost calculation, but optimizers can override this by plugging in their own cost models with well-defined meanings for each unit. Optimizers which supply their own cost models may also extend this interface with additional cost metrics such as memory usage.
Method Summary | |
---|---|
double |
divideBy(RelOptCost cost)
Computes the ratio between this cost and another cost. |
boolean |
equals(RelOptCost cost)
Compares this to another cost. |
double |
getCpu()
|
double |
getIo()
|
double |
getRows()
|
boolean |
isEqWithEpsilon(RelOptCost cost)
Compares this to another cost, allowing for slight roundoff errors. |
boolean |
isInfinite()
|
boolean |
isLe(RelOptCost cost)
Compares this to another cost. |
boolean |
isLt(RelOptCost cost)
Compares this to another cost. |
RelOptCost |
minus(RelOptCost cost)
Subtracts another cost from this. |
RelOptCost |
multiplyBy(double factor)
Multiplies this cost by a scalar factor. |
RelOptCost |
plus(RelOptCost cost)
Adds another cost to this. |
String |
toString()
Forces implementations to override Object.toString() and provide a
good cost rendering to use during tracing. |
Method Detail |
---|
double getRows()
RelNode.getRows()
)double getCpu()
double getIo()
boolean isInfinite()
boolean equals(RelOptCost cost)
cost
- another cost
boolean isEqWithEpsilon(RelOptCost cost)
cost
- another cost
boolean isLe(RelOptCost cost)
cost
- another cost
boolean isLt(RelOptCost cost)
cost
- another cost
RelOptCost plus(RelOptCost cost)
cost
- another cost
RelOptCost minus(RelOptCost cost)
cost
- another cost
RelOptCost multiplyBy(double factor)
factor
- scalar factor
double divideBy(RelOptCost cost)
divideBy is the inverse of multiplyBy(double)
. For any
finite, non-zero cost and factor f,
cost.divideBy(cost.multiplyBy(f))
yields 1 / f
.
cost
- Other cost
String toString()
Object.toString()
and provide a
good cost rendering to use during tracing.
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |