saffron.rel
Class TableAccess

java.lang.Object
  |
  +--saffron.rel.Rel
        |
        +--saffron.rel.TableAccess
Direct Known Subclasses:
JavaTableAccess

public class TableAccess
extends Rel

A TableAccess reads all the rows from a Table.

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/main/saffron/rel/TableAccess.java#8 $
Author:
jhyde

Nested Class Summary
private static class TableAccess.ConvertToJavaRule
          Rule to converts a TableAccess to Java calling convention.
 
Nested classes inherited from class saffron.rel.Rel
 
Field Summary
protected  Expression connectionExp
          The expression which yields the connection object.
protected  Table table
           
 
Fields inherited from class saffron.rel.Rel
cluster, digest, emptyArray, id, nextId, rowType
 
Constructor Summary
TableAccess(Cluster cluster, Table table, Expression connectionExp)
           
 
Method Summary
 Object clone()
           
 Cost computeSelfCost(Planner planner)
          Returns the cost of this plan (not including children).
 Type deriveRowType()
           
 void explain(PlanWriter pw)
           
 Expression[] getChildExps()
          Returns an array of this Rel's child expressions (not including the inputs returned by Rel.getInputs().
 Expression getConnectionExp()
           
 double getRows()
          Returns an estimate of the number of rows this relational expression will return.
 Table getTable()
          If this relational expression represents an access to a table, returns that table, otherwise returns null.
static void register(Planner planner)
          See Rel.register(saffron.Planner).
 
Methods inherited from class saffron.rel.Rel
childrenAccept, computeDigest, getCluster, getConvention, getCorelVariable, getEnvironment, getId, getInput, getInputs, getOrCreateCorelVariable, getParentEnv, getQualifier, getQuery, getRelTypeName, getRowType, getType, getVariablesStopped, implement, implementExp, implementExps, implementFieldAccess, implementSelf, isAccessTo, isDistinct, onRegister, recomputeDigest, registerCorelVariable, replaceInput, setCorelVariable, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

table

protected Table table

connectionExp

protected Expression connectionExp
The expression which yields the connection object.

Constructor Detail

TableAccess

public TableAccess(Cluster cluster,
                   Table table,
                   Expression connectionExp)
Method Detail

getConnectionExp

public Expression getConnectionExp()

clone

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

getRows

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

Overrides:
getRows in class Rel

getChildExps

public Expression[] getChildExps()
Description copied from class: Rel
Returns an array of this Rel's child expressions (not including the inputs returned by Rel.getInputs(). If there are no child expressions, returns an empty array, not null.

Overrides:
getChildExps in class Rel

explain

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

register

public static void register(Planner planner)
See Rel.register(saffron.Planner).


computeSelfCost

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

Overrides:
computeSelfCost in class Rel

deriveRowType

public Type deriveRowType()
Specified by:
deriveRowType in class Rel

getTable

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

Overrides:
getTable in class Rel

SourceForge.net_Logo