simpledb.opt
Class TablePlanner

java.lang.Object
  extended by simpledb.opt.TablePlanner

 class TablePlanner
extends java.lang.Object

This class contains methods for planning a single table.

Author:
Edward Sciore

Constructor Summary
TablePlanner(java.lang.String tblname, Predicate mypred, Transaction tx)
          Creates a new table planner.
 
Method Summary
 Plan makeJoinPlan(Plan current)
          Constructs a join plan of the specified plan and the table.
 Plan makeProductPlan(Plan current)
          Constructs a product plan of the specified plan and this table.
 Plan makeSelectPlan()
          Constructs a select plan for the table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TablePlanner

public TablePlanner(java.lang.String tblname,
                    Predicate mypred,
                    Transaction tx)
Creates a new table planner. The specified predicate applies to the entire query. The table planner is responsible for determining which portion of the predicate is useful to the table, and when indexes are useful.

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

makeSelectPlan

public Plan makeSelectPlan()
Constructs a select plan for the table. The plan will use an indexselect, if possible.

Returns:
a select plan for the table.

makeJoinPlan

public Plan makeJoinPlan(Plan current)
Constructs a join plan of the specified plan and the table. The plan will use an indexjoin, if possible. (Which means that if an indexselect is also possible, the indexjoin operator takes precedence.) The method returns null if no join is possible.

Parameters:
current - the specified plan
Returns:
a join plan of the plan and this table

makeProductPlan

public Plan makeProductPlan(Plan current)
Constructs a product plan of the specified plan and this table.

Parameters:
current - the specified plan
Returns:
a product plan of the specified plan and this table