Class BaseQueryOptimiser
A basic abstract implementation of a Query Optimiser.
Implements
Inherited Members
Namespace: VDS.RDF.Query.Optimisation
Assembly: dotNetRdf.dll
Syntax
public abstract class BaseQueryOptimiser : IQueryOptimiser
Remarks
Derived implementations may use override the virtual properties to control what forms of optimisation are used. Derived implementations must override the GetRankingComparer() method, optimisers which do not wish to change the order of Triple Patterns should return the NoReorderCompaper in their implementation as a basic sort of Triple Patterns is done even if ShouldReorder is overridden to return false.
Properties
| Edit this page View SourceShouldPlaceAssignments
Controls whether the Optimiser will place Assignments.
Declaration
protected virtual bool ShouldPlaceAssignments { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
It is recommended that derived classes do not change this setting as this may hurt performance. If you want to control the optimisation process in detail we suggest you implement IQueryOptimiser directly in your own class and not derive from this implementation.
ShouldPlaceFilters
Controls whether the Optimiser will place Filters.
Declaration
protected virtual bool ShouldPlaceFilters { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
It is recommended that derived classes do not change this setting as this may hurt performance. If you want to control the optimisation process in detail we suggest you implement IQueryOptimiser directly in your own class and not derive from this implementation.
ShouldReorder
Controls whether the Optimiser will attempt to reorder Triple Patterns.
Declaration
protected virtual bool ShouldReorder { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
It is recommended that derived classes do not change this setting as this may hurt performance. If you want to control the optimisation process in detail we suggest you implement IQueryOptimiser directly in your own class and not derive from this implementation.
ShouldSplitFilters
Controls whether the Optimiser will split Filters.
Declaration
protected virtual bool ShouldSplitFilters { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
If a Filter contains an and expression it may be split into its constituent parts and applied separately. This option only applies if filter placement also applies.
Defaults to false since it is unclear if this actually benefits performance.
Methods
| Edit this page View SourceGetRankingComparer()
Gets a comparer on Triple Patterns that is used to rank Triple Patterns.
Declaration
protected abstract IComparer<ITriplePattern> GetRankingComparer()
Returns
Type | Description |
---|---|
IComparer<ITriplePattern> |
Remarks
By overriding this in derived classes you can change how the Optimiser weights different patterns and thus the resultant ordering of Triple Patterns.
Optimise(GraphPattern, IEnumerable<string>)
Causes the Graph Pattern to be optimised if it isn't already.
Declaration
public void Optimise(GraphPattern gp, IEnumerable<string> variables)
Parameters
Type | Name | Description |
---|---|---|
GraphPattern | gp | Graph Pattern. |
IEnumerable<string> | variables | Variables that have occurred prior to this Pattern. |