simpledb.index.query
Class IndexSelectPlan

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

public class IndexSelectPlan
extends Object
implements Plan

The Plan class corresponding to the indexselect relational algebra operator.

Author:
Edward Sciore

Constructor Summary
IndexSelectPlan(Plan p, IndexInfo ii, Constant val, Transaction tx)
          Creates a new indexselect node in the query tree for the specified index and selection constant.
 
Method Summary
 int blocksAccessed()
          Estimates the number of block accesses to compute the index selection, which is the same as the index traversal cost plus the number of matching data records.
 int distinctValues(String fldname)
          Returns the distinct values as defined by the index.
 Scan open()
          Creates a new indexselect scan for this query
 int recordsOutput()
          Estimates the number of output records in the index selection, which is the same as the number of search key values for the index.
 Schema schema()
          Returns the schema of the data table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexSelectPlan

public IndexSelectPlan(Plan p,
                       IndexInfo ii,
                       Constant val,
                       Transaction tx)
Creates a new indexselect node in the query tree for the specified index and selection constant.

Parameters:
p - the input table
ii - information about the index
val - the selection constant
tx - the calling transaction
Method Detail

open

public Scan open()
Creates a new indexselect 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 to compute the index selection, which is the same as the index traversal cost plus the number of matching data records.

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 output records in the index selection, which is the same as the number of search key values for the index.

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

distinctValues

public int distinctValues(String fldname)
Returns the distinct values as defined by the index.

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()
Returns the schema of the data table.

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


Copyright © 2011. All Rights Reserved.