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:
Iterable<SubqueryNode>
,Visitable
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 -
Method Summary
Modifier and TypeMethodDescription(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
Mark all of the subqueries in this list as being part of a having clause, so we can avoid flattening later.(package private) void
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
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
Return true if the node references SESSION schema tables (temporary or permanent)(package private) boolean
referencesTarget
(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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
SubqueryList
SubqueryList(ContextManager cm)
-
-
Method Details
-
addSubqueryNode
Add a subquery to the list.- Parameters:
subqueryNode
- A SubqueryNode to add to the list- Throws:
StandardException
-
optimize
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
Modify the access paths for all subqueries in this list.- Throws:
StandardException
- Thrown on error- See Also:
-
referencesTarget
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
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
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.
-