Class MergeRequests
java.lang.Object
se.liu.ida.hefquin.engine.queryproc.impl.loptimizer.heuristics.MergeRequests
- All Implemented Interfaces:
HeuristicForLogicalOptimization
Merges subplans that consists of multiple requests to the same federation
member if such a merge is possible.
In particular, a join over two requests is merged into a single request
operator if i) the two requests are triple pattern requests (which can be
merged into a BGP request and the federation member supports BGP requests,
or ii) one of the two requests is a BGP request and the other one also a
BGP request or a triple pattern request.
Another possibility for merging is a join over two arbitrary SPARQL pattern
requests for a SPARQL endpoint. For SPARQL endpoints, this heuristic even
tries to push other operators into requests (filters, unions, optional).
The aforementioned join-related merge is performed not only for binary join
operators but also for gpAdd operators over request operators, as well as
for pairs of requests under a multi-join. In the latter case, the multi-join
operator is replaced by the merged request operator only if there are no other
subplans under that multi-join operator.
The merging is applied recursively in a bottom-up fashion, which means that,
after performing one merge step, another one may become available and will be
done.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(LogicalPlan inputPlan) Applies this heuristics to the given plan and returns the resulting, potentially rewritten plan.protected LogicalPlanprotected SPARQLGraphPatternmergePatternWithOptPatterns(SPARQLGraphPattern pattern, SPARQLGraphPattern... optPatterns) protected LogicalPlanmergeSPARQLRequestsViaJoin(FederationMember fm, List<LogicalPlan> reqPlans) Assumes that the given list contains at least two plans and that all plans in the list consist only of a request operator.protected SPARQLGraphPatternmergeSPARQLRequestsViaUnion(List<LogicalPlan> reqPlans) Assumes that the given list contains at least two plans and that all plans in the list consist only of a request operator.protected voidseparateSubPlansOfMultiwayOps(List<LogicalPlan> subPlans, Map<FederationMember, List<LogicalPlan>> reqOnlyPlansPerFedMember, List<LogicalPlan> nonReqSubPlans)
-
Constructor Details
-
MergeRequests
public MergeRequests()
-
-
Method Details
-
apply
Description copied from interface:HeuristicForLogicalOptimizationApplies this heuristics to the given plan and returns the resulting, potentially rewritten plan.- Specified by:
applyin interfaceHeuristicForLogicalOptimization
-
mergeSPARQLRequestsViaUnion
Assumes that the given list contains at least two plans and that all plans in the list consist only of a request operator. -
mergeSPARQLRequestsViaJoin
Assumes that the given list contains at least two plans and that all plans in the list consist only of a request operator. Returnsnullif the given federation member does not support the merged pattern. -
mergePatternWithOptPatterns
protected SPARQLGraphPattern mergePatternWithOptPatterns(SPARQLGraphPattern pattern, SPARQLGraphPattern... optPatterns) -
createPlanWithSingleRequestOp
-
separateSubPlansOfMultiwayOps
protected void separateSubPlansOfMultiwayOps(List<LogicalPlan> subPlans, Map<FederationMember, List<LogicalPlan>> reqOnlyPlansPerFedMember, List<LogicalPlan> nonReqSubPlans)
-