TreeTracker Join: Simple, Optimal, Fast

Zeyuan Hu,Yisu Remy Wang,Daniel P. Miranker
2024-10-06
Abstract:Inspired by the TreeTracker algorithm used in Constraint Satisfaction we present a novel linear-time join algorithm, TreeTracker Join (TTJ). TTJ is very similar to a standard binary hash join, but introduces a test that identifies when a tuple is dangling and removes that tuple from its relation. The test is to simply observe if a hash lookup fails to return any matching tuples. If so, TTJ determines which tuple is responsible for the failure, backtracks to the offending tuple, and removes it from its relation. As compared to the best known linear-time join algorithm, Yannakakis's algorithm, TTJ shares the same asymptotic complexity on acyclic queries while imposing much lower overhead in practice. We can also reuse any binary join plan for TTJ, with the guarantee that TTJ will match or outperform binary join on the same plan. Our experiments show TTJ is the fastest algorithm in 97 out of 113 queries, and outperforms binary join and Yannakakis's algorithm by up to 26.7X and 8.9X, respectively.
Databases
What problem does this paper attempt to address?