Class JoinAnalyzer
java.lang.Object
se.liu.ida.hefquin.engine.queryproc.impl.loptimizer.heuristics.utils.JoinAnalyzer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcountDuplicates(List<org.apache.jena.graph.Node> vars) Sum the number of duplicates for each variable e.g., if the input contains three ?static intstatic intcountNumOfChainJoins(QueryAnalyzer plan_l, QueryAnalyzer plan_r) static intcountNumOfJoinPairs(List<org.apache.jena.graph.Node> vars_a, List<org.apache.jena.graph.Node> vars_b) For each occurrence of a variable in the second list, check whether there exists a matching partner (the same variable) in the first list.static intstatic intcountNumOfJoinsWithSameObj(QueryAnalyzer plan_l, QueryAnalyzer plan_r) static intCount number of different types of joins for a given plan; - s-s joins: subject-subject - o-o joins: object-object joins - chain joins: object-subject and subject-object joins - unusual joins: subject-predicate, predicate-object, predicate-predicate joinsstatic intcountNumOfJoinsWithSameSub(QueryAnalyzer plan_l, QueryAnalyzer plan_r) Count number of different types of joins between two given sub-plansstatic intstatic intcountNumOfUnusualJoins(QueryAnalyzer plan_l, QueryAnalyzer plan_r)
-
Constructor Details
-
JoinAnalyzer
public JoinAnalyzer()
-
-
Method Details
-
countNumOfJoinsWithSameSub
Count number of different types of joins for a given plan; - s-s joins: subject-subject - o-o joins: object-object joins - chain joins: object-subject and subject-object joins - unusual joins: subject-predicate, predicate-object, predicate-predicate joins -
countNumOfJoinsWithSameObj
-
countNumOfChainJoins
-
countNumOfUnusualJoins
-
countNumOfJoinsWithSameSub
Count number of different types of joins between two given sub-plans -
countNumOfJoinsWithSameObj
-
countNumOfChainJoins
-
countNumOfUnusualJoins
-
countDuplicates
Sum the number of duplicates for each variable e.g., if the input contains three ?s variable, the number of duplicates is 2 -
countNumOfJoinPairs
public static int countNumOfJoinPairs(List<org.apache.jena.graph.Node> vars_a, List<org.apache.jena.graph.Node> vars_b) For each occurrence of a variable in the second list, check whether there exists a matching partner (the same variable) in the first list. If exists, increase the "numOfJoinPairs" by 1, and remove the matched variable (instance) from the first list. Otherwise, move to the next variable. Repeat this process until all occurrences of variables in the second list have been checked. Note: If a variable occurs multiple times, each occurrence is counted in join pairs only once.
-