Interface StatisticsProvider


public interface StatisticsProvider
Source for statistics about a Schema. Statistics include the number of rows in the fact table, the number of distinct values of an attribute, and the number of distinct values of a set of attributes.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the number of rows in the fact table.
    double
    getLoadTime(List<Attribute> attributes)
     
    double
    getRowCount(List<Attribute> attributes)
    Returns an estimate of the number of distinct values of a collection of attributes.
    double
    getSpace(List<Attribute> attributes)
    Returns an estimate of the amount of space (in bytes) required to store a row in an Aggregate composed of the given Attributes.
  • Method Details

    • getFactRowCount

      double getFactRowCount()
      Returns the number of rows in the fact table.
      Returns:
      number of rows in the fact table
    • getRowCount

      double getRowCount(List<Attribute> attributes)
      Returns an estimate of the number of distinct values of a collection of attributes.

      For example, we would expect getRowCount({gender}) to return 2, and getRowCount({gender, maritalStatus}) to return 4 (2 * 2).

      A good implementation of this method should recognize when attributes are dependent: for example, if there are 100 suppliers in 10 cities, getRowCount({city, supplierName}) should return 100. Similarly, the amount should be bounded by the number of rows in the table which is the source of the attributes.

      The algorithm may call this method many times, so a good implementation will compute statistics once only and thereafter return cached results.

      Parameters:
      attributes - List of attributes whose joint distribution is estimated
      Returns:
      Estimated number of values in the attributes' joint distribution
      See Also:
    • getSpace

      double getSpace(List<Attribute> attributes)
      Returns an estimate of the amount of space (in bytes) required to store a row in an Aggregate composed of the given Attributes.
      Parameters:
      attributes - List of attributes whose joint distribution is estimated
      Returns:
      Estimated space in bytes to store a row of attributes
    • getLoadTime

      double getLoadTime(List<Attribute> attributes)