Top Description Fields Constructors Methods
org.apache.derby.impl.sql.compile

pack-priv Class SubqueryList

extends QueryTreeNodeVector<SubqueryNode>
Class Inheritance
Imports
org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.services.context.ContextManager, org.apache.derby.iapi.sql.dictionary.DataDictionary

A SubqueryList represents a list of subqueries within a specific clause (select, where or having) in a DML statement. It extends QueryTreeNodeVector.

Field Summary

Inherited from org.apache.derby.impl.sql.compile.QueryTreeNodeVector:
eltClass

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
addSubqueryNode(SubqueryNode
A SubqueryNode to add to the list
subqueryNode
)

Add a subquery to the list.

pack-priv void
decrementLevel(int
The amount to decrement by.
decrement
)

Decrement (query block) level (0-based) for all of the tables in this subquery list.

pack-priv void
markHavingSubqueries()

Mark all of the subqueries in this list as being part of a having clause, so we can avoid flattening later.

pack-priv 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.

pack-priv void
modifyAccessPaths()

Modify the access paths for all subqueries in this list.

pack-priv void
optimize(DataDictionary
The data dictionary to use for optimization
dataDictionary
,
double
The optimizer's estimate of the number of times this subquery will be executed.
outerRows
)

Optimize the subqueries in this list.

public boolean

Returns:

true if references SESSION schema tables, else false
referencesSessionSchema
()

Overrides org.apache.derby.impl.sql.compile.QueryTreeNode.referencesSessionSchema.

Return true if the node references SESSION schema tables (temporary or permanent)

pack-priv boolean

Returns:

true if found, else false
referencesTarget
(String
Table name (String) to search for.
name
,
boolean
Whether or not name is for a base table
baseTable
)

Search to see if a query references the specifed table name.

pack-priv void
setPointOfAttachment(int
The point of attachment
pointOfAttachment
)

Set the point of attachment in all subqueries in this list.

Inherited from org.apache.derby.impl.sql.compile.QueryTreeNodeVector:
acceptChildrenaddElementdestructiveAppendelementAtindexOfinsertElementAtiteratornondestructiveAppendprintSubNodesremoveAllElementsremoveElementremoveElementAtsetElementAtsize

Constructor Detail

SubqueryListback to summary
pack-priv SubqueryList(ContextManager cm)

Method Detail

addSubqueryNodeback to summary
pack-priv void addSubqueryNode(SubqueryNode subqueryNode) throws StandardException

Add a subquery to the list.

Parameters
subqueryNode:SubqueryNode

A SubqueryNode to add to the list

decrementLevelback to summary
pack-priv 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:int

The amount to decrement by.

markHavingSubqueriesback to summary
pack-priv void markHavingSubqueries()

Mark all of the subqueries in this list as being part of a having clause, so we can avoid flattening later.

markWhereSubqueriesback to summary
pack-priv 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.

modifyAccessPathsback to summary
pack-priv void modifyAccessPaths() throws StandardException

Modify the access paths for all subqueries in this list.

Exceptions
StandardException:
Thrown on error
See Also
ResultSetNode#modifyAccessPaths
optimizeback to summary
pack-priv void optimize(DataDictionary dataDictionary, double outerRows) throws StandardException

Optimize the subqueries in this list.

Parameters
dataDictionary:DataDictionary

The data dictionary to use for optimization

outerRows:double

The optimizer's estimate of the number of times this subquery will be executed.

Exceptions
StandardException:
Thrown on error
referencesSessionSchemaback to summary
public boolean referencesSessionSchema() throws StandardException

Overrides org.apache.derby.impl.sql.compile.QueryTreeNode.referencesSessionSchema.

Return true if the node references SESSION schema tables (temporary or permanent)

Returns:boolean

true if references SESSION schema tables, else false

Annotations
@Override
Exceptions
StandardException:
Thrown on error
referencesTargetback to summary
pack-priv boolean referencesTarget(String name, boolean baseTable) throws StandardException

Search to see if a query references the specifed table name.

Parameters
name:String

Table name (String) to search for.

baseTable:boolean

Whether or not name is for a base table

Returns:boolean

true if found, else false

Exceptions
StandardException:
Thrown on error
setPointOfAttachmentback to summary
pack-priv void setPointOfAttachment(int pointOfAttachment) throws StandardException

Set the point of attachment in all subqueries in this list.

Parameters
pointOfAttachment:int

The point of attachment

Exceptions
StandardException:
Thrown on error