Interface RecordQueryPlan
-
- All Superinterfaces:
Bindable
,Correlated<RelationalExpression>
,PlanHashable
,PlannerGraphRewritable
,QueryPlan<FDBQueriedRecord<Message>>
,RelationalExpression
- All Known Subinterfaces:
RecordQueryPlanWithChild
,RecordQueryPlanWithChildren
,RecordQueryPlanWithComparisons
,RecordQueryPlanWithIndex
,RecordQueryPlanWithNoChildren
,RecordQueryPlanWithRequiredFields
- All Known Implementing Classes:
ComposedBitmapIndexQueryPlan
,RecordQueryCoveringIndexPlan
,RecordQueryFetchFromPartialRecordPlan
,RecordQueryFilterPlan
,RecordQueryIndexPlan
,RecordQueryInJoinPlan
,RecordQueryInParameterJoinPlan
,RecordQueryIntersectionPlan
,RecordQueryInValuesJoinPlan
,RecordQueryLoadByKeysPlan
,RecordQueryPredicateFilterPlan
,RecordQueryScanPlan
,RecordQueryScoreForRankPlan
,RecordQueryTextIndexPlan
,RecordQueryTypeFilterPlan
,RecordQueryUnionPlan
,RecordQueryUnionPlanBase
,RecordQueryUnorderedDistinctPlan
,RecordQueryUnorderedPrimaryKeyDistinctPlan
,RecordQueryUnorderedUnionPlan
@API(STABLE) public interface RecordQueryPlan extends QueryPlan<FDBQueriedRecord<Message>>, PlannerGraphRewritable
An executable query plan for producing records. A query plan is run against a record store to produce a stream of matching records. A query plan of any complexity will have child plans and execute by altering or combining the children's streams in some way.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default RecordQueryPlan
accept(RecordQueryPlannerSubstitutionVisitor visitor)
default <M extends Message>
RecordCursor<FDBQueriedRecord<M>>execute(FDBRecordStoreBase<M> store)
Execute this query plan.default <M extends Message>
RecordCursor<FDBQueriedRecord<M>>execute(FDBRecordStoreBase<M> store, EvaluationContext context)
Execute this query plan.<M extends Message>
RecordCursor<FDBQueriedRecord<M>>execute(FDBRecordStoreBase<M> store, EvaluationContext context, byte[] continuation, ExecuteProperties executeProperties)
Execute this query plan.default RecordCursor<FDBQueriedRecord<Message>>
execute(FDBRecordStore store, EvaluationContext context, byte[] continuation, ExecuteProperties executeProperties)
Execute this query plan.AvailableFields
getAvailableFields()
List<RecordQueryPlan>
getChildren()
Returns the (zero or more)RecordQueryPlan
children of this plan.default List<? extends QueryPlan<?>>
getQueryPlanChildren()
Returns the (zero or more) childQueryPlan
s of this plan.default boolean
structuralEquals(Object other)
Overloaded method to determine structural equality between two different plans using an emptyAliasMap
.default boolean
structuralEquals(Object other, AliasMap equivalenceMap)
Determine if two plans are structurally equal.default int
structuralHashCode()
Return a hash code for this plan which is defined based on the structural layout of a plan.-
Methods inherited from interface com.apple.foundationdb.record.query.plan.temp.Correlated
getCorrelatedTo, rebase
-
Methods inherited from interface com.apple.foundationdb.record.PlanHashable
planHash
-
Methods inherited from interface com.apple.foundationdb.record.query.plan.temp.explain.PlannerGraphRewritable
rewritePlannerGraph
-
Methods inherited from interface com.apple.foundationdb.record.query.plan.plans.QueryPlan
execute, execute, getComplexity, getUsedIndexes, hasFullRecordScan, hasIndexScan, hasLoadBykeys, hasRecordScan, isReverse, logPlanStructure
-
Methods inherited from interface com.apple.foundationdb.record.query.plan.temp.RelationalExpression
acceptPropertyVisitor, bindTo, canCorrelate, equalsWithoutChildren, getQuantifiers, hashCodeWithoutChildren, semanticEquals, semanticEquals, semanticHashCode, show
-
-
-
-
Method Detail
-
execute
@Nonnull <M extends Message> RecordCursor<FDBQueriedRecord<M>> execute(@Nonnull FDBRecordStoreBase<M> store, @Nonnull EvaluationContext context, @Nullable byte[] continuation, @Nonnull ExecuteProperties executeProperties)
Execute this query plan.- Type Parameters:
M
- type used to represent stored records- Parameters:
store
- record store from which to fetch recordscontext
- evaluation context containing parameter bindingscontinuation
- continuation from a previous execution of this same planexecuteProperties
- limits on execution- Returns:
- a cursor of records that match the query criteria
-
execute
@Nonnull default RecordCursor<FDBQueriedRecord<Message>> execute(@Nonnull FDBRecordStore store, @Nonnull EvaluationContext context, @Nullable byte[] continuation, @Nonnull ExecuteProperties executeProperties)
Description copied from interface:QueryPlan
Execute this query plan.- Specified by:
execute
in interfaceQueryPlan<FDBQueriedRecord<Message>>
- Parameters:
store
- record store from which to fetch itemscontext
- evaluation context containing parameter bindingscontinuation
- continuation from a previous execution of this same planexecuteProperties
- limits on execution- Returns:
- a cursor of items that match the query criteria
-
execute
@Nonnull default <M extends Message> RecordCursor<FDBQueriedRecord<M>> execute(@Nonnull FDBRecordStoreBase<M> store)
Execute this query plan.- Type Parameters:
M
- type used to represent stored records- Parameters:
store
- record store from which to fetch records- Returns:
- a cursor of records that match the query criteria
-
execute
@Nonnull default <M extends Message> RecordCursor<FDBQueriedRecord<M>> execute(@Nonnull FDBRecordStoreBase<M> store, @Nonnull EvaluationContext context)
Execute this query plan.- Type Parameters:
M
- type used to represent stored records- Parameters:
store
- record store to accesscontext
- evaluation context containing parameter bindings- Returns:
- a cursor of records that match the query criteria
-
getChildren
@API(UNSTABLE) @Nonnull List<RecordQueryPlan> getChildren()
Returns the (zero or more)RecordQueryPlan
children of this plan.Warning: This part of the API is undergoing active development. At some point in the future, the return type of this method will change to allow it to return a list of generic
QueryPlan
s. At current, everyRecordQueryPlan
can only have otherRecordQueryPlan
s as children. However, this is not guaranteed to be the case in the future. This method has been marked asAPI.Status.UNSTABLE
as of version 2.5.- Returns:
- the child plans
-
getQueryPlanChildren
@Nonnull default List<? extends QueryPlan<?>> getQueryPlanChildren()
Description copied from interface:QueryPlan
Returns the (zero or more) childQueryPlan
s of this plan. These children may or may not return elements of the same type as their parent plan.Warning: This part of the API is currently undergoing active development. At some point in the future, this will be renamed
getChildren()
. This cannot be done at current, however, as it would require an incompatible change togetChildren()
. That method has been markedAPI.Status.UNSTABLE
as of version 2.5.- Specified by:
getQueryPlanChildren
in interfaceQueryPlan<FDBQueriedRecord<Message>>
- Returns:
- the child plans of this plan
-
getAvailableFields
@Nonnull AvailableFields getAvailableFields()
-
accept
@Nonnull default RecordQueryPlan accept(@Nonnull RecordQueryPlannerSubstitutionVisitor visitor)
-
structuralHashCode
@API(EXPERIMENTAL) default int structuralHashCode()
Return a hash code for this plan which is defined based on the structural layout of a plan. This differs from the semantic hash code defined inRelationalExpression
. For instance this method would not necessarily return the same hash code for a unionUNION(p1, p2)
of two sub-plansp1
andp2
and it's reversedUNION(p2, p1)
. In contrast to that the semantic hash of these two plans is the same.- Returns:
- a hash code for this objects that is defined on the structural layout of the plan
-
structuralEquals
@API(EXPERIMENTAL) default boolean structuralEquals(@Nullable Object other)
Overloaded method to determine structural equality between two different plans using an emptyAliasMap
.- Parameters:
other
- object to compare this object with- Returns:
true
ifthis
is structurally equal toother
,false
otherwise
-
structuralEquals
@API(EXPERIMENTAL) default boolean structuralEquals(@Nullable Object other, @Nonnull AliasMap equivalenceMap)
Determine if two plans are structurally equal. This differs from the semantic equality defined inRelationalExpression
. For instance this method would return false for two given plansUNION(p1, p2)
andUNION(p2, p1)
of two different sub-plansp1
andp2
. In contrast to that these plans are considered semantically equal.- Parameters:
other
- object to compare this object withequivalenceMap
- alias map to indicate aliases that should be considered as equal whenother
is compared tothis
. For instanceq1.x = 1
is only structurally equal withq2.x = 1
if there is a mappingq1 -> q2
in the alias map passed in- Returns:
true
ifthis
is structurally equal toother
,false
otherwise
-
-