net.sf.farrago.catalog
Class FarragoTableStatistics

java.lang.Object
  extended by net.sf.farrago.catalog.FarragoTableStatistics
All Implemented Interfaces:
RelStatSource

public class FarragoTableStatistics
extends Object
implements RelStatSource

This class reads statistics for a Farrago table from data stored in the catalog.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/catalog/FarragoTableStatistics.java#10 $
Author:
John Pham

Field Summary
private  Timestamp labelTimestamp
           
private  FarragoRepos repos
           
private  FemAbstractColumnSet table
           
 
Constructor Summary
FarragoTableStatistics(FarragoRepos repos, FemAbstractColumnSet table)
          Deprecated.  
FarragoTableStatistics(FarragoRepos repos, FemAbstractColumnSet table, Timestamp labelTimestamp)
          Initialize an object for retrieving table statistics, optionally based on a label setting.
 
Method Summary
 RelStatColumnStatistics getColumnStatistics(int ordinal, SargIntervalSequence predicate)
          Returns statistics pertaining to a column specified by the 0-based ordinal and the sargable predicates associated with that column.
 Double getRowCount()
          Returns the number of rows in a relation, as determined by statistics
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

repos

private FarragoRepos repos

table

private FemAbstractColumnSet table

labelTimestamp

private Timestamp labelTimestamp
Constructor Detail

FarragoTableStatistics

public FarragoTableStatistics(FarragoRepos repos,
                              FemAbstractColumnSet table)
Deprecated. 

Initialize an object for retrieving table statistics

Parameters:
repos - the repository containing stats
table - the table for which to retrieve stats

FarragoTableStatistics

public FarragoTableStatistics(FarragoRepos repos,
                              FemAbstractColumnSet table,
                              Timestamp labelTimestamp)
Initialize an object for retrieving table statistics, optionally based on a label setting.

Parameters:
repos - the repository containing stats
table - the table for which to retrieve stats
labelTimestamp - the creation timestamp of the label that determines which stats to retrieve; null if there is no label setting
Method Detail

getRowCount

public Double getRowCount()
Description copied from interface: RelStatSource
Returns the number of rows in a relation, as determined by statistics

Specified by:
getRowCount in interface RelStatSource
Returns:
a row count, or null if one could not be determined

getColumnStatistics

public RelStatColumnStatistics getColumnStatistics(int ordinal,
                                                   SargIntervalSequence predicate)
Description copied from interface: RelStatSource
Returns statistics pertaining to a column specified by the 0-based ordinal and the sargable predicates associated with that column. The second argument can be null if there are no sargable predicates on the column.

Specified by:
getColumnStatistics in interface RelStatSource
Parameters:
ordinal - zero based column ordinal
predicate - associated predicates(s), evaluated as intervals
Returns:
filtered column statistics, or null if they could not be obtained