Class OrderByDistinctOptimiser
An optimizer that handles a special case for ORDER BY + DISTINCT combinations which can significantly improve performance by eliminating duplicates prior to sorting when the default SPARQL behaviour is to do a potentially costly sort over many duplicates and then eliminate distincts.
Inheritance
Implements
Inherited Members
Namespace: VDS.RDF.Query.Optimisation
Assembly: dotNetRdf.dll
Syntax
public class OrderByDistinctOptimiser : IAlgebraOptimiser
Remarks
Only applies to queries which meet the following criteria:.
- Has an ORDER BY and a DISTNCT on the same level of the query
- Selects a fixed list of variables i.e. not a SELECT DISTINCT *
- All variables used in the ORDER BY expressions also occur in the project list
Properties
| Improve this Doc View SourceUnsafeOptimisation
Determines whether an Optimiser will perform algebra optimizations that are potentially unsafe at execution time.
Declaration
public bool UnsafeOptimisation { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Only applies to queries which meet the following criteria:.
- Has an ORDER BY and a DISTNCT on the same level of the query
- Selects a fixed list of variables i.e. not a SELECT DISTINCT *
- All variables used in the ORDER BY expressions also occur in the project list
Methods
| Improve this Doc View SourceIsApplicable(SparqlQuery)
Returns true if the query is a SELECT DISTINCT or SELECT REDUCED and has an ORDER BY.
Declaration
public bool IsApplicable(SparqlQuery q)
Parameters
Type | Name | Description |
---|---|---|
SparqlQuery | q | Query. |
Returns
Type | Description |
---|---|
System.Boolean |
Remarks
Only applies to queries which meet the following criteria:.
- Has an ORDER BY and a DISTNCT on the same level of the query
- Selects a fixed list of variables i.e. not a SELECT DISTINCT *
- All variables used in the ORDER BY expressions also occur in the project list
IsApplicable(SparqlUpdateCommandSet)
Returns that this is not applicable to updates.
Declaration
public bool IsApplicable(SparqlUpdateCommandSet cmds)
Parameters
Type | Name | Description |
---|---|---|
SparqlUpdateCommandSet | cmds | Update commands. |
Returns
Type | Description |
---|---|
System.Boolean |
Remarks
Only applies to queries which meet the following criteria:.
- Has an ORDER BY and a DISTNCT on the same level of the query
- Selects a fixed list of variables i.e. not a SELECT DISTINCT *
- All variables used in the ORDER BY expressions also occur in the project list
Optimise(ISparqlAlgebra)
Optimizes the given algebra.
Declaration
public ISparqlAlgebra Optimise(ISparqlAlgebra algebra)
Parameters
Type | Name | Description |
---|---|---|
ISparqlAlgebra | algebra | Algebra. |
Returns
Type | Description |
---|---|
ISparqlAlgebra | Optimized algebra. |
Remarks
Only applies to queries which meet the following criteria:.
- Has an ORDER BY and a DISTNCT on the same level of the query
- Selects a fixed list of variables i.e. not a SELECT DISTINCT *
- All variables used in the ORDER BY expressions also occur in the project list