|
|||||||||
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)
Bind the tables in this FromList. |
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. |
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 class QueryTreeNode
public void init(java.lang.Object optimizeJoinOrder, java.lang.Object fromTable) throws StandardException
init
in class QueryTreeNode
StandardException
- Thrown on errorpublic Optimizable getOptimizable(int index)
OptimizableList
getOptimizable
in interface OptimizableList
index
- "index" (0 based) into the list.
OptimizableList.getOptimizable(int)
public void setOptimizable(int index, Optimizable optimizable)
OptimizableList
setOptimizable
in interface OptimizableList
index
- "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 OptimizableList
dDictionary
- 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 errorpublic 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 errorpublic boolean referencesSessionSchema() throws StandardException
referencesSessionSchema
in class QueryTreeNode
StandardException
- Thrown on errorprotected 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 bindTables(DataDictionary dataDictionary, FromList fromListParam) throws StandardException
dataDictionary
- The DataDictionary to use for bindingfromListParam
- FromList to use/append to.
StandardException
- Thrown on errorpublic void bindExpressions(FromList fromListParam) throws StandardException
StandardException
- Thrown on errorpublic void bindResultColumns(FromList fromListParam) throws StandardException
fromListParam
- FromList to use/append to.
StandardException
- Thrown on errorpublic ResultColumnList expandAll(TableName allTableName) throws StandardException
allTableName
- The qualification on the "*" as a String.
StandardException
- Thrown on errorpublic ResultColumn bindColumnReference(ColumnReference columnReference) throws StandardException
columnReference
- The ColumnReference describing the column to bind
StandardException
- Thrown on errorpublic void rejectParameters() throws StandardException
StandardException
- Thrown if a ? parameter found
directly under a ResultColumnpublic 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 errorpublic 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 errorvoid 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 OptimizableList
OptimizableList.reOrder(int[])
public boolean useStatistics()
OptimizableList
useStatistics
in interface OptimizableList
OptimizableList.useStatistics()
public boolean optimizeJoinOrder()
OptimizableList
optimizeJoinOrder
in interface OptimizableList
OptimizableList.optimizeJoinOrder()
public boolean legalJoinOrder(int numTablesInQuery)
OptimizableList
legalJoinOrder
in interface OptimizableList
OptimizableList.legalJoinOrder(int)
public void initAccessPaths(Optimizer optimizer)
OptimizableList
initAccessPaths
in interface OptimizableList
optimizer
- 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 errorboolean tableNumberIsNotExists(int tableNumber) throws StandardException
tableNumber
- which table to check
StandardException
public 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 Thu 2011-03-10 11:54:14+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |