|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.ResultSetNode
org.apache.derby.impl.sql.compile.FromTable
org.apache.derby.impl.sql.compile.SingleChildResultSetNode
org.apache.derby.impl.sql.compile.DistinctNode
public class DistinctNode
A DistinctNode represents a result set for a disinct operation on a select. It has the same description as its input result set. For the most part, it simply delegates operations to its childResultSet, which is currently expected to be a ProjectRestrictResultSet generated for a SelectNode. NOTE: A DistinctNode extends FromTable since it can exist in a FromList.
| Field Summary | |
|---|---|
(package private) boolean |
inSortedOrder
|
| Fields inherited from class org.apache.derby.impl.sql.compile.SingleChildResultSetNode |
|---|
childResult, hasTrulyTheBestAccessPath |
| Fields inherited from class org.apache.derby.impl.sql.compile.FromTable |
|---|
ADD_PLAN, bestAccessPath, bestCostEstimate, bestSortAvoidancePath, correlationName, corrTableName, currentAccessPath, hashKeyColumns, initialCapacity, level, LOAD_PLAN, loadFactor, maxCapacity, origTableName, REMOVE_PLAN, tableNumber, tableProperties, trulyTheBestAccessPath, userSpecifiedJoinStrategy |
| Fields inherited from class org.apache.derby.impl.sql.compile.ResultSetNode |
|---|
costEstimate, cursorTargetTable, finalCostEstimate, insertSource, optimizer, referencedTableMap, resultColumns, resultSetNumber, scratchCostEstimate, statementResultSet |
| Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode |
|---|
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, isPrivilegeCollectionRequired |
| Constructor Summary | |
|---|---|
DistinctNode()
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.derby.iapi.sql.compile.Optimizable |
|---|
getDataDictionary, getReferencedTableMap, getResultSetNumber |
| Field Detail |
|---|
boolean inSortedOrder
| Constructor Detail |
|---|
public DistinctNode()
| Method Detail |
|---|
public 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 table
StandardException - Thrown on error
public CostEstimate optimizeIt(Optimizer optimizer,
OptimizablePredicateList predList,
CostEstimate outerCost,
RowOrdering rowOrdering)
throws StandardException
Optimizable
optimizeIt 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
Optimizable
estimateCost 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
Optimizable
pushOptPredicate 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 rows
StandardException - Thrown on error
boolean 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 FromBaseTable
public 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 into
StandardException - Thrown on error
|
Built on Wed 2013-06-12 15:21:56+0000, from revision ??? | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||