public class AggregateIndex extends java.lang.Object implements QueryIndex.AdvanceFulltextQueryIndex
QueryIndex.AdvancedQueryIndex, QueryIndex.AdvanceFulltextQueryIndex, QueryIndex.FulltextQueryIndex, QueryIndex.IndexPlan, QueryIndex.NativeQueryIndex, QueryIndex.NodeAggregator, QueryIndex.OrderEntry
Constructor and Description |
---|
AggregateIndex(QueryIndex.AdvanceFulltextQueryIndex baseIndex) |
Modifier and Type | Method and Description |
---|---|
double |
getCost(Filter filter,
NodeState rootState)
Estimate the worst-case cost to query with the given filter.
|
java.lang.String |
getIndexName()
Get the generic index name (normally the index type).
|
double |
getMinimumCost()
Returns the minimum cost which
QueryIndex.getCost(Filter, NodeState) would return in the best possible case. |
QueryIndex.NodeAggregator |
getNodeAggregator()
Returns the NodeAggregator responsible for providing the aggregation
settings or null if aggregation is not available/desired.
|
java.lang.String |
getPlan(Filter filter,
NodeState rootState)
Get the query plan for the given filter.
|
java.lang.String |
getPlanDescription(QueryIndex.IndexPlan plan,
NodeState root)
Get the query plan description (for logging purposes).
|
java.util.List<QueryIndex.IndexPlan> |
getPlans(Filter filter,
java.util.List<QueryIndex.OrderEntry> sortOrder,
NodeState rootState)
Return the possible index plans for the given filter and sort order.
|
Cursor |
query(Filter filter,
NodeState rootState)
Query the index.
|
Cursor |
query(QueryIndex.IndexPlan plan,
NodeState rootState)
Start a query.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getIndexName
public AggregateIndex(QueryIndex.AdvanceFulltextQueryIndex baseIndex)
public double getMinimumCost()
QueryIndex
QueryIndex.getCost(Filter, NodeState)
would return in the best possible case.
The implementation should return a static/cached value because it is called very often.
getMinimumCost
in interface QueryIndex
public double getCost(Filter filter, NodeState rootState)
QueryIndex
The returned value is supposed to be an estimate and doesn't have to be very accurate. Please note this method is called on each index whenever a query is run, so the method should be reasonably fast (not read any data itself, or at least not read too much data).
If an index implementation can not query the data, it has to return
Double.MAX_VALUE
.
getCost
in interface QueryIndex
filter
- the filterrootState
- root state of the current repository snapshotpublic Cursor query(Filter filter, NodeState rootState)
QueryIndex
An implementation should only filter the result if it can do so easily and efficiently; the query engine will verify the data again (in memory) and check for access rights.
The method is only called if this index is used for the given query and
selector, which is only the case if the given index implementation
returned the lowest cost for the given filter. If the implementation
returned Double.MAX_VALUE
in the getCost method for the given
filter, then this method is not called. If it is still called, then it is
supposed to throw an exception (as it would be an internal error of the
query engine).
query
in interface QueryIndex
filter
- the filterrootState
- root state of the current repository snapshotpublic java.util.List<QueryIndex.IndexPlan> getPlans(Filter filter, java.util.List<QueryIndex.OrderEntry> sortOrder, NodeState rootState)
QueryIndex.AdvancedQueryIndex
getPlans
in interface QueryIndex.AdvancedQueryIndex
filter
- the filtersortOrder
- the sort order or null if no sorting is requiredrootState
- root state of the current repository snapshotpublic Cursor query(QueryIndex.IndexPlan plan, NodeState rootState)
QueryIndex.AdvancedQueryIndex
The index plan is one of the plans that the index returned in the getPlans call.
query
in interface QueryIndex.AdvancedQueryIndex
plan
- the index plan to userootState
- root state of the current repository snapshotpublic java.lang.String getPlan(Filter filter, NodeState rootState)
QueryIndex
EXPLAIN SELECT
query, or for logging purposes. The
result should be human readable.getPlan
in interface QueryIndex
filter
- the filterrootState
- root state of the current repository snapshotpublic java.lang.String getPlanDescription(QueryIndex.IndexPlan plan, NodeState root)
QueryIndex.AdvancedQueryIndex
The index plan is one of the plans that the index returned in the getPlans call.
getPlanDescription
in interface QueryIndex.AdvancedQueryIndex
plan
- the index planroot
- root state of the current repository snapshotpublic java.lang.String getIndexName()
QueryIndex
getIndexName
in interface QueryIndex
public QueryIndex.NodeAggregator getNodeAggregator()
QueryIndex.FulltextQueryIndex
getNodeAggregator
in interface QueryIndex.FulltextQueryIndex
Copyright © 2010 - 2020 Adobe. All Rights Reserved