@Deprecated public class ASTComplexOptionalOptimizer extends Object implements IASTOptimizer
DefaultOptimizerList
. The description below describes the original
idea, the actual implementation slightly differs in (i) that it passes around
intermediate solutions (rather than computing all joins over the original
outer mapping set) and (ii) does not compute a final join over all
intermediate solutions but simply returns the last computed result (which
is now possible due to (i)).
Also note that the AST2BOpUtility
has been refactored (as part of
ticket #1071 and #1118) and now implements intelligent pushing of projection
variables into OPTIONAL blocks, so there's probably no more need for this
optimizer.
Rewrite a join group using two or more complex OPTIONAL groups using a hash
join pattern.
Note: this optimization is not required if there is only one complex optional in the join group. It is only when there are multiple complex optional groups that we need to lift those groups out as named subqueries (since they need to feed each other). If there is only one complex optional group, then we can run it as a sub-group instead.
NOte: This optimization presumes that simple optional groups were already
translated into optional StatementPatternNode
s.
Queries with multiple complex optional groups can be rewritten into the hash join of solution sets as follows.
ASTNamedSubqueryOptimizer
already handles the assignment of join
variables, so we do not need to consider it further here.{INCLUDE %set . OPTIONAL {...}}
INCLUDE %set1 . INCLUDE %set2 JOIN ON (?var1, ?var2) .Note: The join variables for those INCLUDEs MUST be identified through static analysis. Failure to use available join variables will result in an extremely inefficient query plan as the full cross product of the solutions will be compared to identify solutions which join.
https://sourceforge.net/apps/trac/bigdata/ticket/397
Constructor and Description |
---|
ASTComplexOptionalOptimizer()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
QueryNodeWithBindingSet |
optimize(AST2BOpContext context,
QueryNodeWithBindingSet input)
Deprecated.
Optimize the AST.
|
public QueryNodeWithBindingSet optimize(AST2BOpContext context, QueryNodeWithBindingSet input)
IASTOptimizer
optimize
in interface IASTOptimizer
context
- The evaluation context.input
- The input to the optimizer, consisting of a queryNode and
input binding set.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.