public class ASTFilterNormalizationOptimizer extends AbstractJoinGroupOptimizer
The ASTFilterNormalizationOptimizer
is responsible for the static decomposition
and optimization of filter expressions. In it's first version, it decomposes
conjunctive FILTER expressions, enabling (i) a more precise placement of
filter expressions in join groups and (ii) clears the way for static
binding analysis through the ASTStaticBindingsOptimizer
.
Further, it removes duplicate filters (inside the identical join group), also if such duplicates might pop up through conversion to CNF and eliminates certain redundant FILTER expressions based on heuristics.
Note that this optimizer disregards filter placement issues; these should be tackled by optimizers running later in the pipeline.
Possible extensions: (i) there are much more patterns for checking for trivially satisfied filters (however I'm not sure it's worth to put upfront effort in this here); (ii) we may want to check for filters that are trivially not satisfied and void the whole join group if one detected.
Constructor and Description |
---|
ASTFilterNormalizationOptimizer() |
Modifier and Type | Method and Description |
---|---|
List<FilterNode> |
constructFiltersForValueExpressionNode(IValueExpressionNode vexp,
List<FilterNode> filters)
Construct FILTERs for the given value expression node, exploiting
AND nodes at the top to split the node into multiple filters (if
possible).
|
boolean |
isDecomposable(IValueExpressionNode vexpr)
Checks if there might be potential for decomposing the filter
(overestimation).
|
protected void |
normalizeAndDecomposeFilters(AST2BOpContext ctx,
StaticAnalysis sa,
IBindingSet[] bSets,
JoinGroupNode group)
Bring all FILTERs into CNF and split them at top-level to contain
simpler FILTER expressions.
|
protected void |
optimizeJoinGroup(AST2BOpContext ctx,
StaticAnalysis sa,
IBindingSet[] bSets,
JoinGroupNode group)
Subclasses can do the work of optimizing a join group here.
|
protected void |
removeDuplicatesAndTautologies(AST2BOpContext ctx,
StaticAnalysis sa,
IBindingSet[] bSets,
JoinGroupNode group)
Remove duplicate FILTERs and tautologies
|
optimize
protected void optimizeJoinGroup(AST2BOpContext ctx, StaticAnalysis sa, IBindingSet[] bSets, JoinGroupNode group)
AbstractJoinGroupOptimizer
optimizeJoinGroup
in class AbstractJoinGroupOptimizer
protected void normalizeAndDecomposeFilters(AST2BOpContext ctx, StaticAnalysis sa, IBindingSet[] bSets, JoinGroupNode group)
protected void removeDuplicatesAndTautologies(AST2BOpContext ctx, StaticAnalysis sa, IBindingSet[] bSets, JoinGroupNode group)
public boolean isDecomposable(IValueExpressionNode vexpr)
filterNode
- public List<FilterNode> constructFiltersForValueExpressionNode(IValueExpressionNode vexp, List<FilterNode> filters)
ValueExpressionNode
in CNF as input.vexpNode
- the value expression nodefilters
- set where to collect filters inCopyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.