public class JoinOptimizer extends Object
Removes unnecessary joins from a TripleRelation in cases
where this is possible without affecting the result. This is an
optimization.
A join J from table T1 to table T2 with join condition T1.c_1 = T2.c_1 && T1.c_2 = T2.c_2 && ... can be removed if these conditions hold:
In this case, J can be dropped, and all mentions of T2.c_n can be replaced with T1.c_n.
TODO: Currently this only is used for TripleRelations in FindQuery but it could be used for NodeRelations in SPARQL queries too TODO: Prune unnecessary aliases after removing joins| Constructor and Description |
|---|
JoinOptimizer(TripleRelation relation)
Constructs a new JoinOptimizer.
|
public JoinOptimizer(TripleRelation relation)
relation - The TripleRelation to be optimizedpublic TripleRelation optimize()