4 Ways to Improve A Perfect Join Algorithm
remy.wang·1d·
Discuss: Hacker News
Preview
Report Post

Based on Database Theory in Action: Yannakakis’s Algorithm to appear at ICDT 2026

Last time I covered one of my favorite results from database theory: Yannakakis’s algorithm for acyclic joins. The algorithm is very simple, yet achieves instance-optimality on a large class of queries, meaning it’s basically perfect as far as asymptotic complexity goes. So why doesn’t every database implement it? The main reason is that the algorithm is actually not very fast in practice. To be exact, it’s usually 2-3x slower than hash join. Let’s look at an example to understand this. Consider the natural join:

Q = R_1(x_1, x_2) \bowtie R_2(x_2, x_3) \bowtie R_3(x_3, x_4…

Similar Posts

Loading similar posts...