|
|||||||||
| 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.QueryTreeNodeVector
org.apache.derby.impl.sql.compile.FromList
public class FromList
A FromList represents the list of tables in a FROM clause in a DML statement. It extends QueryTreeNodeVector.
| Field Summary | |
|---|---|
(package private) boolean |
fixedJoinOrder
|
private boolean |
isTransparent
|
(package private) java.util.Properties |
properties
|
private boolean |
referencesSessionSchema
|
(package private) boolean |
useStatistics
|
private WindowList |
windows
Window definitions used for resolving window functions not containing in-line window specifications, but referring window definitions |
| Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode |
|---|
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, isPrivilegeCollectionRequired |
| Constructor Summary | |
|---|---|
FromList()
|
|
| Method Summary | |
|---|---|
void |
addFromTable(FromTable fromTable)
Add a table to the FROM list. |
ResultColumn |
bindColumnReference(ColumnReference columnReference)
Bind a column reference to one of the tables in this FromList. |
void |
bindExpressions(FromList fromListParam)
Bind the expressions in this FromList. |
void |
bindResultColumns(FromList fromListParam)
Bind the result columns of the ResultSetNodes in this FromList when there is no base table to bind them to. |
void |
bindTables(DataDictionary dataDictionary,
FromList fromListParam)
|
void |
bindUntypedNullsToResultColumns(ResultColumnList bindingRCL)
Bind any untyped null nodes to the types in the given ResultColumnList. |
(package private) void |
decrementLevel(int decrement)
Decrement (query block) level (0-based) for all of the tables in this from list. |
ResultColumnList |
expandAll(TableName allTableName)
Expand a "*" into the appropriate ResultColumnList. |
void |
flattenFromTables(ResultColumnList rcl,
PredicateList predicateList,
SubqueryList sql,
GroupByList gbl,
ValueNode havingClause)
Flatten all the FromTables that are flattenable. |
(package private) void |
genExistsBaseTables(JBitSet referencedTableMap,
FromList outerFromList,
boolean isNotExists)
Mark all of the FromBaseTables in the list as EXISTS FBTs. |
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. |
FromTable |
getFromTableByResultColumn(ResultColumn rc)
Get the FromTable from this list which has the specified ResultColumn in its RCL. |
Optimizable |
getOptimizable(int index)
Return the nth Optimizable in the list. |
(package private) int[] |
getTableNumbers()
|
WindowList |
getWindows()
|
(package private) boolean |
hashJoinSpecified()
Return whether or not the user specified a hash join for any of the tables in this list. |
void |
init(java.lang.Object optimizeJoinOrder)
Initializer for a FromList |
void |
init(java.lang.Object optimizeJoinOrder,
java.lang.Object fromTable)
Initializer for a FromList |
void |
initAccessPaths(Optimizer optimizer)
Init the access paths for these optimizables. |
void |
isJoinColumnForRightOuterJoin(ResultColumn rc)
Go through the list of the tables and see if the passed ResultColumn is a join column for a right outer join with USING/NATURAL clause. |
boolean |
legalJoinOrder(int numTablesInQuery)
Tell whether the join order is legal. |
boolean |
LOJ_reorderable(int numTables)
|
(package private) void |
markAsTransparent()
Indicate that this FromList is "transparent", which means that its FromTables should be bound to tables from an outer query. |
boolean |
optimizeJoinOrder()
Tell whether the join order should be optimized. |
void |
preprocess(int numTables,
GroupByList gbl,
ValueNode predicateTree)
Preprocess the query tree - this currently means: o Generating a referenced table map for each ResultSetNode. |
(package private) void |
pushPredicates(PredicateList predicateList)
Categorize and push the predicates that are pushable. |
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) all ? |
void |
reOrder(int[] joinOrder)
Set the join order for this list of optimizables. |
(package private) boolean |
returnsAtMostSingleRow(ResultColumnList rcl,
ValueNode whereClause,
PredicateList wherePredicates,
DataDictionary dd)
This method is used for both subquery flattening and distinct elimination based on a uniqueness condition. |
void |
setLevel(int level)
Set the (query block) level (0-based) for the FromTables in this FromList. |
void |
setOptimizable(int index,
Optimizable optimizable)
Set the nth Optimizable to the specified Optimizable. |
void |
setProperties(java.util.Properties props)
Set the Properties list for this FromList. |
void |
setWindows(WindowList windows)
Set windows field to the supplied value. |
(package private) boolean |
tableNumberIsNotExists(int tableNumber)
determine whether this table is NOT EXISTS. |
int |
updateTargetLockMode()
Get the lock mode for the target of an update statement (a delete or update). |
boolean |
useStatistics()
user can specify that s/he doesn't want statistics to be considered when optimizing the query. |
void |
verifyProperties(DataDictionary dDictionary)
Verify that the Properties list with optimizer overrides, if specified, is valid |
| Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNodeVector |
|---|
acceptChildren, addElement, destructiveAppend, elementAt, indexOf, insertElementAt, nondestructiveAppend, printSubNodes, remove, removeAllElements, removeElement, removeElementAt, setElementAt, size |
| 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.OptimizableList |
|---|
size |
| Field Detail |
|---|
java.util.Properties properties
boolean fixedJoinOrder
boolean useStatistics
private boolean referencesSessionSchema
private boolean isTransparent
private WindowList windows
| Constructor Detail |
|---|
public FromList()
| Method Detail |
|---|
public void init(java.lang.Object optimizeJoinOrder)
init in interface Nodeinit in class QueryTreeNode
public void init(java.lang.Object optimizeJoinOrder,
java.lang.Object fromTable)
throws StandardException
init in interface Nodeinit in class QueryTreeNodeStandardException - Thrown on errorpublic Optimizable getOptimizable(int index)
OptimizableList
getOptimizable in interface OptimizableListindex - "index" (0 based) into the list.
OptimizableList.getOptimizable(int)
public void setOptimizable(int index,
Optimizable optimizable)
OptimizableList
setOptimizable in interface OptimizableListindex - "index" (0 based) into the list.optimizable - New nth Optimizable.OptimizableList.setOptimizable(int, org.apache.derby.iapi.sql.compile.Optimizable)
public void verifyProperties(DataDictionary dDictionary)
throws StandardException
OptimizableList
verifyProperties in interface OptimizableListdDictionary - The DataDictionary to use.
StandardException - Thrown on errorOptimizableList.verifyProperties(org.apache.derby.iapi.sql.dictionary.DataDictionary)
public void addFromTable(FromTable fromTable)
throws StandardException
fromTable - A FromTable to add to the list
StandardException - Thrown on error
public boolean referencesTarget(java.lang.String name,
boolean baseTable)
throws StandardException
name - 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 FromTable getFromTableByName(java.lang.String name,
java.lang.String schemaName,
boolean exactMatch)
throws StandardException
name - 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 errorpublic void isJoinColumnForRightOuterJoin(ResultColumn rc)
HalfOuterJoinNode.isJoinColumnForRightOuterJoin(org.apache.derby.impl.sql.compile.ResultColumn)
public void bindTables(DataDictionary dataDictionary,
FromList fromListParam)
throws StandardException
StandardException
public void bindExpressions(FromList fromListParam)
throws StandardException
StandardException - Thrown on error
public void bindResultColumns(FromList fromListParam)
throws StandardException
fromListParam - FromList to use/append to.
StandardException - Thrown on error
public ResultColumnList expandAll(TableName allTableName)
throws StandardException
allTableName - The qualification on the "*" as a String.
StandardException - Thrown on error
public ResultColumn bindColumnReference(ColumnReference columnReference)
throws StandardException
columnReference - The ColumnReference describing the column to bind
StandardException - Thrown on error
public void rejectParameters()
throws StandardException
StandardException - Thrown if a ? parameter found
directly under a ResultColumn
public boolean LOJ_reorderable(int numTables)
throws StandardException
StandardException
public void preprocess(int numTables,
GroupByList gbl,
ValueNode predicateTree)
throws StandardException
numTables - The number of tables in the DML Statementgbl - The group by list, if any
StandardException - Thrown on error
public void flattenFromTables(ResultColumnList rcl,
PredicateList predicateList,
SubqueryList sql,
GroupByList gbl,
ValueNode havingClause)
throws StandardException
rcl - The RCL from the outer querypredicateList - The PredicateList from the outer querysql - The SubqueryList from the outer querygbl - The group by list, if anyhavingClause - The HAVING clause, if any
StandardException - Thrown on error
void pushPredicates(PredicateList predicateList)
throws StandardException
predicateList - The query's PredicateList
StandardException - Thrown on errorpublic void setLevel(int level)
level - The query block level for this table.public FromTable getFromTableByResultColumn(ResultColumn rc)
rc - The ResultColumn match on.
public void setProperties(java.util.Properties props)
throws StandardException
StandardException - Thrown on errorpublic void reOrder(int[] joinOrder)
OptimizableList
reOrder in interface OptimizableListOptimizableList.reOrder(int[])public boolean useStatistics()
OptimizableList
useStatistics in interface OptimizableListOptimizableList.useStatistics()public boolean optimizeJoinOrder()
OptimizableList
optimizeJoinOrder in interface OptimizableListOptimizableList.optimizeJoinOrder()public boolean legalJoinOrder(int numTablesInQuery)
OptimizableList
legalJoinOrder in interface OptimizableListOptimizableList.legalJoinOrder(int)public void initAccessPaths(Optimizer optimizer)
OptimizableList
initAccessPaths in interface OptimizableListoptimizer - The optimizer being used.OptimizableList.initAccessPaths(org.apache.derby.iapi.sql.compile.Optimizer)
public void bindUntypedNullsToResultColumns(ResultColumnList bindingRCL)
throws StandardException
bindingRCL - The ResultColumnList with the types to bind to.
StandardException - Thrown on errorvoid decrementLevel(int decrement)
decrement - The amount to decrement by.
boolean returnsAtMostSingleRow(ResultColumnList rcl,
ValueNode whereClause,
PredicateList wherePredicates,
DataDictionary dd)
throws StandardException
rcl - If non-null, the RCL from the query block.
If non-null for subqueries, then entry can
be considered as part of an = comparison.whereClause - The WHERE clause to consider.wherePredicates - The predicates that have already been
pulled from the WHERE clause.dd - The DataDictionary to use.
StandardException - Thrown on errorint[] getTableNumbers()
void genExistsBaseTables(JBitSet referencedTableMap,
FromList outerFromList,
boolean isNotExists)
throws StandardException
referencedTableMap - The referenced table map.outerFromList - FromList from outer query blockisNotExists - Whether or not for NOT EXISTS
StandardException - Thrown on error
boolean tableNumberIsNotExists(int tableNumber)
throws StandardException
tableNumber - which table to check
StandardExceptionpublic int updateTargetLockMode()
boolean hashJoinSpecified()
void markAsTransparent()
public void setWindows(WindowList windows)
windows - list of window definitions associated with a SELECT.public WindowList getWindows()
|
Built on Wed 2013-06-12 15:21:56+0000, from revision ??? | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||