simpledb.metadata
Class StatInfo

java.lang.Object
  extended by simpledb.metadata.StatInfo

public class StatInfo
extends Object

Holds three pieces of statistical information about a table: the number of blocks, the number of records, and the number of distinct values for each field.

Author:
Edward Sciore

Constructor Summary
StatInfo(int numblocks, int numrecs)
          Creates a StatInfo object.
 
Method Summary
 int blocksAccessed()
          Returns the estimated number of blocks in the table.
 int distinctValues(String fldname)
          Returns the estimated number of distinct values for the specified field.
 int recordsOutput()
          Returns the estimated number of records in the table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatInfo

public StatInfo(int numblocks,
                int numrecs)
Creates a StatInfo object. Note that the number of distinct values is not passed into the constructor. The object fakes this value.

Parameters:
numblocks - the number of blocks in the table
numrecs - the number of records in the table
Method Detail

blocksAccessed

public int blocksAccessed()
Returns the estimated number of blocks in the table.

Returns:
the estimated number of blocks in the table

recordsOutput

public int recordsOutput()
Returns the estimated number of records in the table.

Returns:
the estimated number of records in the table

distinctValues

public int distinctValues(String fldname)
Returns the estimated number of distinct values for the specified field. In actuality, this estimate is a complete guess.

Parameters:
fldname - the name of the field
Returns:
a guess as to the number of distinct field values


Copyright © 2011. All Rights Reserved.