Interface CostEstimate
- All Superinterfaces:
StoreCostResult
- All Known Implementing Classes:
CostEstimateImpl
A CostEstimate represents the cost of getting a ResultSet, along with the
ordering of rows in the ResultSet, and the estimated number of rows in
this ResultSet.
-
Method Summary
Modifier and TypeMethodDescriptionadd
(CostEstimate addend, CostEstimate retval) Add this cost estimate to another one.cloneMe()
Get a copy of this CostEstimatedouble
compare
(CostEstimate other) Compare this cost estimate with the given cost estimate.divide
(double divisor, CostEstimate retval) Divide this cost estimate by a scalar, non-dimensional number.boolean
Return whether or not this CostEstimate is uninitialized.multiply
(double multiplicand, CostEstimate retval) Multiply this cost estimate by a scalar, non-dimensional number.double
rowCount()
Get the estimated number of rows returned by the ResultSet that this CostEstimate models.void
setCost
(double cost, double rowCount, double singleScanRowCount) Set the cost for this cost estimate.void
setCost
(CostEstimate other) Copy the values from the given cost estimate into this one.void
setSingleScanRowCount
(double singleRowScanCount) Set the single scan row count.double
Get the estimated number of rows returned by a single scan of the ResultSet that this CostEstimate models.Methods inherited from interface org.apache.derby.iapi.store.access.StoreCostResult
getEstimatedCost, getEstimatedRowCount, setEstimatedCost, setEstimatedRowCount
-
Method Details
-
setCost
void setCost(double cost, double rowCount, double singleScanRowCount) Set the cost for this cost estimate. -
setCost
Copy the values from the given cost estimate into this one. -
setSingleScanRowCount
void setSingleScanRowCount(double singleRowScanCount) Set the single scan row count. -
compare
Compare this cost estimate with the given cost estimate.- Parameters:
other
- The cost estimate to compare this one with- Returns:
- < 0 if this < other, 0 if this == other, > 0 if this > other
-
add
Add this cost estimate to another one. This presumes that any row ordering is destroyed.- Parameters:
addend
- This cost estimate to add this one to.retval
- If non-null, put the result here.- Returns:
- this + other.
-
multiply
Multiply this cost estimate by a scalar, non-dimensional number. This presumes that any row ordering is destroyed.- Parameters:
multiplicand
- The value to multiply this CostEstimate by.retval
- If non-null, put the result here.- Returns:
- this * multiplicand
-
divide
Divide this cost estimate by a scalar, non-dimensional number.- Parameters:
divisor
- The value to divide this CostEstimate by.retval
- If non-null, put the result here.- Returns:
- this / divisor
-
rowCount
double rowCount()Get the estimated number of rows returned by the ResultSet that this CostEstimate models. -
singleScanRowCount
double singleScanRowCount()Get the estimated number of rows returned by a single scan of the ResultSet that this CostEstimate models. -
cloneMe
CostEstimate cloneMe()Get a copy of this CostEstimate -
isUninitialized
boolean isUninitialized()Return whether or not this CostEstimate is uninitialized.- Returns:
- Whether or not this CostEstimate is uninitialized.
-