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

pack-priv Class HashTableNode

extends SingleChildResultSetNode
Class Inheritance
Imports
java.util.Properties, org.apache.derby.catalog.types.ReferencedColumnsDescriptorImpl, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.ClassName, org.apache.derby.iapi.services.classfile.VMOpcode, org.apache.derby.iapi.services.compiler.MethodBuilder, org.apache.derby.iapi.services.context.ContextManager, org.apache.derby.iapi.services.io.FormatableArrayHolder, .FormatableIntHolder, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.compile.CostEstimate, .Optimizable, .Optimizer, .Visitor, org.apache.derby.iapi.util.JBitSet

A HashTableNode represents a result set where a hash table is built.

Field Summary

Modifier and TypeField and Description
pack-priv PredicateList
pack-priv SubqueryList
pack-priv SubqueryList
pack-priv PredicateList
Inherited from org.apache.derby.impl.sql.compile.SingleChildResultSetNode:
childResulthasTrulyTheBestAccessPath

Constructor Summary

AccessConstructor and Description
pack-priv
HashTableNode(ResultSetNode
The child result set
childResult
,
Properties
Properties list associated with the table
tableProperties
,
ResultColumnList
The RCL.
resultColumns
,
PredicateList
Single table clauses
searchPredicateList
,
PredicateList
Multi table clauses
joinPredicateList
,
AccessPathImpl
The access path
accessPath
,
CostEstimate
The cost estimate
costEstimate
,
SubqueryList
List of subqueries in RCL
pSubqueryList
,
SubqueryList
List of subqueries in Predicate lists
rSubqueryList
,
int[]
Hash key columns
hashKeyColumns
,
ContextManager
The context manager
cm
)

Constructor for a HashTableNode.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
acceptChildren(Visitor
the visitor
v
)

Overrides org.apache.derby.impl.sql.compile.SingleChildResultSetNode.acceptChildren.

Accept the visitor for all visitable children of this node.

pack-priv void
generate(ActivationClassBuilder
The ActivationClassBuilder for the class being built
acb
,
MethodBuilder
The method for the generated code to go into
mb
)

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

For joins, the tree will be (nodes are left out if the clauses are empty): ProjectRestrictResultSet -- for the having and the select list SortResultSet -- for the group by list ProjectRestrictResultSet -- for the where and the select list (if no group or having) the result set for the fromList

private void
generateMinion(ExpressionClassBuilder
The ExpressionClassBuilder for the class being built
acb
,
MethodBuilder
the method the expression will go into
mb
,
boolean genChildResultSet)

Logic shared by generate() and generateResultSet().

pack-priv void
generateResultSet(ExpressionClassBuilder
The ExpressionClassBuilder for the class being built
acb
,
MethodBuilder
the method the expression will go into
mb
)

Overrides org.apache.derby.impl.sql.compile.ResultSetNode.generateResultSet.

General logic shared by Core compilation and by the Replication Filter compiler.

public Optimizable
modifyAccessPath(JBitSet outerTables, Optimizer optimizer)

pack-priv void
printSubNodes(int
The depth of this node in the tree
depth
)

Overrides org.apache.derby.impl.sql.compile.SingleChildResultSetNode.printSubNodes.

Prints the sub-nodes of this object.

Inherited from org.apache.derby.impl.sql.compile.SingleChildResultSetNode:
addNewPredicateadjustForSortEliminationadjustForSortEliminationchangeAccessPathdecrementLevelensurePredicateListflattenableInFromSubqueryforUpdategetChildResultgetFinalCostEstimategetFromTableByNamegetTrulyTheBestAccessPathinitAccessPathsisNotExistsisOneRowResultSetisOrderedOnmodifyAccessPathsoptimizepreprocesspullOptPredicatespushExpressionsreferencesSessionSchemareferencesTargetreflectionNeededForProjectionsetChildResultsetLevelsubqueryReferencesTargetupdateBestPlanMapupdateTargetLockMode

Field Detail

joinPredicateListback to summary
pack-priv PredicateList joinPredicateList
pSubqueryListback to summary
pack-priv SubqueryList pSubqueryList
rSubqueryListback to summary
pack-priv SubqueryList rSubqueryList
searchPredicateListback to summary
pack-priv PredicateList searchPredicateList

Constructor Detail

HashTableNodeback to summary
pack-priv HashTableNode(ResultSetNode childResult, Properties tableProperties, ResultColumnList resultColumns, PredicateList searchPredicateList, PredicateList joinPredicateList, AccessPathImpl accessPath, CostEstimate costEstimate, SubqueryList pSubqueryList, SubqueryList rSubqueryList, int[] hashKeyColumns, ContextManager cm)

Constructor for a HashTableNode.

Parameters
childResult:ResultSetNode

The child result set

tableProperties:Properties

Properties list associated with the table

resultColumns:ResultColumnList

The RCL.

searchPredicateList:PredicateList

Single table clauses

joinPredicateList:PredicateList

Multi table clauses

accessPath:AccessPathImpl

The access path

costEstimate:CostEstimate

The cost estimate

pSubqueryList:SubqueryList

List of subqueries in RCL

rSubqueryList:SubqueryList

List of subqueries in Predicate lists

hashKeyColumns:int[]

Hash key columns

cm:ContextManager

The context manager

Method Detail

acceptChildrenback to summary
pack-priv void acceptChildren(Visitor v) throws StandardException

Overrides org.apache.derby.impl.sql.compile.SingleChildResultSetNode.acceptChildren.

Accept the visitor for all visitable children of this node.

Parameters
v:Visitor

the visitor

Annotations
@Override
Exceptions
StandardException:
on error
generateback to summary
pack-priv void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException

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

For joins, the tree will be (nodes are left out if the clauses are empty): ProjectRestrictResultSet -- for the having and the select list SortResultSet -- for the group by list ProjectRestrictResultSet -- for the where and the select list (if no group or having) the result set for the fromList

Parameters
acb:ActivationClassBuilder

Doc from org.apache.derby.impl.sql.compile.QueryTreeNode.generate.

The ActivationClassBuilder for the class being built

mb:MethodBuilder

Doc from org.apache.derby.impl.sql.compile.QueryTreeNode.generate.

The method for the generated code to go into

Annotations
@Override
Exceptions
StandardException:
Thrown on error
generateMinionback to summary
private void generateMinion(ExpressionClassBuilder acb, MethodBuilder mb, boolean genChildResultSet) throws StandardException

Logic shared by generate() and generateResultSet().

Parameters
acb:ExpressionClassBuilder

The ExpressionClassBuilder for the class being built

mb:MethodBuilder

the method the expression will go into

Exceptions
StandardException:
Thrown on error
generateResultSetback to summary
pack-priv void generateResultSet(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException

Overrides org.apache.derby.impl.sql.compile.ResultSetNode.generateResultSet.

General logic shared by Core compilation and by the Replication Filter compiler. A couple ResultSets (the ones used by PREPARE SELECT FILTER) implement this method.

Parameters
acb:ExpressionClassBuilder

The ExpressionClassBuilder for the class being built

mb:MethodBuilder

the method the expression will go into

Annotations
@Override
Exceptions
StandardException:
Thrown on error
modifyAccessPathback to summary
public Optimizable modifyAccessPath(JBitSet outerTables, Optimizer optimizer) throws StandardException
Exceptions
StandardException:
Thrown on error
See Also
Optimizable#modifyAccessPath
printSubNodesback to summary
pack-priv void printSubNodes(int depth)

Overrides org.apache.derby.impl.sql.compile.SingleChildResultSetNode.printSubNodes.

Prints the sub-nodes of this object. See QueryTreeNode.java for how tree printing is supposed to work.

Parameters
depth:int

The depth of this node in the tree

Annotations
@Override