We study the problem of computing the join of n relations in multiple rounds of MapReduce. We introduce a distributed and generalized version of Yannakakis's algorithm, called GYM. GYM takes as input any generalized hypertree decomposition (GHD) of a query of width w and depth d, and computes the query in O(d) rounds and O(n(IN w + OUT)) communication and computation cost. Using GYM we achieve two main results: (1) Every widthw query can be computed in O(n) rounds of MapReduce with O(n(IN w + OUT)) cost; (2) Every width-w query can be computed in O(log(n)) rounds of MapReduce with O(n(IN 3w +OUT)) cost. We achieve our second result by showing how to construct a O(log(n))-depth and width-3w GHD of a query of width w. We describe another general technique to construct even shorter depth GHDs with longer widths, effectively showing a spectrum of tradeoffs one can make between communication and computation and the number of rounds of MapReduce. By simulating MapReduce in the PRAM model, our second main result also implies the result of Gottlob et al. [12] that computing acyclic and constantwidth queries are in NC. In fact, for certain queries, our approach yields significantly fewer PRAM steps than does the construction of the latter paper. However, we achieve our results using only Yannakakis's algorithm, which has been perceived to have a sequential nature. Instead, we surprisingly show that Yannakakis's algorithm can be parallelized significantly by giving it as input short-depth GHDs of queries.
The GYM REF algorithm shows that allowing log(n) rounds of MapReduce instead of just one round can significantly reduce cost.
GYM: A Multiround Join Algorithm In MapReduce
ArXiv
ArXiv
Computer Science