public class DefaultOptimizerList extends ASTOptimizerList
optimizerList.add(new BindingAssigner()); // done. optimizerList.add(new ConstantOptimizer(strategy)); optimizerList.add(new CompareOptimizer()); optimizerList.add(new ConjunctiveConstraintSplitter()); optimizerList.add(new SameTermFilterOptimizer()); // only need to optimize the join order this way if we are not // using native joins if (nativeJoins == false) { optimizerList.add(new QueryJoinOptimizer(new BigdataEvaluationStatistics( this))); } optimizerList.add(new FilterOptimizer()); optimizerList.optimize(tupleExpr, dataset, bindings); replaceValues(dataset, tupleExpr, bindings); // yes.FIXME
CompareOptimizer
. Replaces Compare with SameTerm whenever
possible. (I think that we handle this in the FunctionRegistry
, but
that should be verified and documented here.)
FIXME ConjunctiveConstraintSplitter
. Takes a FILTER with an AND of
constraints and replaces it with one filter per left or right hand side of
the AND. This flattens the value expression hierarchy. It also might allow us
to reject some solutions earlier in the pipeline since we do not have to wait
for all of the variables to become bound and we can potentially evaluate some
of the individual constraints earlier than others.
FIXME SameTermFilterOptimizer
. Optimizes SameTerm(X,Y) by renaming
one of the variables to the other variable. Optimizes SameTerm(X,aURI) by
assigning the constant to the variable.
FIXME FilterOptimizer
. Pushes filters as far down in the query model
as possible. (What purpose does this serve for us? We want to attach filters
to the first required join where they can possible by evaluated.)
FIXME Sesame has define a bunch of IQueryOptimizers that we are not using
(even before this refactor). Many of them apply to their SQL backends. A few
might be relevant to us:
DisjunctiveConstraintOptimizer
- moves SameTerm closer to joins
for queries involving UNIONs.IterativeEvaluationOptimizer
- ???QueryModelNormalizer
- various simplifications of their tuple
expression query model. I am not sure whether or not there is anything here
we could leverage.FunctionRegistry
already handles those optimizations for IN).
TODO The combination of DISTINCT and ORDER BY can be optimized using an ORDER
BY in which duplicate solutions are discarded after the sort by a filter
which compares the current solution with the prior solution.
TODO A query with a LIMIT of ZERO (0) should be failed as there will be no
solutions.
TODO Minor optimization: A bare constant in the ORDER BY value expression
list should be dropped. If there are no remaining value expressions, then the
entire ORDER BY operation should be dropped.
FIXME Write AST optimizer which rejects queries that SELECT variables which
do not otherwise appear in the query.
TODO If a child group is non-optional and not a union, then flatten it out
(lift it into the parent). (This sort of thing is not directly expressible in
the SPARQL syntax but it might arise through other AST transforms.)
TODO Optimizer to lift optionals outside of an ORDER BY when the OPTIONALs
are not used by the ORDER BY. This let's us avoid optional joins until we
know what is in the result set.
TODO ORDER BY with LIMIT could be optimized as a pipelined + last pass
operator which maintained a sorted array of LIMIT+OFFSET items. Any items
which order after the LIMIT+OFFSET item in the list are discarded. This will
keep down both the memory overhead of the ORDER BY operator and the #of
comparisons to be made. (We still need a SLICE to handle the OFFSET unless
the ORDER BY operator takes care of that during its last pass by only writing
the items from OFFSET through LIMIT-1.modCount
Constructor and Description |
---|
DefaultOptimizerList() |
Modifier and Type | Method and Description |
---|---|
protected void |
addFastRangeCountOptimizer()
Tries to add the GPU-based
ASTFastRangeCountOptimizer . |
protected void |
addGPUAccelerationOptimizer()
Tries to add the
IASTOptimizer for using GPUs. |
protected void |
addRangeCountOptimizer()
Tries to add the GPU-based
ASTRangeCountOptimizer . |
add, optimize
add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, toArray, toArray
iterator
equals, hashCode, listIterator, removeRange, subList
containsAll, isEmpty, removeAll, retainAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList
protected void addRangeCountOptimizer()
ASTRangeCountOptimizer
. If adding
this optimizer fails, this method adds ASTRangeCountOptimizer
.https://github.com/SYSTAP/bigdata-gpu/issues/23
protected void addFastRangeCountOptimizer()
ASTFastRangeCountOptimizer
. If adding
this optimizer fails, this method adds ASTFastRangeCountOptimizer
.https://github.com/SYSTAP/bigdata-gpu/issues/101
protected void addGPUAccelerationOptimizer()
IASTOptimizer
for using GPUs.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.