Interface Statistics
public interface Statistics
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final doublestatic final doublestatic final double -
Method Summary
Modifier and TypeMethodDescriptionReturns a unique index identifierdoublegetAvgRowSize(String tabIdxName, boolean isIndexScan) Returns the average row size for the specified filter conditiondoublegetLeadingRowCount(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.doublegetRowCount(org.apache.calcite.rex.RexNode condition, String tabIdxName, org.apache.calcite.rel.RelNode scanRel) Returns the rowcount for the specified filter conditionbooleaninitialize(org.apache.calcite.rex.RexNode condition, DrillScanRelBase scanRel, IndexCallContext context) booleanReturns 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 aRexNodetabIdxName- - The index name generated usingbuildUniqueIndexIdentifierscanRel- - 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 aRexNodetabIdxName- - The index name generated usingbuildUniqueIndexIdentifierscanRel- - 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 usingbuildUniqueIndexIdentifierisIndexScan- - 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)
-