Optimal-Time Independent Subset Sampling over Acyclic Joins
Xuyang Liu, Zijian Zhang, Zhen Li
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μ) time per call including output construction. Here N is the input size, m counts relation occurrences, and μ 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 μ=100, our sampler achieves a 20.5× speedup over indexed materialization for construction plus 300 calls, measured after common data preparation and loading.
Create a lesson
Related papers
Probe-Based Routing for Join Optimizer Selection
Shared title terminology · Vladimir Burlakov, Alena Rybakina, Sergey Kudashev et al.
Join Order Enumeration and Optimization for Double-Star and Helix Join Graphs
Shared title terminology · Ansh Taneja, Ryan Marcus
Tight Width Minimisation of Self-Join-Free Quantified Conjunctive Queries
Shared title terminology · Hubie Chen, Fabio Mogavero, Sam M. Thompson
Optimizing Query Decomposition for Reliable Validation
Shared title terminology · Shuo Zhang, Sudeepa Roy, Jun Yang
Calibrated Early Termination with Bounded Optimality Gaps for Constrained Vector Search
Shared title terminology · Xinyu Zhang, Jingze Li, Baihua Zheng et al.
Auriga: Harness-Governed LLM Agents for Effective Throughput Optimization in Execute-Order-Validate Permissioned Blockchains
Shared title terminology · Xiao Zhang, Tianyang Wang, Fangtao Gu et al.