Package elki.database.query
Interface QueryOptimizer
-
- All Known Implementing Classes:
DisableQueryOptimizer
,EmpiricalQueryOptimizer
public interface QueryOptimizer
Interface to automatically add indexes to a database when no suitable indexes have been found. The dummy implementationDisableQueryOptimizer
can be used to disable this functionality, for example for benchmarking purposes.- Since:
- 0.8.0
- Author:
- Erich Schubert
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default <O> DistanceQuery<O>
getDistanceQuery(Relation<? extends O> relation, Distance<? super O> distanceFunction, int flags)
Optimize a distance query for this relation.default <O> SimilarityQuery<O>
getSimilarityQuery(Relation<? extends O> relation, Similarity<? super O> similarityFunction, int flags)
Optimize a similarity query for this relation.default <O> KNNSearcher<DBIDRef>
kNNByDBID(Relation<? extends O> relation, DistanceQuery<O> distanceQuery, int maxk, int flags)
Optimize a kNN query for this relation.default <O> KNNSearcher<O>
kNNByObject(Relation<? extends O> relation, DistanceQuery<O> distanceQuery, int maxk, int flags)
Optimize a kNN query for this relation.default <O> PrioritySearcher<DBIDRef>
priorityByDBID(Relation<? extends O> relation, DistanceQuery<O> distanceQuery, double maxrange, int flags)
Optimize a distance priority search for this relation.default <O> PrioritySearcher<O>
priorityByObject(Relation<? extends O> relation, DistanceQuery<O> distanceQuery, double maxrange, int flags)
Optimize a distance priority search for this relation.default <O> RangeSearcher<DBIDRef>
rangeByDBID(Relation<? extends O> relation, DistanceQuery<O> distanceQuery, double maxrange, int flags)
Optimize a range query for this relation.default <O> RangeSearcher<O>
rangeByObject(Relation<? extends O> relation, DistanceQuery<O> distanceQuery, double maxrange, int flags)
Optimize a range query for this relation.default <O> RKNNSearcher<DBIDRef>
rkNNByDBID(Relation<? extends O> relation, DistanceQuery<O> distanceQuery, int maxk, int flags)
Optimize a reverse nearest neighbors query for this relation.default <O> RKNNSearcher<O>
rkNNByObject(Relation<? extends O> relation, DistanceQuery<O> distanceQuery, int maxk, int flags)
Optimize a reverse nearest neighbors query for this relation.default <O> RangeSearcher<DBIDRef>
similarityRangeByDBID(Relation<? extends O> relation, SimilarityQuery<O> simQuery, double maxrange, int flags)
Optimize a range query for this relation.default <O> RangeSearcher<O>
similarityRangeByObject(Relation<? extends O> relation, SimilarityQuery<O> simQuery, double maxrange, int flags)
Optimize a range query for this relation.
-
-
-
Method Detail
-
getSimilarityQuery
default <O> SimilarityQuery<O> getSimilarityQuery(Relation<? extends O> relation, Similarity<? super O> similarityFunction, int flags)
Optimize a similarity query for this relation.- Type Parameters:
O
- Object type- Parameters:
relation
- Data relationsimilarityFunction
- Similarity functionflags
- Optimizer flags- Returns:
- optimized query, if possible
-
getDistanceQuery
default <O> DistanceQuery<O> getDistanceQuery(Relation<? extends O> relation, Distance<? super O> distanceFunction, int flags)
Optimize a distance query for this relation.- Type Parameters:
O
- Object type- Parameters:
relation
- Data relationdistanceFunction
- Distance functionflags
- Optimizer flags- Returns:
- optimized query, if possible
-
kNNByObject
default <O> KNNSearcher<O> kNNByObject(Relation<? extends O> relation, DistanceQuery<O> distanceQuery, int maxk, int flags)
Optimize a kNN query for this relation.- Type Parameters:
O
- Object type- Parameters:
relation
- Data relationdistanceQuery
- distance querymaxk
- Maximum kflags
- Optimizer flags- Returns:
- optimized query, if possible
-
kNNByDBID
default <O> KNNSearcher<DBIDRef> kNNByDBID(Relation<? extends O> relation, DistanceQuery<O> distanceQuery, int maxk, int flags)
Optimize a kNN query for this relation.- Type Parameters:
O
- Object type- Parameters:
relation
- Data relationdistanceQuery
- distance querymaxk
- Maximum kflags
- Optimizer flags- Returns:
- optimized query, if possible
-
rangeByObject
default <O> RangeSearcher<O> rangeByObject(Relation<? extends O> relation, DistanceQuery<O> distanceQuery, double maxrange, int flags)
Optimize a range query for this relation.- Type Parameters:
O
- Object type- Parameters:
relation
- Data relationdistanceQuery
- distance querymaxrange
- Maximum rangeflags
- Optimizer flags- Returns:
- optimized query, if possible
-
rangeByDBID
default <O> RangeSearcher<DBIDRef> rangeByDBID(Relation<? extends O> relation, DistanceQuery<O> distanceQuery, double maxrange, int flags)
Optimize a range query for this relation.- Type Parameters:
O
- Object type- Parameters:
relation
- Data relationdistanceQuery
- distance querymaxrange
- Maximum rangeflags
- Optimizer flags- Returns:
- optimized query, if possible
-
similarityRangeByObject
default <O> RangeSearcher<O> similarityRangeByObject(Relation<? extends O> relation, SimilarityQuery<O> simQuery, double maxrange, int flags)
Optimize a range query for this relation.- Type Parameters:
O
- Object type- Parameters:
relation
- Data relationsimQuery
- similarity querymaxrange
- Maximum rangeflags
- Optimizer flags- Returns:
- optimized query, if possible
-
similarityRangeByDBID
default <O> RangeSearcher<DBIDRef> similarityRangeByDBID(Relation<? extends O> relation, SimilarityQuery<O> simQuery, double maxrange, int flags)
Optimize a range query for this relation.- Type Parameters:
O
- Object type- Parameters:
relation
- Data relationsimQuery
- similarity querymaxrange
- Maximum rangeflags
- Optimizer flags- Returns:
- optimized query, if possible
-
rkNNByObject
default <O> RKNNSearcher<O> rkNNByObject(Relation<? extends O> relation, DistanceQuery<O> distanceQuery, int maxk, int flags)
Optimize a reverse nearest neighbors query for this relation.- Type Parameters:
O
- Object type- Parameters:
relation
- Data relationdistanceQuery
- distance queryflags
- Optimizer flagsmaxk
- Maximum k to query- Returns:
- optimized query, if possible
-
rkNNByDBID
default <O> RKNNSearcher<DBIDRef> rkNNByDBID(Relation<? extends O> relation, DistanceQuery<O> distanceQuery, int maxk, int flags)
Optimize a reverse nearest neighbors query for this relation.- Type Parameters:
O
- Object type- Parameters:
relation
- Data relationdistanceQuery
- distance queryflags
- Optimizer flagsmaxk
- Maximum k to query- Returns:
- optimized query, if possible
-
priorityByObject
default <O> PrioritySearcher<O> priorityByObject(Relation<? extends O> relation, DistanceQuery<O> distanceQuery, double maxrange, int flags)
Optimize a distance priority search for this relation.- Type Parameters:
O
- Object type- Parameters:
relation
- Data relationdistanceQuery
- distance querymaxrange
- Maximum rangeflags
- Optimizer flags- Returns:
- optimized query, if possible
-
priorityByDBID
default <O> PrioritySearcher<DBIDRef> priorityByDBID(Relation<? extends O> relation, DistanceQuery<O> distanceQuery, double maxrange, int flags)
Optimize a distance priority search for this relation.- Type Parameters:
O
- Object type- Parameters:
relation
- Data relationdistanceQuery
- distance querymaxrange
- Maximum rangeflags
- Optimizer flags- Returns:
- optimized query, if possible
-
-