Interface Statistics
public interface Statistics
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
static final double
static final double
static final double
-
Method Summary
Modifier and TypeMethodDescriptionReturns a unique index identifierdouble
getAvgRowSize
(String tabIdxName, boolean isIndexScan) Returns the average row size for the specified filter conditiondouble
getLeadingRowCount
(org.apache.calcite.rex.RexNode condition, String tabIdxName, DrillScanRelBase scanRel) Returns the leading rowcount for the specified filter condition Leading rowcount means rowcount for filter condition only on leading index columns.double
getRowCount
(org.apache.calcite.rex.RexNode condition, String tabIdxName, org.apache.calcite.rel.RelNode scanRel) Returns the rowcount for the specified filter conditionboolean
initialize
(org.apache.calcite.rex.RexNode condition, DrillScanRelBase scanRel, IndexCallContext context) boolean
Returns whether statistics are available.
-
Field Details
-
ROWCOUNT_UNKNOWN
static final double ROWCOUNT_UNKNOWN- See Also:
-
ROWCOUNT_HUGE
static final double ROWCOUNT_HUGE- See Also:
-
AVG_ROWSIZE_UNKNOWN
static final double AVG_ROWSIZE_UNKNOWN- See Also:
-
AVG_COLUMN_SIZE
static final long AVG_COLUMN_SIZE- See Also:
-
-
Method Details
-
isStatsAvailable
boolean isStatsAvailable()Returns whether statistics are available. Should be called prior to using the statistics -
buildUniqueIndexIdentifier
Returns a unique index identifier- Parameters:
idx
- - Index specified as aIndexDescriptor
- Returns:
- The unique index identifier
-
getRowCount
double getRowCount(org.apache.calcite.rex.RexNode condition, String tabIdxName, org.apache.calcite.rel.RelNode scanRel) Returns the rowcount for the specified filter condition- Parameters:
condition
- - Filter specified as aRexNode
tabIdxName
- - The index name generated usingbuildUniqueIndexIdentifier
scanRel
- - The current scan rel- Returns:
- the rowcount for the filter
-
getLeadingRowCount
double getLeadingRowCount(org.apache.calcite.rex.RexNode condition, String tabIdxName, DrillScanRelBase scanRel) Returns the leading rowcount for the specified filter condition Leading rowcount means rowcount for filter condition only on leading index columns.- Parameters:
condition
- - Filter specified as aRexNode
tabIdxName
- - The index name generated usingbuildUniqueIndexIdentifier
scanRel
- - The current scan rel- Returns:
- the leading rowcount
-
getAvgRowSize
Returns the average row size for the specified filter condition- Parameters:
tabIdxName
- - The index name generated usingbuildUniqueIndexIdentifier
isIndexScan
- - Whether the current rel is an index scan (false for primary table)
-
initialize
boolean initialize(org.apache.calcite.rex.RexNode condition, DrillScanRelBase scanRel, IndexCallContext context)
-