To practice on these problems, ask 🤖 to generate some random queries for you.
Make sure you know how to draw the predicate graph of a query:
R.blah = S.blah in the
WHERE clause, add an edge between R and
SMake sure you know how to check if two join queries are equivalent:
R.x table-attribute pair in the
query, create a group containing just that pairR.x = S.y, merge the group of
R.x with that of S.yMake sure you know how to draw the complete predicate graph of a query:
R.x, S.y within the same group,
add an edge R, S in the graphMake sure you know how to check if a given query is acyclic:
Make sure you know how to draw the hypergraph representing a query.
Make sure you know how to test acyclicity of the hypergraph by ear reduction.
Implement the instance-optimal join algorithm on the example shown in class, and compare its performance with an algorithm using pari-wise hash join.
Challenge: the general algorithm is called TreeTracker Join (TTJ), and works on any acyclic query. Implement the TTJ algorithm from this paper.