,
Yufei Tao
,
Sibo Wang
Creative Commons Attribution 4.0 International license
Previous research on join sampling has focused on joins without selection conditions, even though such conditions are prevalent in everyday queries in database systems. Motivated by this, we undertake a systematic investigation on the complexity of sampling from the result of an acyclic join under equality conditions given only at runtime. When conditions are conjunctive, the goal is to understand when it is possible to precompute a feasible structure that uses Õ(IN) space and supports sampling in Õ(1) time, where IN is the input size. We present a dichotomy to characterize (subject to a widely-accepted conjecture) the existence of such structures based on the conditions supplied and, in every feasible scenario, give an optimal structure of O(IN) space and O(1) sample time. We then extend our investigation to conditions expressed in disjunctive normal form, where the core challenge reduces to the fundamental set union sampling problem. We overcome the challenge with an optimal algorithm and utilize it to develop optimal sampling structures. Our findings also lead to new results on the closely-related random enumeration problem.
@InProceedings{huang_et_al:LIPIcs.ICDT.2026.9,
author = {Huang, Jinchao and Tao, Yufei and Wang, Sibo},
title = {{Acyclic Join Sampling Under Selections: Dichotomy, Union Sampling, and Enumeration}},
booktitle = {29th International Conference on Database Theory (ICDT 2026)},
pages = {9:1--9:20},
series = {Leibniz International Proceedings in Informatics (LIPIcs)},
ISBN = {978-3-95977-413-0},
ISSN = {1868-8969},
year = {2026},
volume = {365},
editor = {ten Cate, Balder and Funk, Maurice},
publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
address = {Dagstuhl, Germany},
URL = {https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.ICDT.2026.9},
URN = {urn:nbn:de:0030-drops-256231},
doi = {10.4230/LIPIcs.ICDT.2026.9},
annote = {Keywords: Conjunctive Queries, Acyclic Joins, Sampling, Lower Bounds}
}