|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.derby.impl.sql.compile.RowOrderingImpl
class RowOrderingImpl
| Field Summary | |
|---|---|
private java.util.ArrayList |
alwaysOrderedOptimizables
|
(package private) ColumnOrdering |
columnsAlwaysOrdered
|
(package private) ColumnOrdering |
currentColumnOrdering
|
private java.util.ArrayList |
ordering
|
private java.util.ArrayList |
unorderedOptimizables
|
| Fields inherited from interface org.apache.derby.iapi.sql.compile.RowOrdering |
|---|
ASCENDING, DESCENDING, DONTCARE |
| Constructor Summary | |
|---|---|
RowOrderingImpl()
|
|
| Method Summary | |
|---|---|
void |
addOrderedColumn(int direction,
int tableNumber,
int columnNumber)
Add a column to this RowOrdering in the current order position. |
void |
addUnorderedOptimizable(Optimizable optimizable)
Add an unordered optimizable to this RowOrdering. |
boolean |
alwaysOrdered(int tableNumber)
Ask whether the given table is always ordered. |
void |
columnAlwaysOrdered(Optimizable optimizable,
int columnNumber)
Tell this RowOrdering that it is always ordered on the given column of the given optimizable. |
void |
copy(RowOrdering copyTo)
Copy the contents of this RowOrdering to the given RowOrdering. |
boolean |
isColumnAlwaysOrdered(int tableNumber,
int columnNumber)
Return true if the column is always ordered. |
void |
nextOrderPosition(int direction)
Move to the next order position for adding ordered columns. |
void |
optimizableAlwaysOrdered(Optimizable optimizable)
Tell this RowOrdering that it is always ordered on the given optimizable This is useful when considering a unique index where there is an equality match on the entire key - in this case, all the columns are ordered, regardless of the direction or position, or even whether the columns are in the index. |
boolean |
orderedOnColumn(int direction,
int tableNumber,
int columnNumber)
Tell whether this ordering is ordered on the given column. |
boolean |
orderedOnColumn(int direction,
int orderPosition,
int tableNumber,
int columnNumber)
Tell whether this ordering is ordered on the given column in the given position |
private void |
rememberCurrentColumnOrdering(int posn)
|
void |
removeOptimizable(int tableNumber)
Tell this row ordering that it is no longer ordered on the given table. |
private void |
removeOptimizableFromVector(int tableNumber,
java.util.ArrayList vec)
Remove all optimizables with the given table number from the given vector of optimizables. |
java.lang.String |
toString()
|
private boolean |
unorderedOptimizablesOtherThan(Optimizable optimizable)
Returns true if there are unordered optimizables in the join order other than the given one. |
private boolean |
vectorContainsOptimizable(int tableNumber,
java.util.ArrayList vec)
Return true if the given vector of Optimizables contains an Optimizable with the given table number. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final java.util.ArrayList ordering
ColumnOrdering columnsAlwaysOrdered
private final java.util.ArrayList alwaysOrderedOptimizables
ColumnOrdering currentColumnOrdering
private final java.util.ArrayList unorderedOptimizables
| Constructor Detail |
|---|
RowOrderingImpl()
| Method Detail |
|---|
public boolean isColumnAlwaysOrdered(int tableNumber,
int columnNumber)
RowOrdering
isColumnAlwaysOrdered in interface RowOrderingtableNumber - The table in questioncolumnNumber - The number of the column in question.
RowOrdering.isColumnAlwaysOrdered(int, int)
public boolean orderedOnColumn(int direction,
int orderPosition,
int tableNumber,
int columnNumber)
throws StandardException
RowOrdering
orderedOnColumn in interface RowOrderingdirection - One of ASCENDING, DESCENDING, or DONTCARE
depending on the requirements of the caller.
An ORDER BY clause cares about direction,
while DISTINCT and GROUP BY do not.orderPosition - The position in the ordering list. For example,
for ORDER BY A, B, position 0 has column A,
and position 1 has column B. Note that for an
ordering, more than one column can be in a single
ordering position: for example, in the query
SELECT * FROM S, T WHERE S.A = T.B ORDER BY T.B
columns S.A and T.B will be in the same ordering
positions because they are equal. Also, constant
values are considered ordered in all positions
(consider SELECT A FROM T WHERE A = 1 ORDER BY A).tableNumber - The table number of the Optimizable containing
the column in questioncolumnNumber - The column number in the table (one-based).
StandardException - Thrown on errorRowOrdering.orderedOnColumn(int, int, int, int)
public boolean orderedOnColumn(int direction,
int tableNumber,
int columnNumber)
throws StandardException
RowOrdering
orderedOnColumn in interface RowOrderingdirection - One of ASCENDING, DESCENDING, or DONTCARE
depending on the requirements of the caller.
An ORDER BY clause cares about direction,
while DISTINCT and GROUP BY do not.tableNumber - The table number of the Optimizable containing
the column in questioncolumnNumber - The column number in the table (one-based).
StandardException - Thrown on errorRowOrdering.orderedOnColumn(int, int, int, int)
private boolean vectorContainsOptimizable(int tableNumber,
java.util.ArrayList vec)
public void addOrderedColumn(int direction,
int tableNumber,
int columnNumber)
RowOrdering
addOrderedColumn in interface RowOrderingdirection - One of ASCENDING, DESCENDING, or DONTCARE.
DONTCARE can be used for things like columns
with constant value, and for one-row tables.tableNumber - The table the column is in.columnNumber - The column number in the table (one-based)RowOrdering.addOrderedColumn(int, int, int)public void nextOrderPosition(int direction)
RowOrdering
nextOrderPosition in interface RowOrderingdirection - One of ASCENDING, DESCENDING, or DONTCARE.
DONTCARE can be used for things like columns
with constant value, and for one-row tables.RowOrdering.nextOrderPosition(int)public void optimizableAlwaysOrdered(Optimizable optimizable)
RowOrdering
optimizableAlwaysOrdered in interface RowOrderingoptimizable - The table in question
public void columnAlwaysOrdered(Optimizable optimizable,
int columnNumber)
RowOrdering
columnAlwaysOrdered in interface RowOrderingoptimizable - The table in questioncolumnNumber - The number of the column in question.RowOrdering.columnAlwaysOrdered(org.apache.derby.iapi.sql.compile.Optimizable, int)public boolean alwaysOrdered(int tableNumber)
RowOrdering
alwaysOrdered in interface RowOrderingRowOrdering.alwaysOrdered(int)public void removeOptimizable(int tableNumber)
RowOrdering
removeOptimizable in interface RowOrderingtableNumber - The number of the table to remove from
this RowOrdering.RowOrdering.removeOptimizable(int)
private void removeOptimizableFromVector(int tableNumber,
java.util.ArrayList vec)
public void addUnorderedOptimizable(Optimizable optimizable)
RowOrdering
addUnorderedOptimizable in interface RowOrderingRowOrdering.addUnorderedOptimizable(org.apache.derby.iapi.sql.compile.Optimizable)public void copy(RowOrdering copyTo)
RowOrdering
copy in interface RowOrderingRowOrdering.copy(org.apache.derby.iapi.sql.compile.RowOrdering)private void rememberCurrentColumnOrdering(int posn)
public java.lang.String toString()
toString in class java.lang.Objectprivate boolean unorderedOptimizablesOtherThan(Optimizable optimizable)
|
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 | ||||||||