Optimizable
, Visitable
JoinNode
, SetOperatorNode
abstract class TableOperatorNode extends FromTable
ResultSetNode.QueryExpressionClauses
Modifier and Type | Field | Description |
---|---|---|
private boolean |
leftModifyAccessPathsDone |
|
(package private) Optimizer |
leftOptimizer |
|
(package private) ResultSetNode |
leftResultSet |
|
private boolean |
rightModifyAccessPathsDone |
|
(package private) Optimizer |
rightOptimizer |
|
(package private) ResultSetNode |
rightResultSet |
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
Constructor | Description |
---|---|
TableOperatorNode(ResultSetNode leftResultSet,
ResultSetNode rightResultSet,
java.util.Properties tableProperties,
ContextManager cm) |
Constructor for a TableOperatorNode.
|
Modifier and Type | Method | Description |
---|---|---|
(package private) void |
acceptChildren(Visitor v) |
Accept the visitor for all visitable children of this node.
|
(package private) void |
adjustForSortElimination() |
Notify the underlying result set tree that the optimizer has chosen
to "eliminate" a sort.
|
(package private) void |
adjustForSortElimination(RequiredRowOrdering rowOrdering) |
Same goal as adjustForSortElimination above, but this version
takes a RequiredRowOrdering to allow nodes to adjust based on
the ORDER BY clause, if needed.
|
(package private) void |
bindExpressions(FromList fromListParam) |
Bind the expressions under this TableOperatorNode.
|
(package private) void |
bindExpressionsWithTables(FromList fromListParam) |
Bind the expressions in this ResultSetNode if it has tables.
|
(package private) ResultSetNode |
bindNonVTITables(DataDictionary dataDictionary,
FromList fromListParam) |
Bind the non VTI tables in this TableOperatorNode.
|
(package private) void |
bindResultColumns(TableDescriptor targetTableDescriptor,
FromVTI targetVTI,
ResultColumnList targetColumnList,
DMLStatementNode statement,
FromList fromListParam) |
Bind the result columns for this ResultSetNode to a base table.
|
(package private) void |
bindResultColumns(FromList fromListParam) |
Bind the result columns of this ResultSetNode when there is no
base table to bind them to.
|
(package private) void |
bindUntypedNullsToResultColumns(ResultColumnList rcl) |
DERBY-4365
Bind untyped nulls to the types in the given ResultColumnList.
|
(package private) ResultSetNode |
bindVTITables(FromList fromListParam) |
Bind the VTI tables in this TableOperatorNode.
|
(package private) void |
decrementLevel(int decrement) |
Decrement (query block) level (0-based) for
all of the tables in this ResultSet tree.
|
(package private) java.lang.String |
getExposedName() |
Return the exposed name for this table, which is the name that
can be used to refer to this table in the rest of the query.
|
(package private) FromTable |
getFromTableByName(java.lang.String name,
java.lang.String schemaName,
boolean exactMatch) |
Determine whether or not the specified name is an exposed name in
the current query block.
|
(package private) ResultSetNode |
getLeftmostResultSet() |
|
(package private) ResultSetNode |
getLeftResultSet() |
Get the leftResultSet from this node.
|
(package private) ResultSetNode |
getRightResultSet() |
Get the rightResultSet from this node.
|
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.
|
(package private) boolean |
needsSpecialRCLBinding() |
apparently something special needs to be done for me....
|
(package private) ResultSetNode |
optimize(DataDictionary dataDictionary,
PredicateList predicateList,
double outerRows) |
Optimize a TableOperatorNode.
|
protected ResultSetNode |
optimizeSource(Optimizer optimizer,
ResultSetNode sourceResultSet,
PredicateList predList,
CostEstimate outerCost) |
Optimize a source result set to this table operator.
|
(package private) ResultSetNode |
preprocess(int numTables,
GroupByList gbl,
FromList fromList) |
Put a ProjectRestrictNode on top of each FromTable in the FromList.
|
(package private) void |
printSubNodes(int depth) |
Prints the sub-nodes of this object.
|
(package private) void |
projectResultColumns() |
Find the unreferenced result columns and project them out.
|
boolean |
referencesSessionSchema() |
Return true if the node references SESSION schema tables (temporary or permanent)
|
(package private) boolean |
referencesTarget(java.lang.String name,
boolean baseTable) |
Search to see if a query references the specifed table name.
|
(package private) void |
rejectParameters() |
Check for (and reject) ?
|
(package private) void |
setLeftmostResultSet(ResultSetNode newLeftResultSet) |
|
(package private) void |
setLevel(int level) |
Set the (query block) level (0-based) for this FromTable.
|
(package private) void |
setNestedInParens(boolean nestedInParens) |
Mark whether or not this node is nested in parens.
|
(package private) void |
setReferencedColumns() |
Set the referenced columns in the column list if it may not be correct.
|
java.lang.String |
toString() |
Convert this object to a String.
|
void |
updateBestPlanMap(short action,
java.lang.Object planKey) |
When remembering "truly the best" access path for an Optimizable, we
have to keep track of which OptimizerImpl the "truly the best" access
is for.
|
void |
verifyProperties(DataDictionary dDictionary) |
Verify that the Properties list with optimizer overrides, if specified, is valid
|
assignCostEstimate, canBeOrdered, columnsAreUpdatable, considerSortAvoidancePath, convertAbsoluteToRelativeColumnPosition, cursorTargetTable, estimateCost, feasibleJoinStrategy, fillInReferencedTableMap, flatten, forUpdate, getBaseTableName, getBestAccessPath, getBestSortAvoidancePath, getCorrelationName, getCostEstimate, getCurrentAccessPath, getFinalCostEstimate, 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, optimizeIt, optimizeSubqueries, pullOptPredicates, pushExpressions, pushOptPredicate, 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, 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, treePrint, treePrint, verifyClassExist
addNewPredicate, assignResultSetNumber, bindTargetExpressions, changeAccessPath, columnTypesAndLengthsMatch, considerMaterialization, enhanceRCLForInsert, ensurePredicateList, flattenableInFromSubquery, 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, performMaterialization, printQueryExpressionSuffixClauses, pushOffsetFetchFirst, pushOrderByList, pushQueryExpressionSuffix, rejectXMLValues, renameGeneratedResultNames, replaceOrForbidDefaults, returnsAtMostOneRow, setCandidateFinalCostEstimate, setCostEstimate, setCursorTargetTable, setInsertSource, setOptimizer, setReferencedTableMap, setResultColumns, setResultSetNumber, setResultToBooleanTrueNode, setScratchCostEstimate, setTableConstructorTypes, subqueryReferencesTarget, updateTargetLockMode, verifySelectStarSubquery
accept, addTag, taggedWith
ResultSetNode leftResultSet
ResultSetNode rightResultSet
Optimizer leftOptimizer
Optimizer rightOptimizer
private boolean leftModifyAccessPathsDone
private boolean rightModifyAccessPathsDone
TableOperatorNode(ResultSetNode leftResultSet, ResultSetNode rightResultSet, java.util.Properties tableProperties, ContextManager cm) throws StandardException
leftResultSet
- The ResultSetNode on the left side of this noderightResultSet
- The ResultSetNode on the right side of this nodetableProperties
- Properties list associated with the tablecm
- The context managerStandardException
- Thrown on errorvoid bindUntypedNullsToResultColumns(ResultColumnList rcl) throws StandardException
bindUntypedNullsToResultColumns
in class ResultSetNode
rcl
- The ResultColumnList with the types to bind nulls toStandardException
- Thrown on errorpublic Optimizable modifyAccessPath(JBitSet outerTables) throws StandardException
Optimizable
modifyAccessPath
in interface Optimizable
modifyAccessPath
in class FromTable
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)
public void verifyProperties(DataDictionary dDictionary) throws StandardException
Optimizable
verifyProperties
in interface Optimizable
verifyProperties
in class FromTable
dDictionary
- The DataDictionary to use.StandardException
- Thrown on errorOptimizable.verifyProperties(org.apache.derby.iapi.sql.dictionary.DataDictionary)
public void updateBestPlanMap(short action, java.lang.Object planKey) throws StandardException
Optimizable
updateBestPlanMap
in interface Optimizable
updateBestPlanMap
in class FromTable
action
- Indicates whether we're adding, loading, or removing
a best plan for the OptimizerImpl/Optimizable.planKey
- Object to use as the map key when adding/looking up
a plan. If it is an instance of OptimizerImpl then it corresponds
to an outer query; otherwise it's some Optimizable above this
Optimizable that could potentially reject plans chosen by the
OptimizerImpl to which this Optimizable belongs.StandardException
Makes a call to add/load/remove the plan mapping for this node,
and then makes the necessary call to recurse on this node's
left and right child, in order to ensure that we've handled
the full plan all the way down this node's subtree.
public java.lang.String toString()
void printSubNodes(int depth)
printSubNodes
in class ResultSetNode
depth
- The depth of this node in the treeResultSetNode getLeftResultSet()
ResultSetNode getRightResultSet()
ResultSetNode getLeftmostResultSet()
void setLeftmostResultSet(ResultSetNode newLeftResultSet)
void setLevel(int level)
java.lang.String getExposedName()
getExposedName
in class FromTable
void setNestedInParens(boolean nestedInParens)
nestedInParens
- Whether or not this node is nested in parens.ResultSetNode bindNonVTITables(DataDictionary dataDictionary, FromList fromListParam) throws StandardException
bindNonVTITables
in class ResultSetNode
dataDictionary
- The DataDictionary to use for bindingfromListParam
- FromList to use/append to.StandardException
- Thrown on errorResultSetNode bindVTITables(FromList fromListParam) throws StandardException
bindVTITables
in class ResultSetNode
fromListParam
- FromList to use/append to.StandardException
- Thrown on errorvoid bindExpressions(FromList fromListParam) throws StandardException
bindExpressions
in class ResultSetNode
fromListParam
- FromList to use/append to.StandardException
- Thrown on errorvoid rejectParameters() throws StandardException
rejectParameters
in class ResultSetNode
StandardException
- Thrown if a ? parameter found
directly under a ResultColumnvoid bindExpressionsWithTables(FromList fromListParam) throws StandardException
bindExpressionsWithTables
in class ResultSetNode
fromListParam
- FromList to use/append to.StandardException
- Thrown on errorvoid bindResultColumns(FromList fromListParam) throws StandardException
bindResultColumns
in class ResultSetNode
fromListParam
- FromList to use/append to.StandardException
- Thrown on errorvoid bindResultColumns(TableDescriptor targetTableDescriptor, FromVTI targetVTI, ResultColumnList targetColumnList, DMLStatementNode statement, FromList fromListParam) throws StandardException
bindResultColumns
in class ResultSetNode
targetTableDescriptor
- The TableDescriptor for the table being
updated or inserted intotargetColumnList
- For INSERT statements, the user
does not have to supply column
names (for example, "insert into t
values (1,2,3)". When this
parameter is null, it means that
the user did not supply column
names, and so the binding should
be done based on order. When it
is not null, it means do the binding
by name, not position.statement
- Calling DMLStatementNode (Insert or Update)fromListParam
- FromList to use/append to.StandardException
- Thrown on errorFromTable getFromTableByName(java.lang.String name, java.lang.String schemaName, boolean exactMatch) throws StandardException
getFromTableByName
in class FromTable
name
- The specified name to search for as an exposed name.schemaName
- Schema name, if non-null.exactMatch
- Whether or not we need an exact match on specified schema and table
names or match on table id.StandardException
- Thrown on errorResultSetNode preprocess(int numTables, GroupByList gbl, FromList fromList) throws StandardException
preprocess
in class ResultSetNode
numTables
- Number of tables in the DML Statementgbl
- The group by list, if anyfromList
- The from list, if anyStandardException
- Thrown on errorvoid projectResultColumns() throws StandardException
projectResultColumns
in class ResultSetNode
StandardException
void setReferencedColumns()
ResultSetNode optimize(DataDictionary dataDictionary, PredicateList predicateList, double outerRows) throws StandardException
optimize
in class ResultSetNode
dataDictionary
- The DataDictionary to use for optimizationpredicateList
- The PredicateList to apply.outerRows
- The number of outer joining rowsStandardException
- Thrown on errorResultSetNode modifyAccessPaths() throws StandardException
ResultSetNode
modifyAccessPaths
in class ResultSetNode
StandardException
- Thrown on errorResultSetNode.modifyAccessPaths()
boolean referencesTarget(java.lang.String name, boolean baseTable) throws StandardException
referencesTarget
in class ResultSetNode
name
- Table name (String) to search for.baseTable
- Whether or not name is for a base tableStandardException
- Thrown on errorpublic boolean referencesSessionSchema() throws StandardException
referencesSessionSchema
in class QueryTreeNode
StandardException
- Thrown on errorprotected ResultSetNode optimizeSource(Optimizer optimizer, ResultSetNode sourceResultSet, PredicateList predList, CostEstimate outerCost) throws StandardException
StandardException
- Thrown on errorvoid decrementLevel(int decrement)
decrementLevel
in class FromTable
decrement
- The amount to decrement by.void adjustForSortElimination()
ResultSetNode
adjustForSortElimination
in class ResultSetNode
ResultSetNode.adjustForSortElimination()
void adjustForSortElimination(RequiredRowOrdering rowOrdering) throws StandardException
ResultSetNode
adjustForSortElimination
in class ResultSetNode
StandardException
ResultSetNode.adjustForSortElimination()
void acceptChildren(Visitor v) throws StandardException
acceptChildren
in class FromTable
v
- the visitorStandardException
- on errorboolean needsSpecialRCLBinding()
needsSpecialRCLBinding
in class FromTable
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.