Class SubqueryList
- java.lang.Object
-
- org.apache.derby.impl.sql.compile.QueryTreeNode
-
- org.apache.derby.impl.sql.compile.QueryTreeNodeVector<SubqueryNode>
-
- org.apache.derby.impl.sql.compile.SubqueryList
-
- All Implemented Interfaces:
java.lang.Iterable<SubqueryNode>
,Visitable
class SubqueryList extends QueryTreeNodeVector<SubqueryNode>
A SubqueryList represents a list of subqueries within a specific clause (select, where or having) in a DML statement. It extends QueryTreeNodeVector.
-
-
Field Summary
-
Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNodeVector
eltClass
-
Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
-
-
Constructor Summary
Constructors Constructor Description SubqueryList(ContextManager cm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
addSubqueryNode(SubqueryNode subqueryNode)
Add a subquery to the list.(package private) void
decrementLevel(int decrement)
Decrement (query block) level (0-based) for all of the tables in this subquery list.(package private) void
markHavingSubqueries()
Mark all of the subqueries in this list as being part of a having clause, so we can avoid flattening later.(package private) void
markWhereSubqueries()
Mark all of the subqueries in this list as being part of a where clause so we can avoid flattening later if needed.(package private) void
modifyAccessPaths()
Modify the access paths for all subqueries in this list.(package private) void
optimize(DataDictionary dataDictionary, double outerRows)
Optimize the subqueries in this list.boolean
referencesSessionSchema()
Return true if the node references SESSION schema tables (temporary or permanent)(package private) boolean
referencesTarget(java.lang.String name, boolean baseTable)
Search to see if a query references the specifed table name.(package private) void
setPointOfAttachment(int pointOfAttachment)
Set the point of attachment in all subqueries in this list.-
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNodeVector
acceptChildren, addElement, destructiveAppend, elementAt, indexOf, insertElementAt, iterator, nondestructiveAppend, printSubNodes, removeAllElements, removeElement, removeElementAt, setElementAt, size
-
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
accept, addTag, addUDTUsagePriv, addUDTUsagePriv, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, copyTagsFrom, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, generate, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContext, getContextManager, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getLongProperty, getNullNode, getOffsetOrderedNodes, getOptimizerFactory, getOptimizerTracer, getParameterTypes, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, getUDTDesc, isAtomic, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeConstantAction, makeTableName, makeTableName, nodeHeader, optimizerTracingIsOn, orReliability, parseSearchCondition, parseStatement, printLabel, resolveTableToSynonym, setBeginOffset, setEndOffset, setRefActionInfo, stackPrint, taggedWith, toString, treePrint, treePrint, verifyClassExist
-
-
-
-
Constructor Detail
-
SubqueryList
SubqueryList(ContextManager cm)
-
-
Method Detail
-
addSubqueryNode
void addSubqueryNode(SubqueryNode subqueryNode) throws StandardException
Add a subquery to the list.- Parameters:
subqueryNode
- A SubqueryNode to add to the list- Throws:
StandardException
-
optimize
void optimize(DataDictionary dataDictionary, double outerRows) throws StandardException
Optimize the subqueries in this list.- Parameters:
dataDictionary
- The data dictionary to use for optimizationouterRows
- The optimizer's estimate of the number of times this subquery will be executed.- Throws:
StandardException
- Thrown on error
-
modifyAccessPaths
void modifyAccessPaths() throws StandardException
Modify the access paths for all subqueries in this list.- Throws:
StandardException
- Thrown on error- See Also:
ResultSetNode.modifyAccessPaths()
-
referencesTarget
boolean referencesTarget(java.lang.String name, boolean baseTable) throws StandardException
Search to see if a query references the specifed table name.- Parameters:
name
- Table name (String) to search for.baseTable
- Whether or not name is for a base table- Returns:
- true if found, else false
- Throws:
StandardException
- Thrown on error
-
referencesSessionSchema
public boolean referencesSessionSchema() throws StandardException
Return true if the node references SESSION schema tables (temporary or permanent)- Overrides:
referencesSessionSchema
in classQueryTreeNode
- Returns:
- true if references SESSION schema tables, else false
- Throws:
StandardException
- Thrown on error
-
setPointOfAttachment
void setPointOfAttachment(int pointOfAttachment) throws StandardException
Set the point of attachment in all subqueries in this list.- Parameters:
pointOfAttachment
- The point of attachment- Throws:
StandardException
- Thrown on error
-
decrementLevel
void decrementLevel(int decrement)
Decrement (query block) level (0-based) for all of the tables in this subquery list. This is useful when flattening a subquery.- Parameters:
decrement
- The amount to decrement by.
-
markHavingSubqueries
void markHavingSubqueries()
Mark all of the subqueries in this list as being part of a having clause, so we can avoid flattening later.
-
markWhereSubqueries
void markWhereSubqueries()
Mark all of the subqueries in this list as being part of a where clause so we can avoid flattening later if needed.
-
-