simpledb.materialize
Class MaterializePlan

java.lang.Object
  extended by simpledb.materialize.MaterializePlan
All Implemented Interfaces:
Plan

public class MaterializePlan
extends Object
implements Plan

The Plan class for the materialize operator.

Author:
Edward Sciore

Constructor Summary
MaterializePlan(Plan srcplan, Transaction tx)
          Creates a materialize plan for the specified query.
 
Method Summary
 int blocksAccessed()
          Returns the estimated number of blocks in the materialized table.
 int distinctValues(String fldname)
          Returns the number of distinct field values, which is the same as in the underlying plan.
 Scan open()
          This method loops through the underlying query, copying its output records into a temporary table.
 int recordsOutput()
          Returns the number of records in the materialized table, which is the same as in the underlying plan.
 Schema schema()
          Returns the schema of the materialized table, which is the same as in the underlying plan.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaterializePlan

public MaterializePlan(Plan srcplan,
                       Transaction tx)
Creates a materialize plan for the specified query.

Parameters:
srcplan - the plan of the underlying query
tx - the calling transaction
Method Detail

open

public Scan open()
This method loops through the underlying query, copying its output records into a temporary table. It then returns a table scan for that table.

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

blocksAccessed

public int blocksAccessed()
Returns the estimated number of blocks in the materialized table. It does not include the one-time cost of materializing the records.

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

recordsOutput

public int recordsOutput()
Returns the number of records in the materialized table, which is the same as in the underlying plan.

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 number of distinct field values, which is the same as in the underlying plan.

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 materialized table, which is the same as in the underlying plan.

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


Copyright © 2011. All Rights Reserved.