@API(value=STABLE) public interface QueryPlanner
RecordQuery
into a RecordQueryPlan
. The common
interface allows tests to be run against several planners.Modifier and Type | Interface and Description |
---|---|
static class |
QueryPlanner.IndexScanPreference
Preference between index scan and record scan.
|
Modifier and Type | Method and Description |
---|---|
RecordQueryPlan |
plan(RecordQuery query)
Create a plan to get the results of the provided query.
|
void |
setIndexScanPreference(QueryPlanner.IndexScanPreference indexScanPreference)
Set whether
RecordQueryIndexPlan is preferred over
RecordQueryScanPlan even when it does not satisfy any
additional conditions. |
@Nonnull RecordQueryPlan plan(@Nonnull RecordQuery query)
query
- a query for records on this planner's metadataRecordCoreException
- if the planner cannot plan the queryvoid setIndexScanPreference(@Nonnull QueryPlanner.IndexScanPreference indexScanPreference)
RecordQueryIndexPlan
is preferred over
RecordQueryScanPlan
even when it does not satisfy any
additional conditions.
Scanning without an index is more efficient, but will have to skip over unrelated record types.
For that reason, it is safer to use an index, except when there is only one record type.
If the meta-data has more than one record type but the record store does not, this can be overridden.indexScanPreference
- whether to prefer index scan over record scan