simpledb.query
Class TablePlan

java.lang.Object
  extended by simpledb.query.TablePlan
All Implemented Interfaces:
Plan

public class TablePlan
extends Object
implements Plan

The Plan class corresponding to a table.

Author:
Edward Sciore

Constructor Summary
TablePlan(String tblname, Transaction tx)
          Creates a leaf node in the query tree corresponding to the specified table.
 
Method Summary
 int blocksAccessed()
          Estimates the number of block accesses for the table, which is obtainable from the statistics manager.
 int distinctValues(String fldname)
          Estimates the number of distinct field values in the table, which is obtainable from the statistics manager.
 Scan open()
          Creates a table scan for this query.
 int recordsOutput()
          Estimates the number of records in the table, which is obtainable from the statistics manager.
 Schema schema()
          Determines the schema of the table, which is obtainable from the catalog manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TablePlan

public TablePlan(String tblname,
                 Transaction tx)
Creates a leaf node in the query tree corresponding to the specified table.

Parameters:
tblname - the name of the table
tx - the calling transaction
Method Detail

open

public Scan open()
Creates a table scan for this query.

Specified by:
open in interface Plan
Returns:
a scan
See Also:
Plan.open()

blocksAccessed

public int blocksAccessed()
Estimates the number of block accesses for the table, which is obtainable from the statistics manager.

Specified by:
blocksAccessed in interface Plan
Returns:
the estimated number of block accesses
See Also:
Plan.blocksAccessed()

recordsOutput

public int recordsOutput()
Estimates the number of records in the table, which is obtainable from the statistics manager.

Specified by:
recordsOutput in interface Plan
Returns:
the estimated number of output records
See Also:
Plan.recordsOutput()

distinctValues

public int distinctValues(String fldname)
Estimates the number of distinct field values in the table, which is obtainable from the statistics manager.

Specified by:
distinctValues in interface Plan
Parameters:
fldname - the name of a field
Returns:
the estimated number of distinct field values in the output
See Also:
Plan.distinctValues(java.lang.String)

schema

public Schema schema()
Determines the schema of the table, which is obtainable from the catalog manager.

Specified by:
schema in interface Plan
Returns:
the query's schema
See Also:
Plan.schema()


Copyright © 2011. All Rights Reserved.