Show / Hide Table of Contents

Class BaseQueryOptimiser

A basic abstract implementation of a Query Optimiser.

Inheritance
System.Object
BaseQueryOptimiser
DefaultOptimiser
NoReorderOptimiser
WeightedOptimiser
Implements
IQueryOptimiser
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
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

| Improve this Doc View Source

ShouldPlaceAssignments

Controls whether the Optimiser will place Assignments.

Declaration
protected virtual bool ShouldPlaceAssignments { get; }
Property Value
Type Description
System.Boolean
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.

| Improve this Doc View Source

ShouldPlaceFilters

Controls whether the Optimiser will place Filters.

Declaration
protected virtual bool ShouldPlaceFilters { get; }
Property Value
Type Description
System.Boolean
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.

| Improve this Doc View Source

ShouldReorder

Controls whether the Optimiser will attempt to reorder Triple Patterns.

Declaration
protected virtual bool ShouldReorder { get; }
Property Value
Type Description
System.Boolean
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.

| Improve this Doc View Source

ShouldSplitFilters

Controls whether the Optimiser will split Filters.

Declaration
protected virtual bool ShouldSplitFilters { get; }
Property Value
Type Description
System.Boolean
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

| Improve this Doc View Source

GetRankingComparer()

Gets a comparer on Triple Patterns that is used to rank Triple Patterns.

Declaration
protected abstract IComparer<ITriplePattern> GetRankingComparer()
Returns
Type Description
System.Collections.Generic.IComparer<T><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.

| Improve this Doc View Source

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.

System.Collections.Generic.IEnumerable<T><string> variables

Variables that have occurred prior to this Pattern.

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.

Implements

IQueryOptimiser

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Improve this Doc
  • View Source
In This Article
  • Properties
    • ShouldPlaceAssignments
    • ShouldPlaceFilters
    • ShouldReorder
    • ShouldSplitFilters
  • Methods
    • GetRankingComparer()
    • Optimise(GraphPattern, IEnumerable<string>)
  • Implements
  • Extension Methods
Back to top Generated by DocFX