Abstract
For decades, the join ordering problem in database optimization has been constrained by a seemingly fundamental $O(3^n)$ time complexity for exact solutions. This paper introduces DPconv, an algorithmic framework that breaks this barrier by leveraging Fast Subset Convolution (FSC). By reducing the complexity to $O(2^n \cdot poly(n))$, DPconv enables exact optimization for queries with significantly more relations than previously possible, achieving up to a 30x speedup over state-of-the-art dynamic programming approaches in complex scenarios.
Introduction
In relational database management systems, the join ordering problem is a critical task: finding the most efficient sequence to join $n$ tables. Because the search space grows exponentially with the number of relations, finding the optimal join tree is NP-hard. Since the 1970s, Dynamic Programming (DP) has been the gold standard for exact optimization. However, even highly optimized algorithms like DPccp and DPsub are limited by a worst-case complexity of $O(3^n)$.
As modern analytical workloads grow in complexity, often involving dozens of tables, this $O(3^n)$ growth becomes a "wall." When the number of relations exceeds a certain threshold, optimizers are forced to abandon exact solutions in favor of greedy heuristics that may produce suboptimal plans. DPconv represents a theoretical and practical breakthrough, providing the first super-polynomial speedup over this long-standing limit.
Methodology
The core innovation of DPconv is the recognition that the standard DP recursion for join ordering can be reformulated as a subset convolution.
Fast Subset Convolution (FSC)
Instead of the naive approach of iterating over all possible partitions of a set (which leads to $O(3^n)$), DPconv applies FSC. This technique utilizes an FFT-inspired strategy involving Zeta and Möbius transforms. By performing computations in a transformed "Fourier-like" space, the algorithm reduces the complexity to $O(2^n \cdot n^2)$.
Semi-ring Embedding
Join cost functions typically operate in (min, +) or (min, max) semi-rings. However, FSC is traditionally designed for standard (+, ×) rings. To bridge this gap, the authors employ an embedding technique that maps cost values to the exponents of polynomials. This allows the faster ring-based FSC to solve semi-ring optimization problems effectively.
Practical Implementation Optimizations
To ensure the algorithm is performant in real-world systems, the authors introduced several refinements:
- Layer-wise Optimization: By organizing the DP table into cardinality layers, the transforms are computed only once per layer, removing a linear factor of $n$.
- $C_{max}$ Optimization: For the specific goal of minimizing the largest intermediate result ($C_{max}$), the authors developed a simplified binary search approach that avoids the computational overhead of polynomial embeddings.
Evaluation
The authors evaluated DPconv against established benchmarks, including the Join Order Benchmark (JOB), the Cardinality Estimation Benchmark (CEB), and synthetic Clique Queries. Clique queries represent the theoretical worst-case for optimizers, as every relation joins with every other relation.
Performance Results
- Speedup: DPconv achieved up to a 30x speedup over
DPccpfor large clique queries. - Crossover Point: The algorithm begins to outperform traditional DP methods at approximately $n = 17$ relations for dense queries.
- Resource-Awareness: The authors proposed a hybrid cost function, $C_{cap}$, which minimizes total intermediate size while keeping peak memory usage at the theoretical minimum. In JOB queries, this approach reduced peak intermediate join sizes by up to 1.72x with negligible overhead.
Discussion and Limitations
While DPconv breaks the $O(3^n)$ barrier, its performance is currently most advantageous for dense query graphs. Traditional algorithms like DPccp remain more efficient for small or very sparse queries because they are designed to explore only connected subgraphs. Future work involving "Sparse Subset Convolution" may address this gap.
Additionally, the framework requires cost functions to exhibit additive separability. This constraint means that certain cost models (e.g., specific nested-loop or hash-join models that do not fit this mathematical property) are not yet supported. Finally, while the current focus is on binary join trees, extending this FSC-based approach to hypergraphs and non-inner join types remains a promising area for future research.
Conclusion
DPconv demonstrates that the $O(3^n)$ complexity of exact join ordering is not an unbreakable law of database science. By connecting database optimization with parameterized algorithm theory, the authors have provided a tool that is not only theoretically superior but also practically faster for the complex, large-scale queries common in modern data analytics.
Summary updated