|
||||||||||
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
Field Summary | |
(package private) java.util.Vector |
alwaysOrderedOptimizables
|
(package private) ColumnOrdering |
columnsAlwaysOrdered
|
(package private) ColumnOrdering |
currentColumnOrdering
|
(package private) java.util.Vector |
ordering
|
(package private) java.util.Vector |
unorderedOptimizables
|
Fields inherited from interface org.apache.derby.iapi.sql.compile.RowOrdering |
ASCENDING, DESCENDING, DONTCARE |
Constructor Summary | |
(package private) |
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. |
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.Vector 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.Vector 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 |
java.util.Vector ordering
ColumnOrdering columnsAlwaysOrdered
java.util.Vector alwaysOrderedOptimizables
ColumnOrdering currentColumnOrdering
java.util.Vector unorderedOptimizables
Constructor Detail |
RowOrderingImpl()
Method Detail |
public boolean orderedOnColumn(int direction, int orderPosition, int tableNumber, int columnNumber) throws StandardException
RowOrdering
orderedOnColumn
in interface RowOrdering
direction
- 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 RowOrdering
direction
- 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.Vector vec)
public void addOrderedColumn(int direction, int tableNumber, int columnNumber)
RowOrdering
addOrderedColumn
in interface RowOrdering
direction
- 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 RowOrdering
direction
- 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 RowOrdering
optimizable
- The table in questionpublic void columnAlwaysOrdered(Optimizable optimizable, int columnNumber)
RowOrdering
columnAlwaysOrdered
in interface RowOrdering
optimizable
- 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 RowOrdering
RowOrdering.alwaysOrdered(int)
public void removeOptimizable(int tableNumber)
RowOrdering
removeOptimizable
in interface RowOrdering
tableNumber
- The number of the table to remove from
this RowOrdering.RowOrdering.removeOptimizable(int)
private void removeOptimizableFromVector(int tableNumber, java.util.Vector vec)
public void addUnorderedOptimizable(Optimizable optimizable)
RowOrdering
addUnorderedOptimizable
in interface RowOrdering
RowOrdering.addUnorderedOptimizable(org.apache.derby.iapi.sql.compile.Optimizable)
public void copy(RowOrdering copyTo)
RowOrdering
copy
in interface RowOrdering
RowOrdering.copy(org.apache.derby.iapi.sql.compile.RowOrdering)
private void rememberCurrentColumnOrdering(int posn)
public java.lang.String toString()
private boolean unorderedOptimizablesOtherThan(Optimizable optimizable)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |