abstract class TableOperatorNode extends FromTable
| Modifier and Type | Field and 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, userSpecifiedJoinStrategycostEstimate, cursorTargetTable, finalCostEstimate, insertSource, optimizer, referencedTableMap, resultColumns, resultSetNumber, scratchCostEstimate, statementResultSetAUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX| Constructor and Description |
|---|
TableOperatorNode() |
| Modifier and Type | Method and 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.
|
void |
bindExpressions(FromList fromListParam)
Bind the expressions under this TableOperatorNode.
|
void |
bindExpressionsWithTables(FromList fromListParam)
Bind the expressions in this ResultSetNode if it has tables.
|
ResultSetNode |
bindNonVTITables(DataDictionary dataDictionary,
FromList fromListParam)
Bind the non VTI tables in this TableOperatorNode.
|
void |
bindResultColumns(FromList fromListParam)
Bind the result columns of this ResultSetNode when there is no
base table to bind them to.
|
void |
bindResultColumns(TableDescriptor targetTableDescriptor,
FromVTI targetVTI,
ResultColumnList targetColumnList,
DMLStatementNode statement,
FromList fromListParam)
Bind the result columns for this ResultSetNode to a base table.
|
void |
bindUntypedNullsToResultColumns(ResultColumnList rcl)
DERBY-4365
Bind untyped nulls to the types in the given ResultColumnList.
|
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.
|
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.
|
protected 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.
|
ResultSetNode |
getLeftmostResultSet() |
ResultSetNode |
getLeftResultSet()
Get the leftResultSet from this node.
|
ResultSetNode |
getRightResultSet()
Get the rightResultSet from this node.
|
void |
init(java.lang.Object leftResultSet,
java.lang.Object rightResultSet,
java.lang.Object tableProperties)
Initializer for a TableOperatorNode.
|
Optimizable |
modifyAccessPath(JBitSet outerTables)
Modify the access path for this Optimizable, as necessary.
|
ResultSetNode |
modifyAccessPaths()
Modify the access paths according to the decisions the optimizer
made.
|
boolean |
needsSpecialRCLBinding()
apparently something special needs to be done for me....
|
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.
|
ResultSetNode |
preprocess(int numTables,
GroupByList gbl,
FromList fromList)
Put a ProjectRestrictNode on top of each FromTable in the FromList.
|
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)
|
boolean |
referencesTarget(java.lang.String name,
boolean baseTable)
Search to see if a query references the specifed table name.
|
void |
rejectParameters()
Check for (and reject) ?
|
void |
setLeftmostResultSet(ResultSetNode newLeftResultSet) |
void |
setLevel(int level)
Set the (query block) level (0-based) for this FromTable.
|
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, considerSortAvoidancePath, convertAbsoluteToRelativeColumnPosition, cursorTargetTable, estimateCost, feasibleJoinStrategy, fillInReferencedTableMap, flatten, forUpdate, getBaseTableName, getBestAccessPath, getBestSortAvoidancePath, getCorrelationName, getCostEstimate, getCurrentAccessPath, getFinalCostEstimate, getLevel, getName, getNumColumnsReturned, getOrigTableName, getProperties, getResultColumnsForList, getSchemaDescriptor, getSchemaDescriptor, getScratchCostEstimate, getTableDescriptor, getTableName, getTableNumber, getTrulyTheBestAccessPath, getUserSpecifiedJoinStrategy, hashKeyColumns, hasLargeObjectColumns, hasTableNumber, init, 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, setCostEstimate, setHashKeyColumns, setOrigTableName, setProperties, setTableNumber, startOptimizing, supportsMultipleInstantiations, tellRowOrderingAboutConstantColumns, transformOuterJoins, uniqueJoinaddNewPredicate, assignResultSetNumber, bindTargetExpressions, changeAccessPath, columnTypesAndLengthsMatch, considerMaterialization, enhanceRCLForInsert, ensurePredicateList, flattenableInFromSubquery, generateNormalizationResultSet, generateResultSet, genProjectRestrict, genProjectRestrict, genProjectRestrictForReordering, getAllResultColumns, getCostEstimate, getCursorTargetTable, getFromList, getMatchingColumn, getNewCostEstimate, getOptimizer, getOptimizerImpl, getRCLForInsert, getReferencedTableMap, getResultColumns, getResultSetNumber, isNotExists, isOneRowResultSet, isOrderedOn, isPossibleDistinctScan, isUpdatableCursor, LOJgetReferencedTables, makeResultDescription, makeResultDescriptors, markAsCursorTargetTable, markForDistinctScan, markStatementResultSet, modifyAccessPaths, notCursorTargetTable, notFlattenableJoin, numDistinctAggregates, parseDefault, performMaterialization, pushOffsetFetchFirst, pushOrderByList, rejectXMLValues, renameGeneratedResultNames, replaceOrForbidDefaults, returnsAtMostOneRow, setInsertSource, setReferencedTableMap, setResultColumns, setResultToBooleanTrueNode, setTableConstructorTypes, subqueryReferencesTarget, updateTargetLockMode, verifySelectStarSubqueryaccept, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, foundString, generate, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContextManager, getCursorInfo, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getNodeFactory, getNodeType, getNullNode, getParameterTypes, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, init, init, init, init, init, init, init, init, init, init, init, init, isAtomic, isInstanceOf, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeConstantAction, makeTableName, makeTableName, nodeHeader, orReliability, parseStatement, printLabel, resolveTableToSynonym, setBeginOffset, setContextManager, setEndOffset, setNodeType, setRefActionInfo, stackPrint, treePrint, treePrint, verifyClassExistclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDataDictionary, getReferencedTableMap, getResultSetNumberResultSetNode leftResultSet
ResultSetNode rightResultSet
Optimizer leftOptimizer
Optimizer rightOptimizer
private boolean leftModifyAccessPathsDone
private boolean rightModifyAccessPathsDone
public void init(java.lang.Object leftResultSet,
java.lang.Object rightResultSet,
java.lang.Object tableProperties)
throws StandardException
init in interface Nodeinit in class QueryTreeNodeleftResultSet - The ResultSetNode on the left side of this noderightResultSet - The ResultSetNode on the right side of this nodetableProperties - Properties list associated with the tableStandardException - Thrown on errorpublic void bindUntypedNullsToResultColumns(ResultColumnList rcl) throws StandardException
bindUntypedNullsToResultColumns in class ResultSetNodercl - The ResultColumnList with the types to bind nulls toStandardException - Thrown on errorpublic Optimizable modifyAccessPath(JBitSet outerTables) throws StandardException
OptimizablemodifyAccessPath in interface OptimizablemodifyAccessPath in class FromTableouterTables - 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
OptimizableverifyProperties in interface OptimizableverifyProperties in class FromTabledDictionary - 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
OptimizableupdateBestPlanMap in interface OptimizableupdateBestPlanMap in class FromTableaction - 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.StandardExceptionMakes 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()
public void printSubNodes(int depth)
printSubNodes in class ResultSetNodedepth - The depth of this node in the treepublic ResultSetNode getLeftResultSet()
public ResultSetNode getRightResultSet()
public ResultSetNode getLeftmostResultSet()
public void setLeftmostResultSet(ResultSetNode newLeftResultSet)
public void setLevel(int level)
public java.lang.String getExposedName()
getExposedName in class FromTablepublic void setNestedInParens(boolean nestedInParens)
nestedInParens - Whether or not this node is nested in parens.public ResultSetNode bindNonVTITables(DataDictionary dataDictionary, FromList fromListParam) throws StandardException
bindNonVTITables in class ResultSetNodedataDictionary - The DataDictionary to use for bindingfromListParam - FromList to use/append to.StandardException - Thrown on errorpublic ResultSetNode bindVTITables(FromList fromListParam) throws StandardException
bindVTITables in class ResultSetNodefromListParam - FromList to use/append to.StandardException - Thrown on errorpublic void bindExpressions(FromList fromListParam) throws StandardException
bindExpressions in class ResultSetNodefromListParam - FromList to use/append to.StandardException - Thrown on errorpublic void rejectParameters()
throws StandardException
rejectParameters in class ResultSetNodeStandardException - Thrown if a ? parameter found
directly under a ResultColumnpublic void bindExpressionsWithTables(FromList fromListParam) throws StandardException
bindExpressionsWithTables in class ResultSetNodefromListParam - FromList to use/append to.StandardException - Thrown on errorpublic void bindResultColumns(FromList fromListParam) throws StandardException
bindResultColumns in class ResultSetNodefromListParam - FromList to use/append to.StandardException - Thrown on errorpublic void bindResultColumns(TableDescriptor targetTableDescriptor, FromVTI targetVTI, ResultColumnList targetColumnList, DMLStatementNode statement, FromList fromListParam) throws StandardException
bindResultColumns in class ResultSetNodetargetTableDescriptor - 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 errorprotected FromTable getFromTableByName(java.lang.String name, java.lang.String schemaName, boolean exactMatch) throws StandardException
getFromTableByName in class FromTablename - 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 errorpublic ResultSetNode preprocess(int numTables, GroupByList gbl, FromList fromList) throws StandardException
preprocess in class ResultSetNodenumTables - 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 ResultSetNodeStandardExceptionvoid setReferencedColumns()
public ResultSetNode optimize(DataDictionary dataDictionary, PredicateList predicateList, double outerRows) throws StandardException
optimize in class ResultSetNodedataDictionary - The DataDictionary to use for optimizationpredicateList - The PredicateList to apply.outerRows - The number of outer joining rowsStandardException - Thrown on errorpublic ResultSetNode modifyAccessPaths() throws StandardException
ResultSetNodemodifyAccessPaths in class ResultSetNodeStandardException - Thrown on errorResultSetNode.modifyAccessPaths()public boolean referencesTarget(java.lang.String name,
boolean baseTable)
throws StandardException
referencesTarget in class ResultSetNodename - 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 QueryTreeNodeStandardException - 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 FromTabledecrement - The amount to decrement by.void adjustForSortElimination()
ResultSetNodeadjustForSortElimination in class ResultSetNodeResultSetNode.adjustForSortElimination()void adjustForSortElimination(RequiredRowOrdering rowOrdering) throws StandardException
ResultSetNodeadjustForSortElimination in class ResultSetNodeStandardExceptionResultSetNode.adjustForSortElimination()void acceptChildren(Visitor v) throws StandardException
acceptChildren in class ResultSetNodev - the visitorStandardException - on errorpublic boolean needsSpecialRCLBinding()
needsSpecialRCLBinding in class FromTableApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.