Class IndexScanExpression
- java.lang.Object
-
- com.apple.foundationdb.record.query.plan.temp.expressions.IndexScanExpression
-
- All Implemented Interfaces:
Bindable
,Correlated<RelationalExpression>
,PlannerGraphRewritable
,RelationalExpression
public class IndexScanExpression extends Object implements RelationalExpression, PlannerGraphRewritable
A logical version ofRecordQueryIndexPlan
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.apple.foundationdb.record.query.plan.temp.Correlated
Correlated.BoundEquivalence
-
Nested classes/interfaces inherited from interface com.apple.foundationdb.record.query.plan.temp.RelationalExpression
RelationalExpression.CombineFunction<R,S>, RelationalExpression.CombinePredicate
-
-
Constructor Summary
Constructors Constructor Description IndexScanExpression(String indexName, IndexScanType scanType, List<ComparisonRange> comparisonRanges, boolean reverse)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object other)
boolean
equalsWithoutChildren(RelationalExpression otherExpression, AliasMap equivalencesMap)
Set<CorrelationIdentifier>
getCorrelatedTo()
Returns the set ofCorrelationIdentifier
s this entity is correlated to.int
getEqualitySize()
String
getIndexName()
List<? extends Quantifier>
getQuantifiers()
Return an iterator of references to the children of this planner expression.int
getSargableSize()
IndexScanType
getScanType()
int
hashCode()
int
hashCodeWithoutChildren()
boolean
hasInequality()
boolean
isReverse()
IndexScanExpression
rebase(AliasMap translationMap)
Rebases this and all other objects this objects is composed of using a given translation map.PlannerGraph
rewritePlannerGraph(List<? extends PlannerGraph> childGraphs)
Create a planner graph for better visualization of a query index plan.ScanComparisons
scanComparisons()
String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.apple.foundationdb.record.query.plan.temp.RelationalExpression
acceptPropertyVisitor, adjustMatch, bindIdentities, bindTo, canCorrelate, compensate, enumerateUnboundCorrelatedTo, exactlySubsumedBy, findMatches, getResultValues, hasIncompatibleBoundQuantifiers, hasUnboundQuantifiers, match, match, semanticEquals, semanticEquals, semanticHashCode, show, subsumedBy
-
-
-
-
Constructor Detail
-
IndexScanExpression
public IndexScanExpression(@Nonnull String indexName, @Nonnull IndexScanType scanType, @Nonnull List<ComparisonRange> comparisonRanges, boolean reverse)
-
-
Method Detail
-
getQuantifiers
@Nonnull public List<? extends Quantifier> getQuantifiers()
Description copied from interface:RelationalExpression
Return an iterator of references to the children of this planner expression. The iterators returned by different calls are guaranteed to be independent (i.e., advancing one will not advance another). However, they might point to the same object, as whenCollections.emptyIterator()
is returned. The returned iterator should be treated as an immutable object and may throw an exception ifIterator.remove()
is called. The iterator must return its elements in a consistent order.- Specified by:
getQuantifiers
in interfaceRelationalExpression
- Returns:
- an iterator of references to the children of this planner expression
-
getScanType
@Nonnull public IndexScanType getScanType()
-
scanComparisons
@Nonnull public ScanComparisons scanComparisons()
-
getEqualitySize
public int getEqualitySize()
-
hasInequality
public boolean hasInequality()
-
isReverse
public boolean isReverse()
-
getSargableSize
public int getSargableSize()
-
getCorrelatedTo
@Nonnull public Set<CorrelationIdentifier> getCorrelatedTo()
Description copied from interface:Correlated
Returns the set ofCorrelationIdentifier
s this entity is correlated to. This means that without a process that binds these correlations to values, theRelationalExpression
(or others that implement this interface) cannot even in principle produce a meaningful result. As often times entities that implement this interface use composition and effectively describe trees or DAGs, this method should be the set union of theCorrelationIdentifier
s this object is correlated to as well as all children, constituent parts, etc.- Specified by:
getCorrelatedTo
in interfaceCorrelated<RelationalExpression>
- Returns:
- the set of
CorrelationIdentifier
s this entity is correlated to
-
rebase
@Nonnull public IndexScanExpression rebase(@Nonnull AliasMap translationMap)
Description copied from interface:Correlated
Rebases this and all other objects this objects is composed of using a given translation map.- Specified by:
rebase
in interfaceCorrelated<RelationalExpression>
- Parameters:
translationMap
- a map defining a translation fromCorrelationIdentifier
sids
toCorrelationIdentifier
sids'
. After the rebase, every correlation to anid
containedids
that is contained or referred to directly or indirectly bythis
must have been transformed to use the mapped counterpart ofid
id'
inids'
. IDs not contained in the translation map must remain unmodified by the rebase operation.- Returns:
- a new entity that has been rebased
-
equalsWithoutChildren
public boolean equalsWithoutChildren(@Nonnull RelationalExpression otherExpression, @Nonnull AliasMap equivalencesMap)
- Specified by:
equalsWithoutChildren
in interfaceRelationalExpression
-
hashCodeWithoutChildren
public int hashCodeWithoutChildren()
- Specified by:
hashCodeWithoutChildren
in interfaceRelationalExpression
-
rewritePlannerGraph
@Nonnull public PlannerGraph rewritePlannerGraph(@Nonnull List<? extends PlannerGraph> childGraphs)
Create a planner graph for better visualization of a query index plan.- Specified by:
rewritePlannerGraph
in interfacePlannerGraphRewritable
- Parameters:
childGraphs
- planner graphs of children expression that already have been computed- Returns:
- the rewritten planner graph that models the index as a separate node that is connected to the actual index scan plan node.
-
-