public class RowResultSetNode extends FromTable
| Modifier and Type | Field and Description |
|---|---|
private java.util.List |
aggregateVector |
(package private) ValueNode |
fetchFirst |
(package private) boolean |
hasJDBClimitClause |
(package private) ValueNode |
offset |
(package private) OrderByList |
orderByList |
(package private) SubqueryList |
subquerys |
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 |
|---|
RowResultSetNode() |
| Modifier and Type | Method and Description |
|---|---|
ResultSetNode |
addNewPredicate(Predicate predicate)
Add a new predicate to the list.
|
(package private) void |
adjustForSortElimination()
Notify the underlying result set tree that the optimizer has chosen
to "eliminate" a sort.
|
void |
bindExpressions(FromList fromListParam)
Bind the expressions in this RowResultSetNode.
|
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 ResultSetNode.
|
void |
bindTargetExpressions(FromList fromListParam)
Bind the expressions in the target list.
|
void |
bindUntypedNullsToResultColumns(ResultColumnList bindingRCL)
Bind any untyped null nodes to the types in the given ResultColumnList.
|
private boolean |
canWeCacheResults() |
(package private) ResultSetNode |
enhanceRCLForInsert(InsertNode target,
boolean inOrder,
int[] colMap)
Modify the RCL of this node to match the target of the insert.
|
ResultSetNode |
ensurePredicateList(int numTables)
Ensure that the top of the RSN tree has a PredicateList.
|
CostEstimate |
estimateCost(OptimizablePredicateList predList,
ConglomerateDescriptor cd,
CostEstimate outerCost,
Optimizer optimizer,
RowOrdering rowOrdering)
Estimate the cost of scanning this Optimizable using the given
predicate list with the given conglomerate.
|
boolean |
flattenableInFromSubquery(FromList fromList)
Evaluate whether or not the subquery in a FromSubquery is flattenable.
|
void |
generate(ActivationClassBuilder acb,
MethodBuilder mb)
The generated ResultSet will be:
RowResultSet -- for the VALUES clause
|
java.lang.String |
getExposedName()
Get the exposed name for this table, which is the name that can
be used to refer to it in the rest of the query.
|
ResultColumn |
getMatchingColumn(ColumnReference columnReference)
Try to find a ResultColumn in the table represented by this FromTable
that matches the name in the given ColumnReference.
|
void |
init(java.lang.Object valuesClause,
java.lang.Object tableProperties)
Initializer for a RowResultSetNode.
|
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.
|
ResultSetNode |
optimize(DataDictionary dataDictionary,
PredicateList predicateList,
double outerRows)
Optimize this SelectNode.
|
(package private) void |
optimizeSubqueries(DataDictionary dd,
double rowCount)
Optimize any subqueries that haven't been optimized any where
else.
|
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 |
pushOffsetFetchFirst(ValueNode offset,
ValueNode fetchFirst,
boolean hasJDBClimitClause)
Push down the offset and fetch first parameters, if any, to this node.
|
(package private) void |
pushOrderByList(OrderByList orderByList)
Push the order by list down from the cursor node
into its child result set so that the optimizer
has all of the information that it needs to
consider sort avoidance.
|
boolean |
referencesSessionSchema()
Return true if the node references SESSION schema tables (temporary or permanent)
|
(package private) void |
replaceOrForbidDefaults(TableDescriptor ttd,
ResultColumnList tcl,
boolean allowDefaults)
Replace any DEFAULTs with the associated tree for the default if
allowed, or flag (when inside top level set operator nodes).
|
(package private) boolean |
returnsAtMostOneRow()
Return whether or not this ResultSet tree is guaranteed to return
at most 1 row based on heuristics.
|
(package private) void |
setTableConstructorTypes(ResultColumnList typeColumns)
Set the type of each parameter in the result column list for this table constructor.
|
java.lang.String |
statementToString() |
java.lang.String |
toString()
Convert this object to a String.
|
void |
verifySelectStarSubquery(FromList outerFromList,
int subqueryType)
Verify that a SELECT * is valid for this type of subquery.
|
assignCostEstimate, canBeOrdered, considerSortAvoidancePath, convertAbsoluteToRelativeColumnPosition, cursorTargetTable, decrementLevel, feasibleJoinStrategy, fillInReferencedTableMap, flatten, forUpdate, getBaseTableName, getBestAccessPath, getBestSortAvoidancePath, getCorrelationName, getCostEstimate, getCurrentAccessPath, getFinalCostEstimate, getFromTableByName, getLevel, 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, needsSpecialRCLBinding, nextAccessPath, optimizeIt, pullOptPredicates, pushExpressions, pushOptPredicate, rememberAsBest, rememberJoinStrategyAsBest, rememberSortAvoidancePath, resetJoinStrategies, setCostEstimate, setHashKeyColumns, setLevel, setOrigTableName, setProperties, setTableNumber, startOptimizing, supportsMultipleInstantiations, tellRowOrderingAboutConstantColumns, transformOuterJoins, uniqueJoin, updateBestPlanMap, verifyPropertiesacceptChildren, adjustForSortElimination, assignResultSetNumber, bindResultColumns, bindResultColumns, bindVTITables, changeAccessPath, columnTypesAndLengthsMatch, considerMaterialization, generateNormalizationResultSet, generateResultSet, genProjectRestrict, genProjectRestrict, genProjectRestrictForReordering, getAllResultColumns, getCostEstimate, getCursorTargetTable, getFromList, getNewCostEstimate, getOptimizer, getOptimizerImpl, getRCLForInsert, getReferencedTableMap, getResultColumns, getResultSetNumber, isNotExists, isOneRowResultSet, isOrderedOn, isPossibleDistinctScan, isUpdatableCursor, LOJgetReferencedTables, makeResultDescription, makeResultDescriptors, markAsCursorTargetTable, markForDistinctScan, markStatementResultSet, modifyAccessPaths, notCursorTargetTable, notFlattenableJoin, numDistinctAggregates, parseDefault, performMaterialization, projectResultColumns, referencesTarget, rejectParameters, rejectXMLValues, renameGeneratedResultNames, setInsertSource, setReferencedTableMap, setResultColumns, setResultToBooleanTrueNode, subqueryReferencesTarget, updateTargetLockModeaccept, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, foundString, 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, 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, getResultSetNumberSubqueryList subquerys
private java.util.List aggregateVector
OrderByList orderByList
ValueNode offset
ValueNode fetchFirst
boolean hasJDBClimitClause
public void init(java.lang.Object valuesClause,
java.lang.Object tableProperties)
public java.lang.String toString()
public java.lang.String statementToString()
public void printSubNodes(int depth)
printSubNodes in class ResultSetNodedepth - The depth of this node in the treepublic boolean referencesSessionSchema()
throws StandardException
QueryTreeNodereferencesSessionSchema in class QueryTreeNodeStandardException - Thrown on errorResultSetNode enhanceRCLForInsert(InsertNode target, boolean inOrder, int[] colMap) throws StandardException
enhanceRCLForInsert in class ResultSetNodetarget - 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 estimateCost(OptimizablePredicateList predList, ConglomerateDescriptor cd, CostEstimate outerCost, Optimizer optimizer, RowOrdering rowOrdering) throws StandardException
OptimizableestimateCost in interface OptimizableestimateCost in class FromTablepredList - The predicate list to optimize againstcd - The conglomerate descriptor to get the cost ofouterCost - The estimated cost of the part of the plan outer
to this optimizable.optimizer - The optimizer to use to help estimate the costrowOrdering - The row ordering for all the tables in the
join order, including this one.StandardException - Thrown on errorOptimizable.estimateCost(org.apache.derby.iapi.sql.compile.OptimizablePredicateList, org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor, org.apache.derby.iapi.sql.compile.CostEstimate, org.apache.derby.iapi.sql.compile.Optimizer, org.apache.derby.iapi.sql.compile.RowOrdering)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 void bindExpressions(FromList fromListParam) throws StandardException
bindExpressions in class ResultSetNodefromListParam - FromList to use/append to.StandardException - Thrown on errorpublic void bindExpressionsWithTables(FromList fromListParam) throws StandardException
bindExpressionsWithTables in class ResultSetNodefromListParam - FromList to use/append to.StandardException - Thrown on errorpublic void bindTargetExpressions(FromList fromListParam) throws StandardException
bindTargetExpressions in class ResultSetNodeStandardException - Thrown on errorpublic void bindUntypedNullsToResultColumns(ResultColumnList bindingRCL) throws StandardException
bindUntypedNullsToResultColumns in class ResultSetNodebindingRCL - The ResultColumnList with the types to bind to.StandardException - Thrown on errorpublic ResultColumn getMatchingColumn(ColumnReference columnReference) throws StandardException
getMatchingColumn in class ResultSetNodecolumnReference - The columnReference whose name we're looking
for in the given table.StandardException - Thrown on errorpublic java.lang.String getExposedName()
throws StandardException
getExposedName in class FromTableStandardException - Thrown on errorpublic void verifySelectStarSubquery(FromList outerFromList, int subqueryType) throws StandardException
verifySelectStarSubquery in class ResultSetNodeouterFromList - The FromList from the outer query block(s)subqueryType - The subquery typeStandardException - Thrown on errorvoid pushOrderByList(OrderByList orderByList)
pushOrderByList in class ResultSetNodeorderByList - The order by listvoid pushOffsetFetchFirst(ValueNode offset, ValueNode fetchFirst, boolean hasJDBClimitClause)
pushOffsetFetchFirst in class ResultSetNodeoffset - the OFFSET, if anyfetchFirst - the OFFSET FIRST, if anyhasJDBClimitClause - true if the clauses were added by (and have the semantics of) a JDBC limit clausepublic 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 errorpublic ResultSetNode ensurePredicateList(int numTables) throws StandardException
ensurePredicateList in class ResultSetNodenumTables - The number of tables in the query.StandardException - Thrown on errorpublic ResultSetNode addNewPredicate(Predicate predicate) throws StandardException
addNewPredicate in class ResultSetNodepredicate - The predicate to addStandardException - Thrown on errorpublic boolean flattenableInFromSubquery(FromList fromList)
flattenableInFromSubquery in class ResultSetNodefromList - The outer from listpublic ResultSetNode optimize(DataDictionary dataDictionary, PredicateList predicateList, double outerRows) throws StandardException
optimize in class ResultSetNodedataDictionary - The DataDictionary to use for optimizationpredicateList - The predicate list to optimize againstouterRows - The number of outer joining rowsStandardException - 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 ResultSetNode modifyAccessPaths() throws StandardException
ResultSetNodemodifyAccessPaths in class ResultSetNodeStandardException - Thrown on errorResultSetNode.modifyAccessPaths()boolean returnsAtMostOneRow()
returnsAtMostOneRow in class ResultSetNodevoid setTableConstructorTypes(ResultColumnList typeColumns) throws StandardException
setTableConstructorTypes in class ResultSetNodetypeColumns - The ResultColumnList containing the desired result
types.StandardException - Thrown on errorpublic void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException
generate in class QueryTreeNodeacb - The ActivationClassBuilder for the class being builtmb - The method for the generated code to go intoStandardException - Thrown on errorvoid replaceOrForbidDefaults(TableDescriptor ttd, ResultColumnList tcl, boolean allowDefaults) throws StandardException
replaceOrForbidDefaults in class ResultSetNodettd - The TableDescriptor for the target table.tcl - The RCL for the target table.allowDefaults - true if allowedStandardException - Thrown on errorvoid optimizeSubqueries(DataDictionary dd, double rowCount) throws StandardException
optimizeSubqueries in class FromTableStandardException - Thrown on errorvoid adjustForSortElimination()
ResultSetNodeadjustForSortElimination in class ResultSetNodeResultSetNode.adjustForSortElimination()private boolean canWeCacheResults()
throws StandardException
StandardExceptionApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.