net.sf.saffron.core
Interface SaffronPlanner

All Known Implementing Classes:
VolcanoPlanner

public interface SaffronPlanner

A SaffronPlanner is a query optimizer: it transforms a relational expression into a semantically equivalent relational expression, according to a given set of rules and a cost model.


Method Summary
 void addCallingConvention(CallingConvention convention)
          Registers a calling convention.
 void addRule(VolcanoRule rule)
          Registers a rule.
 SaffronRel changeConvention(SaffronRel rel, CallingConvention toConvention)
          Changes a relational expression to an equivalent one of a different calling convention.
 SaffronPlanner chooseDelegate()
          Negotiates an appropriate planner to deal with distributed queries.
 SaffronRel findBestExp()
          Find the most efficient expression to implement this query.
 SaffronRel getRoot()
           
 PlanCost makeCost(double dRows, double dCpu, double dIo)
          Create a cost object.
 PlanCost makeHugeCost()
          Create a cost object representing an enormous non-infinite cost.
 PlanCost makeInfiniteCost()
          Create a cost object representing infinite cost.
 PlanCost makeTinyCost()
          Create a cost object representing a small positive cost.
 PlanCost makeZeroCost()
          Create a cost object representing zero cost.
 SaffronRel register(SaffronRel rel, SaffronRel equivRel)
          Registers a relational expression in the expression bank.
 void registerSchema(SaffronSchema schema)
          Tells this planner that a schema exists.
 void setRoot(SaffronRel rel)
           
 

Method Detail

setRoot

public void setRoot(SaffronRel rel)

getRoot

public SaffronRel getRoot()

addCallingConvention

public void addCallingConvention(CallingConvention convention)
Registers a calling convention.


addRule

public void addRule(VolcanoRule rule)
Registers a rule.


changeConvention

public SaffronRel changeConvention(SaffronRel rel,
                                   CallingConvention toConvention)
Changes a relational expression to an equivalent one of a different calling convention. The return is never null, but may be abstract.

Pre-condition:
rel.getConvention() != toConvention
Post-condition:
return != null

chooseDelegate

public SaffronPlanner chooseDelegate()
Negotiates an appropriate planner to deal with distributed queries. The idea is that the schemas decide among themselves which has the most knowledge. Right now, the local planner retains control.


findBestExp

public SaffronRel findBestExp()
Find the most efficient expression to implement this query.


makeCost

public PlanCost makeCost(double dRows,
                         double dCpu,
                         double dIo)
Create a cost object.


makeHugeCost

public PlanCost makeHugeCost()
Create a cost object representing an enormous non-infinite cost.


makeInfiniteCost

public PlanCost makeInfiniteCost()
Create a cost object representing infinite cost.


makeTinyCost

public PlanCost makeTinyCost()
Create a cost object representing a small positive cost.


makeZeroCost

public PlanCost makeZeroCost()
Create a cost object representing zero cost.


register

public SaffronRel register(SaffronRel rel,
                           SaffronRel equivRel)
Registers a relational expression in the expression bank. After it has been registered, you may not modify it.

Parameters:
rel - Relational expression to register
equivRel - Relational expression it is equivalent to (may be null)
Returns:
the same expression, or an equivalent existing expression

registerSchema

public void registerSchema(SaffronSchema schema)
Tells this planner that a schema exists. This is the schema's chance to tell the planner about all of the special transformation rules.


SourceForge.net_Logo