com.hp.hpl.jena.sparql.algebra.optimize
Class TransformDistinctToReduced

java.lang.Object
  extended by com.hp.hpl.jena.sparql.algebra.TransformCopy
      extended by com.hp.hpl.jena.sparql.algebra.optimize.TransformDistinctToReduced
All Implemented Interfaces:
Transform

public class TransformDistinctToReduced
extends TransformCopy

Transforms generic DISTINCT plus ORDER BY combinations to REDUCED plus ORDER BY which typically gives better performance and memory consumption because engines have to keep less data in-memory to evaluate it.

As with most optimizations this is only applied when it is safe to do so. The criteria for being safe to do so are as follows:

Related Optimizations

See also TransformOrderByDistinctApplication which is a better optimization for these kinds of queries but only applies to a more limited range of queries. Where possible that optimization is applied in preference to this one.

TransformTopN covers the case of DISTINCT plus ORDER BY where there is also a LIMIT. Where possible that optimization is applied in preference to either this or TransformOrderByDistinctApplication.


Field Summary
 
Fields inherited from class com.hp.hpl.jena.sparql.algebra.TransformCopy
COPY_ALWAYS, COPY_ONLY_ON_CHANGE
 
Constructor Summary
TransformDistinctToReduced()
           
 
Method Summary
 Op transform(OpDistinct opDistinct, Op subOp)
           
 Op transform1(OpDistinct opDistinct, Op subOp)
           
 
Methods inherited from class com.hp.hpl.jena.sparql.algebra.TransformCopy
transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransformDistinctToReduced

public TransformDistinctToReduced()
Method Detail

transform1

public Op transform1(OpDistinct opDistinct,
                     Op subOp)

transform

public Op transform(OpDistinct opDistinct,
                    Op subOp)
Specified by:
transform in interface Transform
Overrides:
transform in class TransformCopy


Licenced under the Apache License, Version 2.0