public class FlattenUnionOptimizer extends NodeCentricDepthFirstOptimizer<FlattenUnionProposal>
The algorithm searches the query q depth-first. If a UnionNode u1 is encountered, it proceeds as follows: .Retrieve the set U composed of u1, all children UnionNodes of u1, all children UnionNodes of these, etc. (recursively). .Retrieve the set C of all child subtrees of some node in U. .Within C, retain the set C' of subtrees whose root is not a UnionNode. .Build the subtree s, whose root is a union node projecting the same variables as u1, and such that the children subtrees of s are the subtrees in C'. .In q, replace the subtree rooted in u1 by s. .Continue the depth-first search
Assumption: the input query is well-formed wrt projections.
| Constructor and Description |
|---|
FlattenUnionOptimizer() |
| Modifier and Type | Method and Description |
|---|---|
protected Optional<FlattenUnionProposal> |
evaluateNode(QueryNode node,
IntermediateQuery query) |
IntermediateQuery |
optimize(IntermediateQuery query)
TODO: explain
|
optimizeQuerypublic IntermediateQuery optimize(IntermediateQuery query) throws EmptyQueryException
IntermediateQueryOptimizeroptimize in interface IntermediateQueryOptimizeroptimize in class NodeCentricDepthFirstOptimizer<FlattenUnionProposal>EmptyQueryExceptionprotected Optional<FlattenUnionProposal> evaluateNode(QueryNode node, IntermediateQuery query)
evaluateNode in class NodeCentricDepthFirstOptimizer<FlattenUnionProposal>Copyright © 2009–2020 Free University of Bozen-Bolzano. All rights reserved.