Optimal-Time Independent Subset Sampling over Acyclic Joins
Xuyang Liu, Zijian Zhang, Zhen Li
Key points
From the paper's conclusion- We study sampling that includes each result independently with a prescribed probability given by the product of its input-tuple weights (PRODUCT).
Abstract
Join results can greatly exceed their inputs even when applications need only a small random subset. We study sampling that includes each result independently with a prescribed probability given by the product of its input-tuple weights (PRODUCT). For fixed full acyclic joins with static weights, we achieve input-linear preprocessing and index space together with output-linear expected sampling work, eliminating logarithmic factors from previous bounds. A shared join-tree index supports weighted draws over the entire join and locates high-probability results. Direct Bernoulli trials handle high-probability results, allowing Poisson thinning to generate the remaining independent inclusion decisions with bounded overhead. Our exact sampler uses expected $O(N)$ preprocessing, $O(N)$ index space, and expected $O(1+m\mu)$ time per call including output construction. Here $N$ is the input size, $m$ counts relation occurrences, and $\mu$ is the expected sample size. The guarantees hold on a real random-access machine with unit-cost exact arithmetic and logarithms, continuous uniform randomness, and expected-time hashing. The time bounds are optimal, matching input reading and explicit output writing. Our floating-point prototype has lower sampling latency than the fastest applicable baseline in 17 of 18 PRODUCT settings on three queries over the STATS benchmark. Construction savings on large joins can offset indexed materialization's faster sampling over a limited number of calls. On a real-data path at $\mu=100$, our sampler achieves a $20.5\times$ speedup over indexed materialization for construction plus 300 calls, measured after common data preparation and loading.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Computing Weighted Set Covers with Heterogeneous Stochastic Oracles: Deadline-Constrained Token ComplexityarXiv · 2026
- Almost Instance Optimal Sum and Moment Estimation Using Weighted SamplingarXiv · 2026
- Static and streaming algorithms for random sampling over spatial range joinsThe VLDB Journal · 2026
- Fixed-Size Active Statistical InferencearXiv · 2026
- Truly Sub-$3^n$ Min-Sum Subset Convolution and Join OrderingarXiv · 2026
- Yannakakis + : Practical Acyclic Query Evaluation with Theoretical GuaranteesACM Transactions on Database Systems · 2026