|
||||||||||
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.QueryTreeNodeVector
org.apache.derby.impl.sql.compile.OrderedColumnList
org.apache.derby.impl.sql.compile.OrderByList
An OrderByList is an ordered list of columns in the ORDER BY clause. That is, the order of columns in this list is significant - the first column in the list is the most significant in the ordering, and the last column in the list is the least significant.
Field Summary | |
private boolean |
allAscending
|
private boolean |
alwaysSort
|
private ColumnOrdering[] |
columnOrdering
|
private int |
estimatedRowSize
|
private java.lang.Object[] |
resultRow
|
private ResultSetNode |
resultToSort
|
private SortCostController |
scc
|
private boolean |
sortNeeded
|
Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode |
AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, beginOffset, endOffset |
Fields inherited from interface org.apache.derby.iapi.sql.compile.RequiredRowOrdering |
ELIMINATE_DUPS, NOTHING_REQUIRED, SORT_REQUIRED |
Constructor Summary | |
OrderByList()
|
Method Summary | |
void |
addOrderByColumn(OrderByColumn column)
Add a column to the list |
(package private) boolean |
allAscending()
Are all columns in the list ascending. |
void |
bindOrderByColumns(ResultSetNode target)
Bind the update columns by their names to the target resultset of the cursor specification. |
void |
estimateCost(double estimatedInputRows,
RowOrdering rowOrdering,
CostEstimate resultCost)
Estimate the cost of doing a sort for this row ordering, given the number of rows to be sorted. |
void |
generate(ActivationClassBuilder acb,
MethodBuilder mb,
ResultSetNode child)
generate the sort result set operating over the source expression. |
OrderByColumn |
getOrderByColumn(int position)
Get a column from the list |
boolean |
getSortNeeded()
Get whether or not a sort is needed. |
(package private) boolean |
isInOrderPrefix(ResultColumnList sourceRCL)
Is this order by list an in order prefix of the specified RCL. |
void |
printSubNodes(int depth)
Print the list. |
void |
pullUpOrderByColumns(ResultSetNode target)
Pull up Order By columns by their names to the target resultset of the cursor specification. |
(package private) void |
remapColumnReferencesToExpressions()
Remap all ColumnReferences in this tree to be clones of the underlying expression. |
(package private) void |
removeConstantColumns(PredicateList whereClause)
Remove any constant columns from this order by list. |
(package private) void |
removeDupColumns()
Remove any duplicate columns from this order by list. |
(package private) ResultColumnList |
reorderRCL(ResultColumnList resultColumns)
Build a new RCL with the same RCs as the passed in RCL but in an order that matches the ordering columns. |
(package private) void |
resetToSourceRCs()
Order by columns now point to the PRN above the node of interest. |
void |
sortNeeded()
Indicate that a sort is necessary to fulfill this required ordering. |
void |
sortNotNeeded()
Indicate that a sort is *NOT* necessary to fulfill this required ordering. |
int |
sortRequired(RowOrdering rowOrdering)
Tell whether sorting is required for this RequiredRowOrdering, given a RowOrdering. |
int |
sortRequired(RowOrdering rowOrdering,
JBitSet tableMap)
Tell whether sorting is required for this RequiredRowOrdering, given a RowOrdering representing a partial join order, and a bit map telling what tables are represented in the join order. |
Methods inherited from class org.apache.derby.impl.sql.compile.OrderedColumnList |
accept, addElement, destructiveAppend, elementAt, getColumnOrdering, indexOf, insertElementAt, nondestructiveAppend, remove, removeAllElements, removeElement, removeElementAt, setElementAt, size, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private boolean allAscending
private boolean alwaysSort
private ResultSetNode resultToSort
private SortCostController scc
private java.lang.Object[] resultRow
private ColumnOrdering[] columnOrdering
private int estimatedRowSize
private boolean sortNeeded
Constructor Detail |
public OrderByList()
Method Detail |
public void addOrderByColumn(OrderByColumn column)
column
- The column to add to the listboolean allAscending()
public OrderByColumn getOrderByColumn(int position)
position
- The column to get from the listpublic void printSubNodes(int depth)
printSubNodes
in class QueryTreeNode
depth
- The depth at which to indent the sub-nodes
public void bindOrderByColumns(ResultSetNode target) throws StandardException
target
- The underlying result set
StandardException
- Thrown on errorpublic void pullUpOrderByColumns(ResultSetNode target) throws StandardException
target
- The underlying result set
StandardException
boolean isInOrderPrefix(ResultColumnList sourceRCL)
sourceRCL
- The source RCL.
void resetToSourceRCs()
ResultColumnList reorderRCL(ResultColumnList resultColumns) throws StandardException
resultColumns
- The RCL to reorder.
StandardException
- Thrown on errorvoid removeConstantColumns(PredicateList whereClause)
void removeDupColumns()
public void generate(ActivationClassBuilder acb, MethodBuilder mb, ResultSetNode child) throws StandardException
acb
- the tool for building the classmb
- the method the generated code is to go into
StandardException
- thrown on failurepublic int sortRequired(RowOrdering rowOrdering) throws StandardException
RequiredRowOrdering
sortRequired
in interface RequiredRowOrdering
rowOrdering
- The order of rows in question
StandardException
- Thrown on errorRequiredRowOrdering.sortRequired(org.apache.derby.iapi.sql.compile.RowOrdering)
public int sortRequired(RowOrdering rowOrdering, JBitSet tableMap) throws StandardException
RequiredRowOrdering
sortRequired
in interface RequiredRowOrdering
rowOrdering
- The order of rows in the partial join ordertableMap
- A bit map of the tables in the partial join order
StandardException
- Thrown on errorRequiredRowOrdering.sortRequired(org.apache.derby.iapi.sql.compile.RowOrdering)
public void estimateCost(double estimatedInputRows, RowOrdering rowOrdering, CostEstimate resultCost) throws StandardException
RequiredRowOrdering
estimateCost
in interface RequiredRowOrdering
estimatedInputRows
- The estimated number of rows to sortrowOrdering
- The ordering of the input rowsresultCost
- A place to store the resulting cost
StandardException
- Thrown on errorRequiredRowOrdering.estimateCost(double, org.apache.derby.iapi.sql.compile.RowOrdering, org.apache.derby.iapi.sql.compile.CostEstimate)
public void sortNeeded()
RequiredRowOrdering
sortNeeded
in interface RequiredRowOrdering
RequiredRowOrdering.sortNeeded()
public void sortNotNeeded()
RequiredRowOrdering
sortNotNeeded
in interface RequiredRowOrdering
RequiredRowOrdering.sortNotNeeded()
void remapColumnReferencesToExpressions() throws StandardException
StandardException
- Thrown on errorpublic boolean getSortNeeded()
getSortNeeded
in interface RequiredRowOrdering
|
Built on Mon 2007-06-04 09:58:47+0400, from revision ??? | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |