|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.ResultSetNode
org.apache.derby.impl.sql.compile.FromTable
org.apache.derby.impl.sql.compile.TableOperatorNode
A TableOperatorNode represents a relational operator like UNION, INTERSECT, JOIN, etc. that takes two tables as parameters and returns a table. The parameters it takes are represented as ResultSetNodes. Currently, all known table operators are binary operators, so there are no subclasses of this node type called "BinaryTableOperatorNode" and "UnaryTableOperatorNode".
| Field Summary | |
private boolean |
leftModifyAccessPathsDone
|
(package private) Optimizer |
leftOptimizer
|
(package private) ResultSetNode |
leftResultSet
|
(package private) boolean |
nestedInParens
|
private boolean |
rightModifyAccessPathsDone
|
(package private) Optimizer |
rightOptimizer
|
(package private) ResultSetNode |
rightResultSet
|
| Fields inherited from class org.apache.derby.impl.sql.compile.FromTable |
bestAccessPath, bestCostEstimate, bestSortAvoidancePath, correlationName, corrTableName, currentAccessPath, hashKeyColumns, initialCapacity, level, loadFactor, maxCapacity, tableNumber, tableProperties, trulyTheBestAccessPath, userSpecifiedJoinStrategy |
| Fields inherited from class org.apache.derby.impl.sql.compile.ResultSetNode |
costEstimate, cursorTargetTable, insertSource, optimizer, referencedTableMap, resultColumns, resultSetNumber, scratchCostEstimate, statementResultSet |
| Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode |
AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, beginOffset, endOffset |
| Constructor Summary | |
TableOperatorNode()
|
|
| Method Summary | |
Visitable |
accept(Visitor v)
Accept a visitor, and call v.visit() on child nodes as necessary. |
void |
bindExpressions(FromList fromListParam)
Bind the expressions under this TableOperatorNode. |
void |
bindExpressionsWithTables(FromList fromListParam)
Bind the expressions in this ResultSetNode if it has tables. |
ResultSetNode |
bindNonVTITables(DataDictionary dataDictionary,
FromList fromListParam)
Bind the non VTI tables in this TableOperatorNode. |
void |
bindResultColumns(FromList fromListParam)
Bind the result columns of this ResultSetNode when there is no base table to bind them to. |
void |
bindResultColumns(TableDescriptor targetTableDescriptor,
FromVTI targetVTI,
ResultColumnList targetColumnList,
DMLStatementNode statement,
FromList fromListParam)
Bind the result columns for this ResultSetNode to a base table. |
ResultSetNode |
bindVTITables(FromList fromListParam)
Bind the VTI tables in this TableOperatorNode. |
(package private) void |
decrementLevel(int decrement)
Decrement (query block) level (0-based) for all of the tables in this ResultSet tree. |
java.lang.String |
getExposedName()
Return the exposed name for this table, which is the name that can be used to refer to this table in the rest of the query. |
protected FromTable |
getFromTableByName(java.lang.String name,
java.lang.String schemaName,
boolean exactMatch)
Determine whether or not the specified name is an exposed name in the current query block. |
ResultSetNode |
getLeftmostResultSet()
|
ResultSetNode |
getLeftResultSet()
Get the leftResultSet from this node. |
boolean |
getNestedInParens()
Return whether or not the table operator for this node was nested in parens in the query. |
ResultSetNode |
getRightResultSet()
Get the rightResultSet from this node. |
void |
init(java.lang.Object leftResultSet,
java.lang.Object rightResultSet,
java.lang.Object tableProperties)
Initializer for a TableOperatorNode. |
(package private) void |
markOrderingDependent()
Notify the underlying result set tree that the result is ordering dependent. |
Optimizable |
modifyAccessPath(JBitSet outerTables)
Modify the access path for this Optimizable, as necessary. |
ResultSetNode |
modifyAccessPaths()
Modify the access paths according to the decisions the optimizer made. |
boolean |
needsSpecialRCLBinding()
apparently something special needs to be done for me.... |
ResultSetNode |
optimize(DataDictionary dataDictionary,
PredicateList predicateList,
double outerRows)
Optimize a TableOperatorNode. |
protected ResultSetNode |
optimizeSource(Optimizer optimizer,
ResultSetNode sourceResultSet,
PredicateList predList,
CostEstimate outerCost)
Optimize a source result set to this table operator. |
ResultSetNode |
preprocess(int numTables,
GroupByList gbl,
FromList fromList)
Put a ProjectRestrictNode on top of each FromTable in the FromList. |
void |
printSubNodes(int depth)
Prints the sub-nodes of this object. |
(package private) void |
projectResultColumns()
Find the unreferenced result columns and project them out. |
boolean |
referencesSessionSchema()
Return true if the node references SESSION schema tables (temporary or permanent) |
boolean |
referencesTarget(java.lang.String name,
boolean baseTable)
Search to see if a query references the specifed table name. |
void |
rejectParameters()
Check for (and reject) ? |
(package private) void |
replaceDefaults(TableDescriptor ttd,
ResultColumnList tcl)
Replace any DEFAULTs with the associated tree for the default. |
void |
setLeftmostResultSet(ResultSetNode newLeftResultSet)
|
void |
setLevel(int level)
Set the (query block) level (0-based) for this FromTable. |
void |
setNestedInParens(boolean nestedInParens)
Mark whether or not this node is nested in parens. |
(package private) void |
setReferencedColumns()
Set the referenced columns in the column list if it may not be correct. |
java.lang.String |
toString()
Convert this object to a String. |
void |
verifyProperties(DataDictionary dDictionary)
Verify that the Properties list with optimizer overrides, if specified, is valid |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.derby.iapi.sql.compile.Optimizable |
getDataDictionary, getReferencedTableMap, getResultSetNumber |
| Field Detail |
boolean nestedInParens
ResultSetNode leftResultSet
ResultSetNode rightResultSet
Optimizer leftOptimizer
Optimizer rightOptimizer
private boolean leftModifyAccessPathsDone
private boolean rightModifyAccessPathsDone
| Constructor Detail |
public TableOperatorNode()
| Method Detail |
public void init(java.lang.Object leftResultSet,
java.lang.Object rightResultSet,
java.lang.Object tableProperties)
throws StandardException
init in class QueryTreeNodeleftResultSet - The ResultSetNode on the left side of this noderightResultSet - The ResultSetNode on the right side of this nodetableProperties - Properties list associated with the table
StandardException - Thrown on error
public Optimizable modifyAccessPath(JBitSet outerTables)
throws StandardException
Optimizable
modifyAccessPath in interface OptimizablemodifyAccessPath in class FromTableStandardException - Thrown on errorOptimizable.modifyAccessPath(org.apache.derby.iapi.util.JBitSet)
public void verifyProperties(DataDictionary dDictionary)
throws StandardException
Optimizable
verifyProperties in interface OptimizableverifyProperties in class FromTableStandardException - Thrown on errorOptimizable.verifyProperties(org.apache.derby.iapi.sql.dictionary.DataDictionary)public java.lang.String toString()
toString in class FromTablepublic void printSubNodes(int depth)
printSubNodes in class ResultSetNodedepth - The depth of this node in the tree
public ResultSetNode getLeftResultSet()
public ResultSetNode getRightResultSet()
public ResultSetNode getLeftmostResultSet()
public void setLeftmostResultSet(ResultSetNode newLeftResultSet)
public void setLevel(int level)
setLevel in class FromTablelevel - The query block level for this FromTable.
public java.lang.String getExposedName()
getExposedName in class FromTablepublic void setNestedInParens(boolean nestedInParens)
nestedInParens - Whether or not this node is nested in parens.
public boolean getNestedInParens()
public ResultSetNode bindNonVTITables(DataDictionary dataDictionary,
FromList fromListParam)
throws StandardException
bindNonVTITables in class ResultSetNodedataDictionary - The DataDictionary to use for bindingfromListParam - FromList to use/append to.
StandardException - Thrown on error
public ResultSetNode bindVTITables(FromList fromListParam)
throws StandardException
bindVTITables in class ResultSetNodefromListParam - FromList to use/append to.
StandardException - Thrown on error
public void bindExpressions(FromList fromListParam)
throws StandardException
bindExpressions in class ResultSetNodefromListParam - FromList to use/append to.
StandardException - Thrown on error
public void rejectParameters()
throws StandardException
rejectParameters in class ResultSetNodeStandardException - Thrown if a ? parameter found
directly under a ResultColumn
public void bindExpressionsWithTables(FromList fromListParam)
throws StandardException
bindExpressionsWithTables in class ResultSetNodefromListParam - FromList to use/append to.
StandardException - Thrown on error
public void bindResultColumns(FromList fromListParam)
throws StandardException
bindResultColumns in class ResultSetNodefromListParam - FromList to use/append to.
StandardException - Thrown on error
public void bindResultColumns(TableDescriptor targetTableDescriptor,
FromVTI targetVTI,
ResultColumnList targetColumnList,
DMLStatementNode statement,
FromList fromListParam)
throws StandardException
bindResultColumns in class ResultSetNodetargetTableDescriptor - The TableDescriptor for the table being
updated or inserted intotargetColumnList - For INSERT statements, the user
does not have to supply column
names (for example, "insert into t
values (1,2,3)". When this
parameter is null, it means that
the user did not supply column
names, and so the binding should
be done based on order. When it
is not null, it means do the binding
by name, not position.statement - Calling DMLStatementNode (Insert or Update)fromListParam - FromList to use/append to.
StandardException - Thrown on error
protected FromTable getFromTableByName(java.lang.String name,
java.lang.String schemaName,
boolean exactMatch)
throws StandardException
getFromTableByName in class FromTablename - The specified name to search for as an exposed name.schemaName - Schema name, if non-null.exactMatch - Whether or not we need an exact match on specified schema and table
names or match on table id.
StandardException - Thrown on error
public ResultSetNode preprocess(int numTables,
GroupByList gbl,
FromList fromList)
throws StandardException
preprocess in class ResultSetNodenumTables - Number of tables in the DML Statementgbl - The group by list, if anyfromList - The from list, if any
StandardException - Thrown on error
void projectResultColumns()
throws StandardException
projectResultColumns in class ResultSetNodeStandardExceptionvoid setReferencedColumns()
public ResultSetNode optimize(DataDictionary dataDictionary,
PredicateList predicateList,
double outerRows)
throws StandardException
optimize in class ResultSetNodedataDictionary - The DataDictionary to use for optimizationpredicateList - The PredicateList to apply.outerRows - The number of outer joining rows
StandardException - Thrown on error
public ResultSetNode modifyAccessPaths()
throws StandardException
ResultSetNode
modifyAccessPaths in class ResultSetNodeStandardException - Thrown on errorResultSetNode.modifyAccessPaths()
public boolean referencesTarget(java.lang.String name,
boolean baseTable)
throws StandardException
referencesTarget in class ResultSetNodename - Table name (String) to search for.baseTable - Whether or not name is for a base table
StandardException - Thrown on error
public boolean referencesSessionSchema()
throws StandardException
referencesSessionSchema in class QueryTreeNodeStandardException - Thrown on error
protected ResultSetNode optimizeSource(Optimizer optimizer,
ResultSetNode sourceResultSet,
PredicateList predList,
CostEstimate outerCost)
throws StandardException
StandardException - Thrown on errorvoid decrementLevel(int decrement)
decrementLevel in class FromTabledecrement - The amount to decrement by.
void replaceDefaults(TableDescriptor ttd,
ResultColumnList tcl)
throws StandardException
replaceDefaults in class ResultSetNodettd - The TableDescriptor for the target table.tcl - The RCL for the target table.
StandardException - Thrown on errorvoid markOrderingDependent()
markOrderingDependent in class ResultSetNode
public Visitable accept(Visitor v)
throws StandardException
accept in interface Visitableaccept in class ResultSetNodev - the visitor
StandardException - on errorpublic boolean needsSpecialRCLBinding()
needsSpecialRCLBinding in class FromTable
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||