simpledb.index.query
Class IndexJoinPlan

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

public class IndexJoinPlan
extends Object
implements Plan

The Plan class corresponding to the indexjoin relational algebra operator.

Author:
Edward Sciore

Constructor Summary
IndexJoinPlan(Plan p1, Plan p2, IndexInfo ii, String joinfield, Transaction tx)
          Implements the join operator, using the specified LHS and RHS plans.
 
Method Summary
 int blocksAccessed()
          Estimates the number of block accesses to compute the join.
 int distinctValues(String fldname)
          Estimates the number of distinct values for the specified field.
 Scan open()
          Opens an indexjoin scan for this query
 int recordsOutput()
          Estimates the number of output records in the join.
 Schema schema()
          Returns the schema of the index join.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexJoinPlan

public IndexJoinPlan(Plan p1,
                     Plan p2,
                     IndexInfo ii,
                     String joinfield,
                     Transaction tx)
Implements the join operator, using the specified LHS and RHS plans.

Parameters:
p1 - the left-hand plan
p2 - the right-hand plan
ii - information about the right-hand index
joinfield - the left-hand field used for joining
tx - the calling transaction
Method Detail

open

public Scan open()
Opens an indexjoin 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 join. The formula is:
 B(indexjoin(p1,p2,idx)) = B(p1) + R(p1)*B(idx)
       + R(indexjoin(p1,p2,idx) 

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 join. The formula is:
 R(indexjoin(p1,p2,idx)) = R(p1)*R(idx) 

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 values for the specified field.

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 index join.

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


Copyright © 2011. All Rights Reserved.