Optimizable
, Visitable
class UnionNode extends SetOperatorNode
ResultSetNode.QueryExpressionClauses
Modifier and Type | Field | Description |
---|---|---|
private boolean |
addNewNodesCalled |
|
(package private) boolean |
tableConstructor |
|
(package private) boolean |
topTableConstructor |
ADD_PLAN, bestAccessPath, bestCostEstimate, bestSortAvoidancePath, correlationName, corrTableName, currentAccessPath, hashKeyColumns, initialCapacity, level, LOAD_PLAN, loadFactor, maxCapacity, origTableName, REMOVE_PLAN, tableNumber, tableProperties, trulyTheBestAccessPath, userSpecifiedJoinStrategy
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
all, qec
leftOptimizer, leftResultSet, rightOptimizer, rightResultSet
Constructor | Description |
---|---|
UnionNode(ResultSetNode leftResult,
ResultSetNode rightResult,
boolean all,
boolean tableConstructor,
java.util.Properties tableProperties,
ContextManager cm) |
Constructor for a UnionNode.
|
Modifier and Type | Method | Description |
---|---|---|
private ResultSetNode |
addNewNodes() |
Add any new ResultSetNodes that are necessary to the tree.
|
void |
bindExpressions(FromList fromListParam) |
Bind the expressions under this TableOperatorNode.
|
(package private) ResultSetNode |
enhanceRCLForInsert(InsertNode target,
boolean inOrder,
int[] colMap) |
Make the RCL of this node match the target node for the insert.
|
(package private) void |
generate(ActivationClassBuilder acb,
MethodBuilder mb) |
Generate the code for this UnionNode.
|
(package private) CostEstimate |
getFinalCostEstimate() |
Get the final CostEstimate for this FromTable.
|
(package private) java.lang.String |
getOperatorName() |
|
(package private) void |
markTopTableConstructor() |
Mark this as the top node of a table constructor.
|
Optimizable |
modifyAccessPath(JBitSet outerTables) |
Modify the access path for this Optimizable, as necessary.
|
(package private) ResultSetNode |
modifyAccessPaths() |
Modify the access paths according to the decisions the optimizer
made.
|
CostEstimate |
optimizeIt(Optimizer optimizer,
OptimizablePredicateList predList,
CostEstimate outerCost,
RowOrdering rowOrdering) |
Choose the best access path for this Optimizable.
|
(package private) void |
pushExpressions(PredicateList predicateList) |
DERBY-649: Handle pushing predicates into UnionNodes.
|
(package private) void |
rejectParameters() |
Check for (and reject) ?
|
(package private) void |
setTableConstructorTypes(ResultColumnList typeColumns) |
Set the type of column in the result column lists of each
source of this union tree to the type in the given result column list
(which represents the result columns for an insert).
|
(package private) boolean |
tableConstructor() |
Tell whether this is a UNION for a table constructor.
|
java.lang.String |
toString() |
Convert this object to a String.
|
assignCostEstimate, canBeOrdered, columnsAreUpdatable, considerSortAvoidancePath, convertAbsoluteToRelativeColumnPosition, cursorTargetTable, estimateCost, feasibleJoinStrategy, fillInReferencedTableMap, flatten, forUpdate, getBaseTableName, getBestAccessPath, getBestSortAvoidancePath, getCorrelationName, getCostEstimate, getCurrentAccessPath, getLevel, getMergeTableID, getName, getNumColumnsReturned, getOrigTableName, getProperties, getResultColumnsForList, getSchemaDescriptor, getSchemaDescriptor, getScratchCostEstimate, getTableDescriptor, getTableName, getTableNumber, getTrulyTheBestAccessPath, getUserSpecifiedJoinStrategy, hashKeyColumns, hasLargeObjectColumns, hasTableNumber, initAccessPaths, initialCapacity, isBaseTable, isCoveringIndex, isFlattenableJoinNode, isJoinColumnForRightOuterJoin, isMaterializable, isOneRowScan, isTargetTable, legalJoinOrder, loadFactor, LOJ_reorderable, markUpdatableByCursor, maxCapacity, memoryUsageOK, nextAccessPath, optimizeSubqueries, rememberAsBest, rememberJoinStrategyAsBest, rememberSortAvoidancePath, resetJoinStrategies, setCostEstimateCost, setHashKeyColumns, setMergeTableID, setOrigTableName, setProperties, setTableNumber, startOptimizing, supportsMultipleInstantiations, tellRowOrderingAboutConstantColumns, transformOuterJoins, uniqueJoin
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDataDictionary, getOptimizerTracer, getReferencedTableMap, getResultSetNumber, optimizerTracingIsOn
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
addNewPredicate, assignResultSetNumber, changeAccessPath, columnTypesAndLengthsMatch, considerMaterialization, generateNormalizationResultSet, generateResultSet, genProjectRestrict, genProjectRestrict, genProjectRestrictForReordering, getAllResultColumns, getCandidateFinalCostEstimate, getCostEstimate, getCursorTargetTable, getFromList, getMatchingColumn, getNewCostEstimate, getOptimizer, getOptimizerImpl, getRCLForInsert, getReferencedTableMap, getResultColumns, getResultSetNumber, getScratchCostEstimate, isCursorTargetTable, isInsertSource, isNotExists, isOneRowResultSet, isOrderedOn, isPossibleDistinctScan, isStatementResultSet, isUpdatableCursor, LOJgetReferencedTables, makeResultDescription, makeResultDescriptors, markAsCursorTargetTable, markForDistinctScan, markStatementResultSet, modifyAccessPaths, notCursorTargetTable, notFlattenableJoin, numDistinctAggregates, parseDefault, printQueryExpressionSuffixClauses, rejectXMLValues, renameGeneratedResultNames, returnsAtMostOneRow, setCandidateFinalCostEstimate, setCostEstimate, setCursorTargetTable, setInsertSource, setOptimizer, setReferencedTableMap, setResultColumns, setResultSetNumber, setScratchCostEstimate, subqueryReferencesTarget, updateTargetLockMode
bindResultColumns, bindResultColumns, bindTargetExpressions, bindUntypedNullsToResultColumns, ensurePredicateList, flattenableInFromSubquery, getFromTableByName, getLeftOptPredicateList, getParamColumnTypes, getRightOptPredicateList, hasUnPushedPredicates, modifyAccessPath, performMaterialization, preprocess, printSubNodes, pullOptPredicates, pushOffsetFetchFirst, pushOptPredicate, pushOrderByList, pushQueryExpressionSuffix, replaceOrForbidDefaults, setParamColumnTypes, setResultToBooleanTrueNode, verifySelectStarSubquery
acceptChildren, adjustForSortElimination, adjustForSortElimination, bindExpressionsWithTables, bindNonVTITables, bindVTITables, decrementLevel, getExposedName, getLeftmostResultSet, getLeftResultSet, getRightResultSet, needsSpecialRCLBinding, optimize, optimizeSource, projectResultColumns, referencesSessionSchema, referencesTarget, setLeftmostResultSet, setLevel, setNestedInParens, setReferencedColumns, updateBestPlanMap, verifyProperties
accept, addTag, taggedWith
private boolean addNewNodesCalled
boolean tableConstructor
boolean topTableConstructor
UnionNode(ResultSetNode leftResult, ResultSetNode rightResult, boolean all, boolean tableConstructor, java.util.Properties tableProperties, ContextManager cm) throws StandardException
leftResult
- The ResultSetNode on the left side of this unionrightResult
- The ResultSetNode on the right side of this unionall
- Whether or not this is a UNION ALL.tableConstructor
- Whether or not this is from a table constructor.tableProperties
- Properties list associated with the tableStandardException
- Thrown on errorvoid markTopTableConstructor()
boolean tableConstructor()
void rejectParameters() throws StandardException
rejectParameters
in class TableOperatorNode
StandardException
- Thrown if a ? parameter found
directly under a ResultColumnvoid setTableConstructorTypes(ResultColumnList typeColumns) throws StandardException
setTableConstructorTypes
in class ResultSetNode
typeColumns
- The ResultColumnList containing the desired result
types.StandardException
- Thrown on errorResultSetNode enhanceRCLForInsert(InsertNode target, boolean inOrder, int[] colMap) throws StandardException
enhanceRCLForInsert
in class ResultSetNode
target
- the target node for the insertinOrder
- are source cols in same order as target cols?colMap
- int array representation of correspondence between
RCLs - colmap[i] = -1 -> missing in current RCL
colmap[i] = j -> targetRCL(i) <-> thisRCL(j+1)StandardException
- Thrown on errorpublic CostEstimate optimizeIt(Optimizer optimizer, OptimizablePredicateList predList, CostEstimate outerCost, RowOrdering rowOrdering) throws StandardException
Optimizable
optimizeIt
in interface Optimizable
optimizeIt
in class FromTable
optimizer
- Optimizer to use.predList
- The predicate list to optimize againstouterCost
- The CostEstimate for the outer tables in the join order,
telling how many times this Optimizable will be scanned.rowOrdering
- The row ordering for all the tables in the
join order, including this one.StandardException
- Thrown on errorOptimizable.optimizeIt(org.apache.derby.iapi.sql.compile.Optimizer, org.apache.derby.iapi.sql.compile.OptimizablePredicateList, org.apache.derby.iapi.sql.compile.CostEstimate, org.apache.derby.iapi.sql.compile.RowOrdering)
void pushExpressions(PredicateList predicateList) throws StandardException
pushExpressions
in class FromTable
predicateList
- List of single table predicates to pushStandardException
- Thrown on errorpublic Optimizable modifyAccessPath(JBitSet outerTables) throws StandardException
Optimizable
modifyAccessPath
in interface Optimizable
modifyAccessPath
in class TableOperatorNode
outerTables
- Bit map of the tables that are outer to this one
in the join order.StandardException
- Thrown on errorOptimizable.modifyAccessPath(org.apache.derby.iapi.util.JBitSet)
ResultSetNode modifyAccessPaths() throws StandardException
ResultSetNode
modifyAccessPaths
in class TableOperatorNode
StandardException
- Thrown on errorResultSetNode.modifyAccessPaths()
private ResultSetNode addNewNodes() throws StandardException
StandardException
- Thrown on errorpublic java.lang.String toString()
toString
in class SetOperatorNode
public void bindExpressions(FromList fromListParam) throws StandardException
bindExpressions
in class SetOperatorNode
fromListParam
- FromList to use/append to.StandardException
- Thrown on errorvoid generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException
generate
in class QueryTreeNode
acb
- The ActivationClassBuilder for the class being builtmb
- The method for the generated code to go intoStandardException
- Thrown on errorCostEstimate getFinalCostEstimate() throws StandardException
FromTable
getFinalCostEstimate
in class FromTable
StandardException
Get the final CostEstimate for this UnionNode.
java.lang.String getOperatorName()
getOperatorName
in class SetOperatorNode
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.