Interface Statistics


public interface Statistics
  • Field Details

  • Method Details

    • isStatsAvailable

      boolean isStatsAvailable()
      Returns whether statistics are available. Should be called prior to using the statistics
    • buildUniqueIndexIdentifier

      String buildUniqueIndexIdentifier(IndexDescriptor idx)
      Returns a unique index identifier
      Parameters:
      idx - - Index specified as a IndexDescriptor
      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 a RexNode
      tabIdxName - - The index name generated using buildUniqueIndexIdentifier
      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 a RexNode
      tabIdxName - - The index name generated using buildUniqueIndexIdentifier
      scanRel - - The current scan rel
      Returns:
      the leading rowcount
    • getAvgRowSize

      double getAvgRowSize(String tabIdxName, boolean isIndexScan)
      Returns the average row size for the specified filter condition
      Parameters:
      tabIdxName - - The index name generated using buildUniqueIndexIdentifier
      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)