{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,5,14]],"date-time":"2026-05-14T13:12:34Z","timestamp":1778764354021,"version":"3.51.4"},"reference-count":38,"publisher":"Association for Computing Machinery (ACM)","issue":"2","content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Proc. ACM Manag. Data"],"published-print":{"date-parts":[[2026,5,12]]},"abstract":"<jats:p>Uniform sampling and approximate counting are fundamental primitives for modern database applications, ranging from query optimization to approximate query processing. While recent breakthroughs have established optimal sampling and counting algorithms for full join queries, a significant gap remains for join-project queries, which are ubiquitous in real-world workloads. The state-of-the-art ''propose-and-verify'' framework [12] for these queries suffers from fundamental inefficiencies, often yielding prohibitive complexity when projections significantly reduce the output size.<\/jats:p>\n                  <jats:p>In this paper, we present the first asymptotically optimal algorithms for fundamental classes of join-project queries, including matrix, star, and chain queries. By leveraging a novel rejection-based sampling strategy and a hybrid counting reduction, we achieve polynomial speedups over the state of the art. We establish the optimality of our results through matching communication complexity lower bounds, which hold even against algebraic techniques like fast matrix multiplication. Finally, we delineate the theoretical limits of the problem space. While matrix and star queries admit efficient sublinear-time algorithms, we establish a significantly stronger lower bound for chain queries, demonstrating that sublinear algorithms are impossible in general.<\/jats:p>","DOI":"10.1145\/3801916","type":"journal-article","created":{"date-parts":[[2026,5,14]],"date-time":"2026-05-14T12:50:22Z","timestamp":1778763022000},"page":"1-25","source":"Crossref","is-referenced-by-count":0,"title":["Towards Output-Optimal Uniform Sampling and Approximate Counting for Join-Project Queries"],"prefix":"10.1145","volume":"4","author":[{"ORCID":"https:\/\/orcid.org\/0000-0002-7890-665X","authenticated-orcid":false,"given":"Xiao","family":"Hu","sequence":"first","affiliation":[{"name":"University of Waterloo, Waterloo, Canada"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0009-0009-2902-259X","authenticated-orcid":false,"given":"Jinchao","family":"Huang","sequence":"additional","affiliation":[{"name":"The Chinese University of Hong Kong, Hong Kong, Hong Kong"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"320","published-online":{"date-parts":[[2026,5,14]]},"reference":[{"key":"e_1_2_1_1_1","doi-asserted-by":"publisher","DOI":"10.1145\/304182.304207"},{"key":"e_1_2_1_2_1","doi-asserted-by":"publisher","DOI":"10.1145\/2465351.2465355"},{"key":"e_1_2_1_3_1","volume-title":"Color-coding. Journal of the ACM (JACM), 42(4):844-856","author":"Alon N.","year":"1995","unstructured":"N. Alon, R. Yuster, and U. Zwick. Color-coding. Journal of the ACM (JACM), 42(4):844-856, 1995."},{"key":"e_1_2_1_4_1","doi-asserted-by":"publisher","DOI":"10.1145\/1514894.1514909"},{"key":"e_1_2_1_5_1","first-page":"1","volume-title":"Proc. Innovations in Theoretical Computer Science","author":"Assadi S.","year":"2019","unstructured":"S. Assadi, M. Kapralov, and S. Khanna. A Simple Sublinear-Time Algorithm for Counting Arbitrary Subgraphs via Edge Sampling. In Proc. Innovations in Theoretical Computer Science, pages 6:1-6:20, 2019."},{"key":"e_1_2_1_6_1","series-title":"SIAM Journal on Computing, 42 :1737-1767","volume-title":"Size bounds and query plans for relational joins","author":"Atserias A.","year":"2013","unstructured":"A. Atserias, M. Grohe, and D. Marx. Size bounds and query plans for relational joins. SIAM Journal on Computing, 42 :1737-1767, 2013."},{"key":"e_1_2_1_7_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-540-74915-8_18"},{"key":"e_1_2_1_8_1","doi-asserted-by":"publisher","DOI":"10.1109\/CCC.2002.1004344"},{"key":"e_1_2_1_9_1","volume-title":"ICALP 2024","author":"Censor-Hillel K.","year":"2024","unstructured":"K. Censor-Hillel, T. Even, and V. Vassilevska Williams. Fast approximate counting of cycles. In ICALP 2024, 2024."},{"key":"e_1_2_1_10_1","doi-asserted-by":"publisher","DOI":"10.1145\/3717823.3718314"},{"key":"e_1_2_1_11_1","doi-asserted-by":"publisher","DOI":"10.1145\/304181.304206"},{"key":"e_1_2_1_12_1","volume-title":"ICDT","author":"Chen Y.","year":"2020","unstructured":"Y. Chen and K. Yi. Random sampling and size estimation over cyclic joins. In ICDT, 2020."},{"key":"e_1_2_1_13_1","first-page":"225","volume-title":"Proc. ACM Symposium on Principles of Distributed Computing","author":"Cohen E.","year":"2007","unstructured":"E. Cohen and H. Kaplan. Summarizing data using bottom-k sketches. In I. Gupta and R. Wattenhofer, editors, Proc. ACM Symposium on Principles of Distributed Computing, pages 225-234. ACM, 2007."},{"key":"e_1_2_1_14_1","doi-asserted-by":"publisher","DOI":"10.14778\/1453856.1453884"},{"key":"e_1_2_1_15_1","volume-title":"Introduction to algorithms","author":"Cormen T. H.","year":"2022","unstructured":"T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. Introduction to algorithms. MIT press, 2022."},{"key":"e_1_2_1_16_1","doi-asserted-by":"publisher","DOI":"10.1145\/3055399.3055502"},{"key":"e_1_2_1_17_1","doi-asserted-by":"publisher","DOI":"10.1145\/3618260.3649663"},{"key":"e_1_2_1_18_1","doi-asserted-by":"publisher","DOI":"10.1145\/3584372.3588666"},{"key":"e_1_2_1_19_1","doi-asserted-by":"publisher","DOI":"10.1137\/15M1054389"},{"key":"e_1_2_1_20_1","doi-asserted-by":"publisher","DOI":"10.1016\/j.tcs.2004.05.009"},{"key":"e_1_2_1_21_1","volume-title":"Statistical tables for biological, agricultural and medical research","author":"Fisher R. A.","year":"1953","unstructured":"R. A. Fisher and F. Yates. Statistical tables for biological, agricultural and medical research. Hafner Publishing Company, 1953."},{"key":"e_1_2_1_22_1","volume-title":"Towards output-optimal uniform sampling and approximate counting for join-project queries. In http:\/\/ arxiv.org\/ abs\/ 2603.12560","author":"Hu X.","year":"2026","unstructured":"X. Hu and J. Huang. Towards output-optimal uniform sampling and approximate counting for join-project queries. In http:\/\/ arxiv.org\/ abs\/ 2603.12560, 2026."},{"key":"e_1_2_1_23_1","doi-asserted-by":"publisher","DOI":"10.1145\/3375395.3387657"},{"key":"e_1_2_1_24_1","volume-title":"Proc. International Conference on Database Theory","author":"Huang J.","year":"2026","unstructured":"J. Huang, Y. Tao, and S. Wang. Acyclic join sampling under selections: Dichotomy, union sampling, and enumeration. In Proc. International Conference on Database Theory, 2026."},{"key":"e_1_2_1_25_1","doi-asserted-by":"publisher","DOI":"10.1002\/0471715816"},{"key":"e_1_2_1_26_1","doi-asserted-by":"publisher","DOI":"10.1137\/0405044"},{"key":"e_1_2_1_27_1","volume-title":"PODS, page 113-125","author":"Kim K.","year":"2023","unstructured":"K. Kim, J. Ha, G. Fletcher, and W.-S. Han. Guaranteeing the \u00d5(AGM\/OUT) runtime for uniform sampling and size estimation over joins. In PODS, page 113-125, 2023."},{"key":"e_1_2_1_28_1","doi-asserted-by":"publisher","DOI":"10.1016\/S0020-0190(00)00047-8"},{"key":"e_1_2_1_29_1","volume-title":"Volume II: Seminumerical Algorithms","author":"Knuth D. E.","year":"1998","unstructured":"D. E. Knuth. The art of computer programming, Volume II: Seminumerical Algorithms, 3rd Edition. Addison-Wesley Professional, 1998.","edition":"3"},{"key":"e_1_2_1_30_1","doi-asserted-by":"publisher","DOI":"10.1137\/110859798"},{"key":"e_1_2_1_31_1","doi-asserted-by":"publisher","DOI":"10.1145\/3196959.3196990"},{"key":"e_1_2_1_32_1","doi-asserted-by":"publisher","DOI":"10.1145\/2213556.2213565"},{"key":"e_1_2_1_33_1","first-page":"160","volume-title":"Proceedings of the VLDB Endowment","author":"Olken F.","year":"1986","unstructured":"F. Olken and D. Rotem. Simple random sampling from relational databases. In Proceedings of the VLDB Endowment, pages 160-169, 1986."},{"key":"e_1_2_1_34_1","doi-asserted-by":"publisher","DOI":"10.1007\/BF00140664"},{"key":"e_1_2_1_35_1","doi-asserted-by":"publisher","DOI":"10.1007\/BFb0032036"},{"key":"e_1_2_1_36_1","first-page":"1","volume-title":"49th International Colloquium on Automata, Languages, and Programming (ICALP 2022","author":"T\u011btek J.","year":"2022","unstructured":"J. T\u011btek. Approximate Triangle Counting via Sampling and Fast Matrix Multiplication. In 49th International Colloquium on Automata, Languages, and Programming (ICALP 2022), pages 107:1-107:20, 2022."},{"key":"e_1_2_1_37_1","first-page":"82","volume-title":"Proc. International Conference on Very Large Data Bases","author":"Yannakakis M.","year":"1981","unstructured":"M. Yannakakis. Algorithms for acyclic database schemes. In Proc. International Conference on Very Large Data Bases, pages 82-94, 1981."},{"key":"e_1_2_1_38_1","doi-asserted-by":"publisher","DOI":"10.1145\/3183713.3183739"}],"container-title":["Proceedings of the ACM on Management of Data"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3801916","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,5,14]],"date-time":"2026-05-14T12:50:33Z","timestamp":1778763033000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3801916"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2026,5,12]]},"references-count":38,"journal-issue":{"issue":"2","published-print":{"date-parts":[[2026,5,12]]}},"alternative-id":["10.1145\/3801916"],"URL":"https:\/\/doi.org\/10.1145\/3801916","relation":{},"ISSN":["2836-6573"],"issn-type":[{"value":"2836-6573","type":"electronic"}],"subject":[],"published":{"date-parts":[[2026,5,12]]}}}