net.sf.saffron.rel
Class TableAccessRel

java.lang.Object
  |
  +--net.sf.saffron.rel.SaffronRel
        |
        +--net.sf.saffron.rel.TableAccessRel
Direct Known Subclasses:
JavaTableAccessRel

public class TableAccessRel
extends SaffronRel

A TableAccessRel reads all the rows from a SaffronTable.

If the table is a JdbcTable, then this is literally possible. But for other kinds of tables, there may be many ways to read the data from the table. For some kinds of table, it may not even be possible to read all of the rows unless some narrowing constraint is applied. In the example of the ReflectSchema schema,

select from fields
cannot be implemented, but
select from fields as f
 where f.getClass().getName().equals("java.lang.String")
can. It is the optimizer's responsibility to find these ways, by applying transformation rules.

Since:
10 November, 2001
Version:
$Id: //open/saffron/src/net/sf/saffron/rel/TableAccessRel.java#5 $
Author:
jhyde

Field Summary
protected  SaffronConnection connection
          The connection to Saffron.
protected  SaffronTable table
          The table definition.
 
Fields inherited from class net.sf.saffron.rel.SaffronRel
cluster, digest, emptyArray, id, nextId, rowType
 
Constructor Summary
TableAccessRel(VolcanoCluster cluster, SaffronTable table, SaffronConnection connection)
           
 
Method Summary
 Object clone()
           
 PlanCost computeSelfCost(SaffronPlanner planner)
          Returns the cost of this plan (not including children).
 SaffronType deriveRowType()
           
 void explain(PlanWriter pw)
           
 SaffronConnection getConnection()
           
 double getRows()
          Returns an estimate of the number of rows this relational expression will return.
 SaffronTable getTable()
          If this relational expression represents an access to a table, returns that table, otherwise returns null.
 
Methods inherited from class net.sf.saffron.rel.SaffronRel
childrenAccept, computeDigest, getChildExps, getCluster, getConvention, getCorrelVariable, getId, getInput, getInputs, getOrCreateCorrelVariable, getQualifier, getQuery, getRelTypeName, getRowType, getVariablesStopped, implement, implementFieldAccess, isAccessTo, isDistinct, onRegister, recomputeDigest, register, registerCorrelVariable, replaceInput, setCorrelVariable, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

connection

protected SaffronConnection connection
The connection to Saffron.


table

protected SaffronTable table
The table definition.

Constructor Detail

TableAccessRel

public TableAccessRel(VolcanoCluster cluster,
                      SaffronTable table,
                      SaffronConnection connection)
Method Detail

getConnection

public SaffronConnection getConnection()

getRows

public double getRows()
Description copied from class: SaffronRel
Returns an estimate of the number of rows this relational expression will return.

Overrides:
getRows in class SaffronRel

getTable

public SaffronTable getTable()
Description copied from class: SaffronRel
If this relational expression represents an access to a table, returns that table, otherwise returns null.

Overrides:
getTable in class SaffronRel

clone

public Object clone()
Specified by:
clone in class SaffronRel

computeSelfCost

public PlanCost computeSelfCost(SaffronPlanner planner)
Description copied from class: SaffronRel
Returns the cost of this plan (not including children). The base implementation throws an error; derived classes should override.

Overrides:
computeSelfCost in class SaffronRel

deriveRowType

public SaffronType deriveRowType()
Specified by:
deriveRowType in class SaffronRel

explain

public void explain(PlanWriter pw)
Overrides:
explain in class SaffronRel

SourceForge.net_Logo