T
- the type of element produced by executing this plan@API(value=EXPERIMENTAL) public interface QueryPlan<T> extends PlanHashable, RelationalPlannerExpression
RecordQueryPlan
(which extends this interface), implementations are not required to
return records but might instead return items of an arbitrary type. Note that
QueryPlanner
s always return RecordQueryPlan
s,
but the query plan tree might contain intermediate plans that return something other than records.Modifier and Type | Method and Description |
---|---|
default RecordCursor<T> |
execute(FDBRecordStore store)
Execute this query plan.
|
default RecordCursor<T> |
execute(FDBRecordStore store,
EvaluationContext context)
Execute this query plan.
|
RecordCursor<T> |
execute(FDBRecordStore store,
EvaluationContext context,
byte[] continuation,
ExecuteProperties executeProperties)
Execute this query plan.
|
int |
getComplexity()
Returns an integer representing the "complexity" of the generated plan.
|
List<? extends QueryPlan<?>> |
getQueryPlanChildren()
Returns the (zero or more) child
QueryPlan s of this plan. |
Set<String> |
getUsedIndexes()
Returns a set of names of the indexes used by this plan (and its sub-plans).
|
boolean |
hasFullRecordScan()
Indicates whether this plan (or one of its components) must perform a scan over all records in the store directly
rather than going through a secondary index.
|
boolean |
hasIndexScan(String indexName)
Indicates whether this plan scans the given index.
|
boolean |
hasRecordScan()
Indicates whether this plan (or one of its components) scans at least a subset of the record range directly
rather than going through a secondary index.
|
boolean |
isReverse()
Indicates whether this plan will return values in "reverse" order from the
natural order of results of this plan.
|
void |
logPlanStructure(StoreTimer timer)
Adds one to an appropriate
StoreTimer counter for each plan and subplan of this plan, allowing tracking
of which plans are being chosen (e.g. |
iterablePlanHash, objectPlanHash, objectsPlanHash, planHash, planHash, planHash
fromRecordQuery
acceptPropertyVisitor, bindTo, getPlannerExpressionChildren
@Nonnull RecordCursor<T> execute(@Nonnull FDBRecordStore store, @Nonnull EvaluationContext context, @Nullable byte[] continuation, @Nonnull ExecuteProperties executeProperties)
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@Nonnull default RecordCursor<T> execute(@Nonnull FDBRecordStore store)
store
- record store from which to fetch items@Nonnull default RecordCursor<T> execute(@Nonnull FDBRecordStore store, @Nonnull EvaluationContext context)
store
- record store to accesscontext
- evaluation context containing parameter bindingsboolean isReverse()
true
if the plan
returns elements in descending order and false
if the elements are
returned in ascending order.true
if this plan returns elements in reverse orderboolean hasRecordScan()
true
if this plan (or one of its components) scans at least a subset of the records directlyboolean hasFullRecordScan()
hasRecordScan
for the comparison between two methods.true
if this plan (or one of its components) must perform a scan over all records in the
store directlyboolean hasIndexScan(@Nonnull String indexName)
indexName
- the name of the index to check fortrue
if this plan (or one of its children) scans the given index@Nonnull Set<String> getUsedIndexes()
void logPlanStructure(StoreTimer timer)
StoreTimer
counter for each plan and subplan of this plan, allowing tracking
of which plans are being chosen (e.g. index scan vs. full scan).timer
- the counters to incrementint getComplexity()
List<? extends QueryPlan<?>> getQueryPlanChildren()
QueryPlan
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 to RecordQueryPlan.getChildren()
. That method
has been marked API.Status#UNSTABLE
as of version 2.5.