Abstract
Multiround algorithms are now commonly used in distributed data processing systems, yet the extent to which algorithms can benefit from running more rounds is not well understood. This paper answers this question for a spectrum of rounds for the problem of computing the equijoin of $n$ relations. Specifically, given any query $Q$ with width $w$, intersection width $iw$, input size $IN$, output size $OUT$, and a cluster of machines with $M$ memory available per machine, we show that: (1) $Q$ can be computed in $O(n)$ rounds with $O(n\frac{(IN^w + OUT)^2}{M})$ communication cost. (2) $Q$ can be computed in $O(\log(n))$ rounds with $O(n\frac{(IN^{\max(w, 3iw)} + OUT)^2}{M})$ communication cost. Intersection width is a new notion of queries and generalized hypertree decompositions (GHDs) of queries we introduce to capture how connected the adjacent cyclic components of the GHDs are. We achieve our first result by introducing a distributed and generalized version of Yannakakis's algorithm, called GYM. GYM takes as input any GHD of $Q$ with width $w$ and depth $d$, and computes $Q$ in $O(d + \log(n))$ rounds and $O(n\frac{(IN^w + OUT)^2}{M})$ communication cost. We achieve our second result by showing how to construct GHDs of $Q$ with width $\max(w, 3iw)$ and depth $O(\log(n))$.
Introduction
In modern distributed data processing, computing the "equijoin" of multiple relations (tables) is a fundamental but expensive operation. For years, the research community focused on "one-round" algorithms—where data is shuffled once and then joined. However, for certain query shapes like long "chains," one-round algorithms face a mathematical wall: they require an astronomical amount of communication to work.
While modern systems like Apache Spark make it easy to run many rounds of computation, there has been a lack of solid theoretical understanding regarding the trade-offs. How many rounds are actually necessary? How does the structure of the query (its "cyclicity" or "width") affect the amount of data moved across the network? This paper introduces the GYM algorithm to provide a formal answer to these questions, breaking the "one-round wall" by leveraging multiple rounds of computation.
Methodology: The GYM Algorithm
The authors introduce GYM (Generalized Yannakakis in MapReduce), a distributed adaptation of the classic Yannakakis algorithm. Traditionally, Yannakakis’s algorithm is a sequential, two-phase process (upward and downward semijoins) used for acyclic queries. GYM parallelizes this process and extends it to cyclic queries using Generalized Hypertree Decompositions (GHDs).
Key technical contributions include:
- Intersection Width ($iw$): A new structural metric for queries. It measures how "connected" adjacent components of a query plan are. This provides a tighter bound on communication than standard "width" metrics.
- Log-GTA (Log-depth GHD Transformation Algorithm): A method to take a "deep" query plan (like a long chain) and squash it into a "shallow" plan with a depth of only $O(\log n)$.
- C-GTA: A variation that allows for even fewer rounds by further increasing the "width" (and thus the communication cost) of the plan.
The algorithm works by first "materializing" small sub-joins (IDBs) and then executing a parallelized version of the Yannakakis semijoin/join phases on these intermediate results.
Canonical Query Structures
As a theoretical computer science paper, the analysis focuses on rigorous mathematical proofs rather than empirical datasets. The authors evaluate their algorithms through simulations on canonical query structures that represent different challenges for distributed joins.
- Star Queries ($S_n$): Highly parallelizable queries where one central table joins with many others.
- Chain Queries ($C_n$): The "worst-case" for one-round algorithms, where tables are joined in a long sequence.
- Triangle-Chain Queries ($TC_n$): A more complex cyclic query used to demonstrate the power of the "intersection width" metric.
Key Theoretical Results
The paper provides a formal spectrum of trade-offs between the number of rounds and communication costs:
- Linear Rounds: Any query $Q$ with width $w$ can be computed in $O(n)$ rounds with a communication cost of $O(n \frac{(IN^w + OUT)^2}{M})$.
- Logarithmic Rounds: Using the Log-GTA transformation, the same query can be computed in $O(\log n)$ rounds with a communication cost of $O(n \frac{(IN^{\max(w, 3iw)} + OUT)^2}{M})$.
- Skew Resilience: These results hold even in the presence of "skew" (data where some values appear much more frequently than others), a common issue in real-world distributed systems.
One of the most surprising takeaways is that the Yannakakis algorithm can be modified to run in logarithmic rounds. This places bounded-width queries in the complexity class NC, meaning they are highly parallelizable.
Conclusion and Future Work
The GYM framework formalizes the trade-off between rounds and communication. While the most efficient bounds assume a constant query width $w$, the paper opens several avenues for future research. The authors suggest exploring new GHD construction algorithms that might offer even better trade-offs—perhaps achieving lower depth with only a two-fold increase in width, rather than the three-fold increase ($3iw$) presented here. They also aim to investigate the absolute lower bounds of communication for multiround algorithms in distributed environments.
Summary updated