java.lang.Object
se.liu.ida.hefquin.engine.queryproc.impl.loptimizer.heuristics.MergeRequests
All Implemented Interfaces:
HeuristicForLogicalOptimization

public class MergeRequests extends Object implements 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 tpAdd/bgpAdd 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.