Class HashTableNode
java.lang.Object
org.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.ResultSetNode
org.apache.derby.impl.sql.compile.FromTable
org.apache.derby.impl.sql.compile.SingleChildResultSetNode
org.apache.derby.impl.sql.compile.HashTableNode
- All Implemented Interfaces:
Optimizable
,Visitable
A HashTableNode represents a result set where a hash table is built.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.derby.impl.sql.compile.ResultSetNode
ResultSetNode.QueryExpressionClauses
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) PredicateList
(package private) SubqueryList
(package private) SubqueryList
(package private) PredicateList
Fields inherited from class org.apache.derby.impl.sql.compile.SingleChildResultSetNode
childResult, hasTrulyTheBestAccessPath
Fields inherited from class org.apache.derby.impl.sql.compile.FromTable
ADD_PLAN, bestAccessPath, bestCostEstimate, bestSortAvoidancePath, correlationName, corrTableName, currentAccessPath, hashKeyColumns, initialCapacity, level, LOAD_PLAN, loadFactor, maxCapacity, origTableName, REMOVE_PLAN, tableNumber, tableProperties, trulyTheBestAccessPath, userSpecifiedJoinStrategy
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
ConstructorsConstructorDescriptionHashTableNode
(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. -
Method Summary
Modifier and TypeMethodDescription(package private) void
Accept the visitor for all visitable children of this node.(package private) void
generate
(ActivationClassBuilder acb, MethodBuilder mb) 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 fromListprivate void
generateMinion
(ExpressionClassBuilder acb, MethodBuilder mb, boolean genChildResultSet) Logic shared by generate() and generateResultSet().(package private) void
General logic shared by Core compilation and by the Replication Filter compiler.modifyAccessPath
(JBitSet outerTables, Optimizer optimizer) (package private) void
printSubNodes
(int depth) Prints the sub-nodes of this object.Methods inherited from class org.apache.derby.impl.sql.compile.SingleChildResultSetNode
addNewPredicate, adjustForSortElimination, adjustForSortElimination, changeAccessPath, decrementLevel, ensurePredicateList, flattenableInFromSubquery, forUpdate, getChildResult, getFinalCostEstimate, getFromTableByName, getTrulyTheBestAccessPath, initAccessPaths, isNotExists, isOneRowResultSet, isOrderedOn, modifyAccessPaths, optimize, preprocess, pullOptPredicates, pushExpressions, referencesSessionSchema, referencesTarget, reflectionNeededForProjection, setChildResult, setLevel, subqueryReferencesTarget, updateBestPlanMap, updateTargetLockMode
Methods inherited from class org.apache.derby.impl.sql.compile.FromTable
assignCostEstimate, canBeOrdered, columnsAreUpdatable, considerSortAvoidancePath, convertAbsoluteToRelativeColumnPosition, cursorTargetTable, estimateCost, feasibleJoinStrategy, fillInReferencedTableMap, flatten, getBaseTableName, getBestAccessPath, getBestSortAvoidancePath, getCorrelationName, getCostEstimate, getCurrentAccessPath, getExposedName, getLevel, getMergeTableID, getName, getNumColumnsReturned, getOrigTableName, getProperties, getResultColumnsForList, getSchemaDescriptor, getSchemaDescriptor, getScratchCostEstimate, getTableDescriptor, getTableName, getTableNumber, getUserSpecifiedJoinStrategy, hashKeyColumns, hasLargeObjectColumns, hasTableNumber, initialCapacity, isBaseTable, isCoveringIndex, isFlattenableJoinNode, isJoinColumnForRightOuterJoin, isMaterializable, isOneRowScan, isTargetTable, legalJoinOrder, loadFactor, LOJ_reorderable, markUpdatableByCursor, maxCapacity, memoryUsageOK, modifyAccessPath, needsSpecialRCLBinding, nextAccessPath, optimizeIt, optimizeSubqueries, pushOptPredicate, rememberAsBest, rememberJoinStrategyAsBest, rememberSortAvoidancePath, resetJoinStrategies, setCostEstimateCost, setHashKeyColumns, setMergeTableID, setOrigTableName, setProperties, setTableNumber, startOptimizing, supportsMultipleInstantiations, tellRowOrderingAboutConstantColumns, toString, transformOuterJoins, uniqueJoin, verifyProperties
Methods inherited from class org.apache.derby.impl.sql.compile.ResultSetNode
assignResultSetNumber, bindExpressions, bindExpressionsWithTables, bindNonVTITables, bindResultColumns, bindResultColumns, bindTargetExpressions, bindUntypedNullsToResultColumns, bindVTITables, columnTypesAndLengthsMatch, considerMaterialization, enhanceRCLForInsert, generateNormalizationResultSet, genProjectRestrict, genProjectRestrict, genProjectRestrictForReordering, getAllResultColumns, getCandidateFinalCostEstimate, getCostEstimate, getCursorTargetTable, getFromList, getMatchingColumn, getNewCostEstimate, getOptimizer, getOptimizerImpl, getRCLForInsert, getReferencedTableMap, getResultColumns, getResultSetNumber, getScratchCostEstimate, isCursorTargetTable, isInsertSource, isPossibleDistinctScan, isStatementResultSet, isUpdatableCursor, LOJgetReferencedTables, makeResultDescription, makeResultDescriptors, markAsCursorTargetTable, markForDistinctScan, markStatementResultSet, modifyAccessPaths, notCursorTargetTable, notFlattenableJoin, numDistinctAggregates, parseDefault, performMaterialization, printQueryExpressionSuffixClauses, projectResultColumns, pushOffsetFetchFirst, pushOrderByList, pushQueryExpressionSuffix, rejectParameters, rejectXMLValues, renameGeneratedResultNames, replaceOrForbidDefaults, returnsAtMostOneRow, setCandidateFinalCostEstimate, setCostEstimate, setCursorTargetTable, setInsertSource, setOptimizer, setReferencedTableMap, setResultColumns, setResultSetNumber, setResultToBooleanTrueNode, setScratchCostEstimate, setTableConstructorTypes, verifySelectStarSubquery
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, 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, treePrint, treePrint, verifyClassExist
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.Optimizable
getDataDictionary, getOptimizerTracer, getReferencedTableMap, getResultSetNumber, optimizerTracingIsOn
Methods inherited from interface org.apache.derby.iapi.sql.compile.Visitable
accept, addTag, taggedWith
-
Field Details
-
searchPredicateList
PredicateList searchPredicateList -
joinPredicateList
PredicateList joinPredicateList -
pSubqueryList
SubqueryList pSubqueryList -
rSubqueryList
SubqueryList rSubqueryList
-
-
Constructor Details
-
HashTableNode
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
- The child result settableProperties
- Properties list associated with the tableresultColumns
- The RCL.searchPredicateList
- Single table clausesjoinPredicateList
- Multi table clausesaccessPath
- The access pathcostEstimate
- The cost estimatepSubqueryList
- List of subqueries in RCLrSubqueryList
- List of subqueries in Predicate listshashKeyColumns
- Hash key columnscm
- The context manager
-
-
Method Details
-
modifyAccessPath
public Optimizable modifyAccessPath(JBitSet outerTables, Optimizer optimizer) throws StandardException - Throws:
StandardException
- Thrown on error- See Also:
-
printSubNodes
void printSubNodes(int depth) Prints the sub-nodes of this object. See QueryTreeNode.java for how tree printing is supposed to work.- Overrides:
printSubNodes
in classSingleChildResultSetNode
- Parameters:
depth
- The depth of this node in the tree
-
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- Overrides:
generate
in classQueryTreeNode
- Parameters:
acb
- The ActivationClassBuilder for the class being builtmb
- The method for the generated code to go into- Throws:
StandardException
- Thrown on error
-
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.- Overrides:
generateResultSet
in classResultSetNode
- Parameters:
acb
- The ExpressionClassBuilder for the class being builtmb
- the method the expression will go into- Throws:
StandardException
- Thrown on error
-
generateMinion
private void generateMinion(ExpressionClassBuilder acb, MethodBuilder mb, boolean genChildResultSet) throws StandardException Logic shared by generate() and generateResultSet().- Parameters:
acb
- The ExpressionClassBuilder for the class being builtmb
- the method the expression will go into- Throws:
StandardException
- Thrown on error
-
acceptChildren
Accept the visitor for all visitable children of this node.- Overrides:
acceptChildren
in classSingleChildResultSetNode
- Parameters:
v
- the visitor- Throws:
StandardException
- on error
-