public class DistinctNode extends SingleChildResultSetNode
| Modifier and Type | Field and Description |
|---|---|
(package private) boolean |
inSortedOrder |
childResult, hasTrulyTheBestAccessPathADD_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 |
|---|
DistinctNode() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
generate(ActivationClassBuilder acb,
MethodBuilder mb)
generate the distinct result set operating over the source
resultset.
|
void |
init(java.lang.Object childResult,
java.lang.Object inSortedOrder,
java.lang.Object tableProperties)
Initializer for a DistinctNode.
|
(package private) boolean |
isOrderedOn(ColumnReference[] crs,
boolean permuteOrdering,
java.util.List fbtVector)
Return whether or not the underlying ResultSet tree
is ordered on the specified columns.
|
ResultSetNode |
optimize(DataDictionary dataDictionary,
PredicateList predicates,
double outerRows)
Optimize this DistinctNode.
|
CostEstimate |
optimizeIt(Optimizer optimizer,
OptimizablePredicateList predList,
CostEstimate outerCost,
RowOrdering rowOrdering)
Choose the best access path for this Optimizable.
|
boolean |
pushOptPredicate(OptimizablePredicate optimizablePredicate)
Push an OptimizablePredicate down, if this node accepts it.
|
acceptChildren, addNewPredicate, adjustForSortElimination, adjustForSortElimination, changeAccessPath, decrementLevel, ensurePredicateList, flattenableInFromSubquery, forUpdate, getChildResult, getFinalCostEstimate, getFromTableByName, getTrulyTheBestAccessPath, init, initAccessPaths, isNotExists, isOneRowResultSet, modifyAccessPaths, preprocess, printSubNodes, pullOptPredicates, pushExpressions, referencesSessionSchema, referencesTarget, reflectionNeededForProjection, setChildResult, setLevel, subqueryReferencesTarget, updateBestPlanMap, updateTargetLockModeassignCostEstimate, canBeOrdered, considerSortAvoidancePath, convertAbsoluteToRelativeColumnPosition, cursorTargetTable, feasibleJoinStrategy, fillInReferencedTableMap, flatten, getBaseTableName, getBestAccessPath, getBestSortAvoidancePath, getCorrelationName, getCostEstimate, getCurrentAccessPath, getExposedName, getLevel, 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, optimizeSubqueries, rememberAsBest, rememberJoinStrategyAsBest, rememberSortAvoidancePath, resetJoinStrategies, setCostEstimate, setHashKeyColumns, setOrigTableName, setProperties, setTableNumber, startOptimizing, supportsMultipleInstantiations, tellRowOrderingAboutConstantColumns, toString, transformOuterJoins, uniqueJoin, verifyPropertiesassignResultSetNumber, bindExpressions, bindExpressionsWithTables, bindNonVTITables, bindResultColumns, bindResultColumns, bindTargetExpressions, bindUntypedNullsToResultColumns, bindVTITables, columnTypesAndLengthsMatch, considerMaterialization, enhanceRCLForInsert, generateNormalizationResultSet, generateResultSet, genProjectRestrict, genProjectRestrict, genProjectRestrictForReordering, getAllResultColumns, getCostEstimate, getCursorTargetTable, getFromList, getMatchingColumn, getNewCostEstimate, getOptimizer, getOptimizerImpl, getRCLForInsert, getReferencedTableMap, getResultColumns, getResultSetNumber, isPossibleDistinctScan, isUpdatableCursor, LOJgetReferencedTables, makeResultDescription, makeResultDescriptors, markAsCursorTargetTable, markForDistinctScan, markStatementResultSet, modifyAccessPaths, notCursorTargetTable, notFlattenableJoin, numDistinctAggregates, parseDefault, performMaterialization, projectResultColumns, pushOffsetFetchFirst, pushOrderByList, rejectParameters, rejectXMLValues, renameGeneratedResultNames, replaceOrForbidDefaults, returnsAtMostOneRow, setInsertSource, setReferencedTableMap, setResultColumns, setResultToBooleanTrueNode, setTableConstructorTypes, verifySelectStarSubqueryaccept, 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, 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, getResultSetNumberpublic void init(java.lang.Object childResult,
java.lang.Object inSortedOrder,
java.lang.Object tableProperties)
throws StandardException
init in interface Nodeinit in class QueryTreeNodechildResult - The child ResultSetNodeinSortedOrder - Whether or not the child ResultSetNode returns its
output in sorted order.tableProperties - Properties list associated with the tableStandardException - Thrown on errorpublic CostEstimate optimizeIt(Optimizer optimizer, OptimizablePredicateList predList, CostEstimate outerCost, RowOrdering rowOrdering) throws StandardException
OptimizableoptimizeIt in interface OptimizableoptimizeIt in class FromTableoptimizer - 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)public 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 boolean pushOptPredicate(OptimizablePredicate optimizablePredicate) throws StandardException
OptimizablepushOptPredicate in interface OptimizablepushOptPredicate in class FromTableoptimizablePredicate - OptimizablePredicate to push down.StandardException - Thrown on errorOptimizable.pushOptPredicate(org.apache.derby.iapi.sql.compile.OptimizablePredicate)public ResultSetNode optimize(DataDictionary dataDictionary, PredicateList predicates, double outerRows) throws StandardException
optimize in class SingleChildResultSetNodedataDictionary - The DataDictionary to use for optimizationpredicates - The PredicateList to optimize. This should
be a join predicate.outerRows - The number of outer joining rowsStandardException - Thrown on errorboolean isOrderedOn(ColumnReference[] crs, boolean permuteOrdering, java.util.List fbtVector)
isOrderedOn in class SingleChildResultSetNodecrs - The specified ColumnReference[]permuteOrdering - Whether or not the order of the CRs in the array can be permutedfbtVector - Vector that is to be filled with the FromBaseTablepublic 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 errorApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.