com.lucidera.lcs
Class LcsIndexOptimizer.Filter2IndexMapping
java.lang.Object
com.lucidera.lcs.LcsIndexOptimizer.Filter2IndexMapping
- Enclosing class:
- LcsIndexOptimizer
private static class LcsIndexOptimizer.Filter2IndexMapping
- extends Object
filter2IndexMap
Map<LcsIndexOptimizer.SargColumnFilter,FemLocalIndex> filter2IndexMap
index2MatchedPosMap
Map<FemLocalIndex,Integer> index2MatchedPosMap
LcsIndexOptimizer.Filter2IndexMapping
LcsIndexOptimizer.Filter2IndexMapping()
add
void add(LcsIndexOptimizer.SargColumnFilter filter,
FemLocalIndex index)
add
void add(LcsIndexOptimizer.IndexFilterTuple tup)
- adds a tuple(index,listOfFilters). a tuple (filter, index) is always
added regardless the existence of the filter in the filter2IndexMap
existing (filter,index) will be overridden, but the mapped position
of the overridden index will not be changed Example:
- with point filters on columns A,B,C
- Index X(A,B) and Y(B,C)
- generated tuples will be (X,A,B) and (Y,B,C)
- adding first tuple:
- filter2IndexMap will have (A,X) and (B,X)
- index2MatchedPosMap will have (X,2)
- adding second tuple:
- filter2IndexMap will have (A,X) and (B,Y) and (C,Y)
- index2MatchedPosMap will have (X,2) and (Y,2)
- Parameters:
tup
- the tuple to add
remove
void remove(LcsIndexOptimizer.SargColumnFilter filter)
- Remove a filter from the current mapping. Note this method removes
the mapping of a filter that maps to an index with all prior
positions still mapped to other filters. The recursion that callss
this method ensures filters are "popped" in the reverse order they
are matched to index positions, and the adjustment to "mapped index
position" is therefore -1.
Example:
- Filters on A, B, C
- Index X on C,A,B
- Index Y on C,B,A
Filter2Indexmapping goes through the following state change in one
call of getBestIndex(). The fields in () are the index and its
current mapped position. The mapping in [] are the ones costed. C
(X,1) -> C,A (X,2) -> [C,A,B (X,3)] -> C,A (X,2) -> C
(X,1) -> C (Y,1) -> C,B(Y,2) -> [C,B,A (Y,3)]
- Parameters:
filter
- filter to unmap
clear
void clear()
copyFrom
void copyFrom(LcsIndexOptimizer.Filter2IndexMapping srcMapping)
getSelectivity
Double getSelectivity(RelStatSource tabStats)
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object