PredicateList
public interface OptimizablePredicateList
Modifier and Type | Method | Description |
---|---|---|
void |
addOptPredicate(OptimizablePredicate optPredicate) |
Add the given OptimizablePredicate to the end of this list.
|
void |
adjustForSortElimination(RequiredRowOrdering ordering) |
Walk through the predicates in this list and make any adjustments
that are required to allow for proper handling of an ORDER BY
clause.
|
void |
classify(Optimizable optTable,
ConglomerateDescriptor cd) |
Classify the predicates in this list according to the given
table and conglomerate.
|
void |
copyPredicatesToOtherList(OptimizablePredicateList otherList) |
Non-destructive copy of all of the predicates from this list to the
other list.
|
void |
generateQualifiers(ExpressionClassBuilderInterface acb,
MethodBuilder mb,
Optimizable optTable,
boolean absolute) |
Generate the qualifiers for a scan.
|
void |
generateStartKey(ExpressionClassBuilderInterface acb,
MethodBuilder mb,
Optimizable optTable) |
Generate the start key for a heap or index scan.
|
void |
generateStopKey(ExpressionClassBuilderInterface acb,
MethodBuilder mb,
Optimizable optTable) |
Generate the stop key for a heap or index scan.
|
OptimizablePredicate |
getOptPredicate(int n) |
Return the nth OptimizablePredicate in the list.
|
int |
hasEqualityPredicateOnOrderedColumn(Optimizable optTable,
int columnNumber,
boolean isNullOkay) |
Check into the predicate list if the passed column has an equijoin
predicate on it.
|
boolean |
hasOptimizableEqualityPredicate(Optimizable optTable,
int columnNumber,
boolean isNullOkay) |
Is there an optimizable equality predicate on the specified column?
|
boolean |
hasOptimizableEquijoin(Optimizable optTable,
int columnNumber) |
Is there an optimizable equijoin on the specified column?
|
boolean |
isRedundantPredicate(int predNum) |
Return whether or not the specified entry in the list is a redundant
predicate.
|
void |
markAllPredicatesQualifiers() |
Mark all of the predicates as Qualifiers and set the numberOfQualifiers
to reflect this.
|
void |
pushUsefulPredicates(Optimizable optTable) |
Determine which predicates in this list are useful for limiting
the scan on the given table using its best conglomerate.
|
void |
putOptimizableEqualityPredicateFirst(Optimizable optTable,
int columnNumber) |
Find the optimizable equality predicate on the specified column and make
it the first predicate in this list.
|
void |
removeOptPredicate(int predCtr) |
Remove the OptimizablePredicate at the specified index (0-based) from the list.
|
boolean |
sameStartStopPosition() |
Can we use the same key for both the start and stop key.
|
double |
selectivity(Optimizable optTable) |
calculate the selectivity for a set of predicates.
|
void |
setPredicatesAndProperties(OptimizablePredicateList otherList) |
Sets the given list to have the same elements as this one, and
the same properties as this one (number of qualifiers and start
and stop predicates.
|
int |
size() |
Return the number of OptimizablePredicates in the list.
|
int |
startOperator(Optimizable optTable) |
Get the start operator for the given Optimizable for a heap or
index scan.
|
int |
stopOperator(Optimizable optTable) |
Get the stop operator for the given Optimizable for a heap or
index scan.
|
void |
transferAllPredicates(OptimizablePredicateList otherList) |
Transfer all the predicates from this list to the given list.
|
void |
transferPredicates(OptimizablePredicateList otherList,
JBitSet referencedTableMap,
Optimizable table) |
Transfer the predicates whose referenced set is contained by the
specified referencedTableMap from this list to the other list.
|
boolean |
useful(Optimizable optTable,
ConglomerateDescriptor cd) |
Return true if this predicate list is useful for limiting the scan on
the given table using the given conglomerate.
|
int size()
OptimizablePredicate getOptPredicate(int n)
n
- "index" (0 based) into the list.void removeOptPredicate(int predCtr) throws StandardException
predCtr
- The index.StandardException
- Thrown on errorvoid addOptPredicate(OptimizablePredicate optPredicate)
optPredicate
- The predicate to addboolean useful(Optimizable optTable, ConglomerateDescriptor cd) throws StandardException
optTable
- An Optimizable for the table in questioncd
- A ConglomerateDescriptor for the conglomerate in questionStandardException
- Thrown on errorvoid pushUsefulPredicates(Optimizable optTable) throws StandardException
optTable
- An Optimizable for the table in questionStandardException
- Thrown on errorvoid classify(Optimizable optTable, ConglomerateDescriptor cd) throws StandardException
optTable
- The Optimizable table for which to classify
the predicates in this list.cd
- The ConglomerateDescriptor for which to classify
the predicates in this list.StandardException
- Thrown on errorvoid markAllPredicatesQualifiers()
int hasEqualityPredicateOnOrderedColumn(Optimizable optTable, int columnNumber, boolean isNullOkay) throws StandardException
optTable
- columnNumber
- isNullOkay
- StandardException
boolean hasOptimizableEqualityPredicate(Optimizable optTable, int columnNumber, boolean isNullOkay) throws StandardException
optTable
- The optimizable the column comes from.columnNumber
- The column number within the base table.isNullOkay
- boolean, whether or not the IS NULL operator
satisfies the searchStandardException
- Thrown on errorboolean hasOptimizableEquijoin(Optimizable optTable, int columnNumber) throws StandardException
optTable
- The optimizable the column comes from.columnNumber
- The column number within the base table.StandardException
- Thrown on errorvoid putOptimizableEqualityPredicateFirst(Optimizable optTable, int columnNumber) throws StandardException
optTable
- The optimizable the column comes from.columnNumber
- The column number within the base table.StandardException
- Thrown on errorvoid transferPredicates(OptimizablePredicateList otherList, JBitSet referencedTableMap, Optimizable table) throws StandardException
otherList
- The predicateList to xfer toreferencedTableMap
- The table map to check againsttable
- The table to order the new predicates
againstStandardException
- Thrown on errorvoid transferAllPredicates(OptimizablePredicateList otherList) throws StandardException
StandardException
- Thrown on errorvoid copyPredicatesToOtherList(OptimizablePredicateList otherList) throws StandardException
otherList
- The predicateList to xfer toStandardException
- Thrown on errorvoid setPredicatesAndProperties(OptimizablePredicateList otherList) throws StandardException
otherList
- The list to set the same as this one.StandardException
- Thrown on errorboolean isRedundantPredicate(int predNum)
predNum
- The entry in the listint startOperator(Optimizable optTable)
int stopOperator(Optimizable optTable)
void generateQualifiers(ExpressionClassBuilderInterface acb, MethodBuilder mb, Optimizable optTable, boolean absolute) throws StandardException
acb
- The ExpressionClassBuilderInterface for the class we are buildingmb
- The method the generated code is going intooptTable
- The Optimizable table the Qualifiers are onabsolute
- Generate absolute column positions if true,
else relative column positions (within the underlying
row)StandardException
- Thrown on errorvoid generateStartKey(ExpressionClassBuilderInterface acb, MethodBuilder mb, Optimizable optTable) throws StandardException
acb
- The ExpressionClassBuilderInterface for the class we're buildingmb
- The method the generated code is to go intooptTable
- The Optimizable table the start key is forStandardException
- Thrown on errorvoid generateStopKey(ExpressionClassBuilderInterface acb, MethodBuilder mb, Optimizable optTable) throws StandardException
acb
- The ExpressionClassBuilderInterface for the class we're buildingmb
- the method the generated code is to go intooptTable
- The Optimizable table the stop key is forStandardException
- Thrown on errorboolean sameStartStopPosition() throws StandardException
StandardException
- Thrown on errordouble selectivity(Optimizable optTable) throws StandardException
optTable
- the Optimizable that the predicate list restricts.StandardException
void adjustForSortElimination(RequiredRowOrdering ordering) throws StandardException
StandardException
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.