class PredicateList extends QueryTreeNodeVector<Predicate> implements OptimizablePredicateList
Modifier and Type | Class and Description |
---|---|
private static class |
PredicateList.PredicateWrapper
Inner class which helps statistics routines do their work.
|
private static class |
PredicateList.PredicateWrapperList
Another inner class which is basically a List of Predicate Wrappers.
|
Modifier and Type | Field and Description |
---|---|
private int |
numberOfQualifiers |
private int |
numberOfStartPredicates |
private int |
numberOfStopPredicates |
private static int |
QUALIFIER_NUM_CATEGORIES |
private static int |
QUALIFIER_ORDER_EQUALS |
private static int |
QUALIFIER_ORDER_NON_QUAL |
private static int |
QUALIFIER_ORDER_NOT_EQUALS |
private static int |
QUALIFIER_ORDER_OR_CLAUSE |
private static int |
QUALIFIER_ORDER_OTHER_RELOP |
eltClass
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
Constructor and Description |
---|
PredicateList(ContextManager cm) |
Modifier and Type | Method and Description |
---|---|
void |
addOptPredicate(OptimizablePredicate optPredicate)
Add the given OptimizablePredicate to the end of this list.
|
void |
addOptPredicate(OptimizablePredicate optPredicate,
int position)
Another flavor of addOptPredicate that inserts the given predicate
at a given position.
|
(package private) void |
addPredicate(Predicate predicate)
Add a Predicate to the 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.
|
(package private) boolean |
allPushable()
Check if all of the predicates in the list are pushable.
|
(package private) boolean |
allReference(FromBaseTable fbt)
Check if all the predicates reference a given
FromBaseTable . |
private void |
calculateWeight(PredicateList.PredicateWrapperList[] pwList,
int numUsefulPredicates) |
(package private) void |
categorize()
Categorize the predicates in the list.
|
(package private) void |
checkTopPredicatesForEqualsConditions(int tableNumber,
boolean[] eqOuterCols,
int[] tableNumbers,
JBitSet[] tableColMap,
boolean resultColTable)
Update the array of columns in = conditions with constants
or correlation or join columns.
|
private int |
chooseLongestMatch(PredicateList.PredicateWrapperList[] predArray,
java.util.List<Predicate> ret,
int numWorkingPredicates)
choose the statistic which has the maximum match with the predicates.
|
void |
classify(Optimizable optTable,
ConglomerateDescriptor cd)
Classify the predicates in this list according to the given
table and conglomerate.
|
(package private) boolean |
constantColumn(ColumnReference colRef) |
void |
copyPredicatesToOtherList(OptimizablePredicateList otherList)
Non-destructive copy of all of the predicates from this list to the
other list.
|
private void |
countScanFlags() |
(package private) void |
decrementLevel(FromList fromList,
int decrement)
Decrement the level of any CRs from the subquery's
FROM list that are interesting to transitive closure.
|
(package private) void |
eliminateBooleanTrueAndBooleanTrue()
Eliminate predicates of the form:
AndNode
/ \
true BooleanConstantNode true BooleanConstantNode
This is useful when checking for a NOP PRN as the
Like transformation on c1 like 'ASDF%' can leave
one of these predicates in the list.
|
private void |
finishKey(ExpressionClassBuilder acb,
MethodBuilder mb,
MethodBuilder exprFun,
LocalField rowField)
Finish generating a start or stop key
|
private LocalField |
generateIndexableRow(ExpressionClassBuilder acb,
int numberOfColumns)
Generate the indexable row for a start key or stop key.
|
(package private) void |
generateInListValues(ExpressionClassBuilder acb,
MethodBuilder mb)
If there is an IN-list probe predicate in this list then generate
the corresponding IN-list values as a DataValueDescriptor array,
to be used for probing at execution time.
|
void |
generateQualifiers(ExpressionClassBuilderInterface acbi,
MethodBuilder mb,
Optimizable optTable,
boolean absolute)
Generate the qualifiers for a scan.
|
private void |
generateSetColumn(ExpressionClassBuilder acb,
MethodBuilder exprFun,
int columnNumber,
Predicate pred,
Optimizable optTable,
LocalField rowField,
boolean isStartKey)
Generate the code to set the value from a predicate in an index column.
|
private void |
generateSingleQualifierCode(MethodBuilder consMB,
Optimizable optTable,
boolean absolute,
ExpressionClassBuilder acb,
RelationalOperator or_node,
LocalField qualField,
int array_idx_1,
int array_idx_2) |
void |
generateStartKey(ExpressionClassBuilderInterface acbi,
MethodBuilder mb,
Optimizable optTable)
Generate the start key for a heap or index scan.
|
void |
generateStopKey(ExpressionClassBuilderInterface acbi,
MethodBuilder mb,
Optimizable optTable)
Generate the stop key for a heap or index scan.
|
OptimizablePredicate |
getOptPredicate(int index)
Return the nth OptimizablePredicate in the list.
|
(package private) PredicateList |
getPushablePredicates(JBitSet referencedTableMap)
Build a list of pushable predicates, if any,
that satisfy the referencedTableMap.
|
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?
|
private static boolean |
isConstantOrParameterNode(ValueNode node)
Check if a node is representing a constant or a parameter.
|
boolean |
isRedundantPredicate(int predNum)
Return whether or not the specified entry in the list is a redundant
predicate.
|
(package private) void |
joinClauseTransitiveClosure(int numTables,
FromList fromList,
CompilerContext cc)
Perform transitive closure on join clauses.
|
void |
markAllPredicatesQualifiers()
Mark all of the predicates as Qualifiers and set the numberOfQualifiers
to reflect this.
|
(package private) void |
markReferencedColumns()
Mark all of the RCs and the RCs in their RC/VCN chain
referenced in the predicate list as referenced.
|
private void |
orderQualifiers() |
private void |
orderUsefulPredicates(Optimizable optTable,
ConglomerateDescriptor cd,
boolean pushPreds,
boolean nonMatchingIndexScan,
boolean coveringIndexScan) |
(package private) void |
pullExpressions(int numTables,
ValueNode searchClause)
Break apart the search clause into matching a PredicateList
where each top level predicate is a separate element in the list.
|
(package private) void |
pushExpressionsIntoSelect(SelectNode select,
boolean copyPredicate)
Push all predicates, which can be pushed, into the underlying select.
|
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.
|
(package private) void |
remapColumnReferencesToExpressions()
Remap all ColumnReferences in this tree to be clones of the
underlying expression.
|
void |
removeOptPredicate(int predCtr)
Remove the OptimizablePredicate at the specified index (0-based) from the list.
|
void |
removeOptPredicate(OptimizablePredicate pred)
Another version of removeOptPredicate that takes the Predicate to be
removed, rather than the position of the Predicate.
|
(package private) void |
removeRedundantPredicates()
Remove redundant predicates.
|
(package private) ValueNode |
restoreConstantPredicates()
Rebuild a constant expression tree from the remaining constant
predicates and delete those entries from the PredicateList.
|
(package private) ValueNode |
restorePredicates()
Rebuild an expression tree from the remaining predicates and delete those
entries from the PredicateList.
|
boolean |
sameStartStopPosition()
Can we use the same key for both the start and stop key.
|
(package private) void |
searchClauseTransitiveClosure(int numTables,
boolean hashJoinSpecified)
Perform transitive closure on search clauses.
|
double |
selectivity(Optimizable optTable)
calculate the selectivity for a set of predicates.
|
private double |
selectivityNoStatistics(Optimizable optTable)
Compute selectivity the old fashioned way.
|
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 |
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.
|
protected void |
transferNonQualifiers(Optimizable optTable,
PredicateList otherPL)
Transfer the non-qualifiers from this predicate list to the specified
predicate 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.
|
(package private) void |
xorReferencedSet(JBitSet fromMap)
XOR fromMap with the referenced table map in every remaining
Predicate in the list.
|
acceptChildren, addElement, destructiveAppend, elementAt, indexOf, insertElementAt, iterator, nondestructiveAppend, printSubNodes, removeAllElements, removeElement, removeElementAt, setElementAt, size
accept, addTag, addUDTUsagePriv, addUDTUsagePriv, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, copyTagsFrom, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, generate, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContext, getContextManager, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getLongProperty, getNullNode, getOffsetOrderedNodes, getOptimizerFactory, getOptimizerTracer, getParameterTypes, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, getUDTDesc, isAtomic, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeConstantAction, makeTableName, makeTableName, nodeHeader, optimizerTracingIsOn, orReliability, parseSearchCondition, parseStatement, printLabel, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setEndOffset, setRefActionInfo, stackPrint, taggedWith, toString, treePrint, treePrint, verifyClassExist
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
size
private int numberOfStartPredicates
private int numberOfStopPredicates
private int numberOfQualifiers
private static final int QUALIFIER_ORDER_EQUALS
private static final int QUALIFIER_ORDER_OTHER_RELOP
private static final int QUALIFIER_ORDER_NOT_EQUALS
private static final int QUALIFIER_ORDER_NON_QUAL
private static final int QUALIFIER_ORDER_OR_CLAUSE
private static final int QUALIFIER_NUM_CATEGORIES
PredicateList(ContextManager cm)
public OptimizablePredicate getOptPredicate(int index)
OptimizablePredicateList
getOptPredicate
in interface OptimizablePredicateList
index
- "index" (0 based) into the list.OptimizablePredicateList.getOptPredicate(int)
public final void removeOptPredicate(int predCtr) throws StandardException
OptimizablePredicateList
removeOptPredicate
in interface OptimizablePredicateList
predCtr
- The index.StandardException
- Thrown on errorOptimizablePredicateList.removeOptPredicate(int)
public final void removeOptPredicate(OptimizablePredicate pred)
public void addOptPredicate(OptimizablePredicate optPredicate)
OptimizablePredicateList
addOptPredicate
in interface OptimizablePredicateList
optPredicate
- The predicate to addOptimizablePredicateList.addOptPredicate(org.apache.derby.iapi.sql.compile.OptimizablePredicate)
public void addOptPredicate(OptimizablePredicate optPredicate, int position)
public boolean useful(Optimizable optTable, ConglomerateDescriptor cd) throws StandardException
OptimizablePredicateList
useful
in interface OptimizablePredicateList
optTable
- An Optimizable for the table in questioncd
- A ConglomerateDescriptor for the conglomerate in questionStandardException
- Thrown on errorOptimizablePredicateList.useful(org.apache.derby.iapi.sql.compile.Optimizable, org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor)
public void pushUsefulPredicates(Optimizable optTable) throws StandardException
OptimizablePredicateList
pushUsefulPredicates
in interface OptimizablePredicateList
optTable
- An Optimizable for the table in questionStandardException
- Thrown on errorOptimizablePredicateList.pushUsefulPredicates(org.apache.derby.iapi.sql.compile.Optimizable)
public void classify(Optimizable optTable, ConglomerateDescriptor cd) throws StandardException
OptimizablePredicateList
classify
in interface OptimizablePredicateList
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 errorOptimizablePredicateList.classify(org.apache.derby.iapi.sql.compile.Optimizable, org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor)
public void markAllPredicatesQualifiers()
OptimizablePredicateList
markAllPredicatesQualifiers
in interface OptimizablePredicateList
OptimizablePredicateList.markAllPredicatesQualifiers()
public int hasEqualityPredicateOnOrderedColumn(Optimizable optTable, int columnNumber, boolean isNullOkay) throws StandardException
OptimizablePredicateList
hasEqualityPredicateOnOrderedColumn
in interface OptimizablePredicateList
StandardException
- Thrown on errorOptimizablePredicateList.hasEqualityPredicateOnOrderedColumn(org.apache.derby.iapi.sql.compile.Optimizable, int, boolean)
public boolean hasOptimizableEqualityPredicate(Optimizable optTable, int columnNumber, boolean isNullOkay) throws StandardException
OptimizablePredicateList
hasOptimizableEqualityPredicate
in interface OptimizablePredicateList
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 errorOptimizablePredicateList.hasOptimizableEqualityPredicate(org.apache.derby.iapi.sql.compile.Optimizable, int, boolean)
public boolean hasOptimizableEquijoin(Optimizable optTable, int columnNumber) throws StandardException
OptimizablePredicateList
hasOptimizableEquijoin
in interface OptimizablePredicateList
optTable
- The optimizable the column comes from.columnNumber
- The column number within the base table.StandardException
- Thrown on errorOptimizablePredicateList.hasOptimizableEquijoin(org.apache.derby.iapi.sql.compile.Optimizable, int)
public void putOptimizableEqualityPredicateFirst(Optimizable optTable, int columnNumber) throws StandardException
OptimizablePredicateList
putOptimizableEqualityPredicateFirst
in interface OptimizablePredicateList
optTable
- The optimizable the column comes from.columnNumber
- The column number within the base table.StandardException
- Thrown on errorOptimizablePredicateList.putOptimizableEqualityPredicateFirst(org.apache.derby.iapi.sql.compile.Optimizable, int)
private void orderUsefulPredicates(Optimizable optTable, ConglomerateDescriptor cd, boolean pushPreds, boolean nonMatchingIndexScan, boolean coveringIndexScan) throws StandardException
StandardException
void addPredicate(Predicate predicate) throws StandardException
predicate
- A Predicate to add to the listStandardException
- Thrown on errorprotected void transferNonQualifiers(Optimizable optTable, PredicateList otherPL) throws StandardException
optTable
- The optimizable that we want qualifiers forotherPL
- ParameterList for non-qualifiersStandardException
- Thrown on errorvoid categorize() throws StandardException
StandardException
- Thrown on errorvoid eliminateBooleanTrueAndBooleanTrue()
ValueNode restoreConstantPredicates() throws StandardException
StandardException
ValueNode restorePredicates() throws StandardException
StandardException
void remapColumnReferencesToExpressions() throws StandardException
StandardException
- Thrown on errorvoid pullExpressions(int numTables, ValueNode searchClause) throws StandardException
numTables
- Number of tables in the DML StatementsearchClause
- The search clause to operate on.StandardException
- Thrown on errorvoid xorReferencedSet(JBitSet fromMap)
fromMap
- The JBitSet to XOR with.private void countScanFlags()
private static boolean isConstantOrParameterNode(ValueNode node)
node
- the node to checktrue
if the node is a constant or a parameter, false
otherwisevoid pushExpressionsIntoSelect(SelectNode select, boolean copyPredicate) throws StandardException
select
- The underlying SelectNode.copyPredicate
- Whether to make a copy of the predicate
before pushingStandardException
- Thrown on errorvoid markReferencedColumns() throws StandardException
StandardException
- Thrown on errorvoid checkTopPredicatesForEqualsConditions(int tableNumber, boolean[] eqOuterCols, int[] tableNumbers, JBitSet[] tableColMap, boolean resultColTable) throws StandardException
tableNumber
- The tableNumber of the table from which
the columns of interest come from.eqOuterCols
- Array of booleans for noting which columns
are in = predicates with constants or
correlation columns.tableNumbers
- Array of table numbers in this query block.resultColTable
- tableNumber is the table the result columns are
coming fromStandardException
- Thrown on errorboolean allPushable()
boolean allReference(FromBaseTable fbt)
FromBaseTable
.fbt
- the FromBaseTable
to check fortrue
if the table is referenced by all predicates,
false
otherwisePredicateList getPushablePredicates(JBitSet referencedTableMap) throws StandardException
referencedTableMap
- The referenced table mapStandardException
- Thrown on errorvoid decrementLevel(FromList fromList, int decrement)
fromList
- The subquery's FROM list.decrement
- Decrement size.void joinClauseTransitiveClosure(int numTables, FromList fromList, CompilerContext cc) throws StandardException
numTables
- The number of tables in the queryfromList
- The FromList in question.cc
- The CompilerContext to useStandardException
- Thrown on errorvoid searchClauseTransitiveClosure(int numTables, boolean hashJoinSpecified) throws StandardException
numTables
- The number of tables in the queryhashJoinSpecified
- Whether or not user specified a hash joinStandardException
- Thrown on errorvoid removeRedundantPredicates()
public void transferPredicates(OptimizablePredicateList otherList, JBitSet referencedTableMap, Optimizable table) throws StandardException
OptimizablePredicateList
transferPredicates
in interface OptimizablePredicateList
otherList
- The predicateList to xfer toreferencedTableMap
- The table map to check againsttable
- The table to order the new predicates
againstStandardException
- Thrown on errorOptimizablePredicateList.transferPredicates(org.apache.derby.iapi.sql.compile.OptimizablePredicateList, org.apache.derby.iapi.util.JBitSet, org.apache.derby.iapi.sql.compile.Optimizable)
public void transferAllPredicates(OptimizablePredicateList otherList) throws StandardException
OptimizablePredicateList
transferAllPredicates
in interface OptimizablePredicateList
StandardException
- Thrown on errorOptimizablePredicateList.transferAllPredicates(org.apache.derby.iapi.sql.compile.OptimizablePredicateList)
public void copyPredicatesToOtherList(OptimizablePredicateList otherList) throws StandardException
OptimizablePredicateList
copyPredicatesToOtherList
in interface OptimizablePredicateList
otherList
- The predicateList to xfer toStandardException
- Thrown on errorOptimizablePredicateList.copyPredicatesToOtherList(org.apache.derby.iapi.sql.compile.OptimizablePredicateList)
public boolean isRedundantPredicate(int predNum)
OptimizablePredicateList
isRedundantPredicate
in interface OptimizablePredicateList
predNum
- The entry in the listOptimizablePredicateList.isRedundantPredicate(int)
public void setPredicatesAndProperties(OptimizablePredicateList otherList) throws StandardException
OptimizablePredicateList
setPredicatesAndProperties
in interface OptimizablePredicateList
otherList
- The list to set the same as this one.StandardException
- Thrown on errorOptimizablePredicateList.setPredicatesAndProperties(org.apache.derby.iapi.sql.compile.OptimizablePredicateList)
public int startOperator(Optimizable optTable)
OptimizablePredicateList
startOperator
in interface OptimizablePredicateList
OptimizablePredicateList.startOperator(org.apache.derby.iapi.sql.compile.Optimizable)
public void generateStopKey(ExpressionClassBuilderInterface acbi, MethodBuilder mb, Optimizable optTable) throws StandardException
OptimizablePredicateList
generateStopKey
in interface OptimizablePredicateList
acbi
- 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 errorOptimizablePredicateList.generateStopKey(org.apache.derby.iapi.sql.compile.ExpressionClassBuilderInterface, org.apache.derby.iapi.services.compiler.MethodBuilder, org.apache.derby.iapi.sql.compile.Optimizable)
public int stopOperator(Optimizable optTable)
OptimizablePredicateList
stopOperator
in interface OptimizablePredicateList
OptimizablePredicateList.stopOperator(org.apache.derby.iapi.sql.compile.Optimizable)
private void generateSingleQualifierCode(MethodBuilder consMB, Optimizable optTable, boolean absolute, ExpressionClassBuilder acb, RelationalOperator or_node, LocalField qualField, int array_idx_1, int array_idx_2) throws StandardException
StandardException
void generateInListValues(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException
acb
- The ActivationClassBuilder for the class we're buildingmb
- The MethodBuilder for the method we're buildingStandardException
public void generateQualifiers(ExpressionClassBuilderInterface acbi, MethodBuilder mb, Optimizable optTable, boolean absolute) throws StandardException
OptimizablePredicateList
generateQualifiers
in interface OptimizablePredicateList
acbi
- 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 errorOptimizablePredicateList.generateQualifiers(org.apache.derby.iapi.sql.compile.ExpressionClassBuilderInterface, org.apache.derby.iapi.services.compiler.MethodBuilder, org.apache.derby.iapi.sql.compile.Optimizable, boolean)
private void orderQualifiers()
public void generateStartKey(ExpressionClassBuilderInterface acbi, MethodBuilder mb, Optimizable optTable) throws StandardException
OptimizablePredicateList
generateStartKey
in interface OptimizablePredicateList
acbi
- 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 errorOptimizablePredicateList.generateStartKey(org.apache.derby.iapi.sql.compile.ExpressionClassBuilderInterface, org.apache.derby.iapi.services.compiler.MethodBuilder, org.apache.derby.iapi.sql.compile.Optimizable)
public boolean sameStartStopPosition() throws StandardException
OptimizablePredicateList
sameStartStopPosition
in interface OptimizablePredicateList
StandardException
- Thrown on errorOptimizablePredicateList.sameStartStopPosition()
private LocalField generateIndexableRow(ExpressionClassBuilder acb, int numberOfColumns)
acb
- The ActivationClassBuilder for the class we're buildingnumberOfColumns
- The number of columns in the keyprivate void generateSetColumn(ExpressionClassBuilder acb, MethodBuilder exprFun, int columnNumber, Predicate pred, Optimizable optTable, LocalField rowField, boolean isStartKey) throws StandardException
acb
- The ActivationClassBuilder for the class we're buildingexprFun
- The MethodBuilder for the method we're buildingcolumnNumber
- The position number of the column we're setting
the value in (zero-based)pred
- The Predicate with the value to put in the index columnoptTable
- The Optimizable table the column is inrowField
- The field that holds the indexable rowisStartKey
- Are we generating start or stop key? This information
is useful for "in"'s dynamic start/stop key, bug 3858StandardException
- Thrown on errorprivate void finishKey(ExpressionClassBuilder acb, MethodBuilder mb, MethodBuilder exprFun, LocalField rowField)
acb
- The ActivationClassBuilder for the class we're buildingexprFun
- The MethodBuilder for the method we're buildingrowField
- The name of the field that holds the indexable rowboolean constantColumn(ColumnReference colRef)
public void adjustForSortElimination(RequiredRowOrdering ordering) throws StandardException
OptimizablePredicateList
adjustForSortElimination
in interface OptimizablePredicateList
StandardException
Currently this method only accounts for IN list multi-probing
predicates (DERBY-3279).
public double selectivity(Optimizable optTable) throws StandardException
OptimizablePredicateList
selectivity
in interface OptimizablePredicateList
optTable
- the Optimizable that the predicate list restricts.StandardException
OptimizablePredicateList.selectivity(org.apache.derby.iapi.sql.compile.Optimizable)
private void calculateWeight(PredicateList.PredicateWrapperList[] pwList, int numUsefulPredicates)
private int chooseLongestMatch(PredicateList.PredicateWrapperList[] predArray, java.util.List<Predicate> ret, int numWorkingPredicates)
private double selectivityNoStatistics(Optimizable optTable) throws StandardException
StandardException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.