{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,10,23]],"date-time":"2026-10-23T20:29:14Z","timestamp":1792787354424,"version":"4.5.0"},"reference-count":86,"publisher":"Association for Computing Machinery (ACM)","issue":"3","license":[{"start":{"date-parts":[[2018,3,13]],"date-time":"2018-03-13T00:00:00Z","timestamp":1520899200000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/www.acm.org\/publications\/policies\/copyright_policy#Background"}],"funder":[{"DOI":"10.13039\/100000001","name":"NSF","doi-asserted-by":"publisher","award":["CCF-1161196, CCF-1319402, CCF-0844796 and CCF-1319402"],"award-info":[{"award-number":["CCF-1161196, CCF-1319402, CCF-0844796 and CCF-1319402"]}],"id":[{"id":"10.13039\/100000001","id-type":"DOI","asserted-by":"publisher"}]},{"name":"Moore Foundation Data Driven Investigator award"},{"name":"American Family Insurance, Google, Lightspeed Ventures, and Toshiba"},{"DOI":"10.13039\/100000006","name":"Office of Naval Research","doi-asserted-by":"crossref","award":["N000141210041 and N000141310129"],"award-info":[{"award-number":["N000141210041 and N000141310129"]}],"id":[{"id":"10.13039\/100000006","id-type":"DOI","asserted-by":"crossref"}]},{"name":"National Science Foundation (NSF) under CAREER","award":["IIS-1353606 and CCF-1356918"],"award-info":[{"award-number":["IIS-1353606 and CCF-1356918"]}]},{"name":"Sloan Research Fellowship"}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["J. ACM"],"published-print":{"date-parts":[[2018,6,30]]},"abstract":"<jats:p>Efficient join processing is one of the most fundamental and well-studied tasks in database research. In this work, we examine algorithms for natural join queries over many relations and describe a new algorithm to process these queries optimally in terms of worst-case data complexity. Our result builds on recent work by Atserias, Grohe, and Marx, who gave bounds on the size of a natural join query in terms of the sizes of the individual relations in the body of the query. These bounds, however, are not constructive: they rely on Shearer\u2019s entropy inequality, which is information-theoretic. Thus, the previous results leave open the question of whether there exist algorithms whose runtimes achieve these optimal bounds. An answer to this question may be interesting to database practice, as we show in this article that any project-join style plans, such as ones typically employed in a relational database management system, are asymptotically slower than the optimal for some queries. We present an algorithm whose runtime is worst-case optimal for all natural join queries. Our result may be of independent interest, as our algorithm also yields a constructive proof of the general fractional cover bound by Atserias, Grohe, and Marx without using Shearer\u2019s inequality. This bound implies two famous inequalities in geometry: the Loomis-Whitney inequality and its generalization, the Bollob\u00e1s-Thomason inequality. Hence, our results algorithmically prove these inequalities as well. Finally, we discuss how our algorithm can be used to evaluate full conjunctive queries optimally, to compute a relaxed notion of joins and to optimally (in the worst-case) enumerate all induced copies of a fixed subgraph inside of a given large graph.<\/jats:p>","DOI":"10.1145\/3180143","type":"journal-article","created":{"date-parts":[[2018,3,14]],"date-time":"2018-03-14T08:34:20Z","timestamp":1521016460000},"page":"1-40","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":109,"title":["Worst-case Optimal Join Algorithms"],"prefix":"10.1145","volume":"65","author":[{"given":"Hung Q.","family":"Ngo","sequence":"first","affiliation":[{"name":"University at Buffalo, SUNY, NY, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Ely","family":"Porat","sequence":"additional","affiliation":[{"name":"Bar-Ilan University, Ramat-Gan, Israel"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Christopher","family":"R\u00e9","sequence":"additional","affiliation":[{"name":"Stanford University, CA, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Atri","family":"Rudra","sequence":"additional","affiliation":[{"name":"University at Buffalo, SUNY, NY, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2018,3,13]]},"reference":[{"key":"e_1_2_1_1_1","volume-title":"Foundations of Databases","author":"Abiteboul Serge","unstructured":"Serge Abiteboul , Richard Hull , and Victor Vianu . 1995. Foundations of Databases . Addison-Wesley . Serge Abiteboul, Richard Hull, and Victor Vianu. 1995. Foundations of Databases. Addison-Wesley."},{"key":"e_1_2_1_2_1","doi-asserted-by":"publisher","DOI":"10.1145\/2967101"},{"key":"e_1_2_1_3_1","doi-asserted-by":"publisher","DOI":"10.1145\/2902251.2902280"},{"key":"e_1_2_1_4_1","doi-asserted-by":"publisher","DOI":"10.1145\/2902251.2902289"},{"key":"e_1_2_1_5_1","doi-asserted-by":"publisher","DOI":"10.1145\/3034786.3056105"},{"key":"e_1_2_1_6_1","doi-asserted-by":"publisher","DOI":"10.1007\/BF02761855"},{"key":"e_1_2_1_7_1","doi-asserted-by":"publisher","DOI":"10.1145\/303976.303978"},{"key":"e_1_2_1_8_1","doi-asserted-by":"publisher","DOI":"10.1016\/j.ejc.2005.08.002"},{"key":"e_1_2_1_9_1","doi-asserted-by":"publisher","DOI":"10.1109\/FOCS.2008.43"},{"key":"e_1_2_1_10_1","doi-asserted-by":"publisher","DOI":"10.1145\/342009.335420"},{"key":"e_1_2_1_11_1","doi-asserted-by":"publisher","DOI":"10.1145\/1066157.1066171"},{"key":"e_1_2_1_12_1","doi-asserted-by":"publisher","DOI":"10.1145\/2402.322389"},{"key":"e_1_2_1_13_1","doi-asserted-by":"publisher","DOI":"10.1137\/0210059"},{"key":"e_1_2_1_14_1","doi-asserted-by":"publisher","DOI":"10.1112\/blms\/27.5.417"},{"key":"e_1_2_1_15_1","doi-asserted-by":"publisher","DOI":"10.1145\/800135.804423"},{"key":"e_1_2_1_16_1","doi-asserted-by":"publisher","DOI":"10.1109\/SFCS.1980.41"},{"key":"e_1_2_1_17_1","doi-asserted-by":"publisher","DOI":"10.1145\/800105.803397"},{"key":"e_1_2_1_18_1","doi-asserted-by":"publisher","DOI":"10.1145\/275487.275492"},{"key":"e_1_2_1_19_1","doi-asserted-by":"publisher","DOI":"10.1016\/S0304-3975(99)00220-0"},{"key":"e_1_2_1_20_1","doi-asserted-by":"publisher","DOI":"10.1137\/0214017"},{"key":"e_1_2_1_21_1","doi-asserted-by":"publisher","DOI":"10.1016\/0097-3165(86)90019-1"},{"key":"e_1_2_1_22_1","doi-asserted-by":"publisher","DOI":"10.1145\/1242524.1242527"},{"key":"e_1_2_1_23_1","doi-asserted-by":"publisher","DOI":"10.1002\/jgt.3190170314"},{"key":"e_1_2_1_24_1","doi-asserted-by":"publisher","DOI":"10.1145\/2402.322390"},{"key":"e_1_2_1_25_1","doi-asserted-by":"publisher","DOI":"10.1145\/319732.319735"},{"key":"e_1_2_1_26_1","doi-asserted-by":"publisher","DOI":"10.1145\/602220.602222"},{"key":"e_1_2_1_27_1","doi-asserted-by":"publisher","DOI":"10.1007\/BF02780332"},{"key":"e_1_2_1_28_1","volume-title":"Proceedings of ICALP\u201913","author":"Gilbert Anna C.","unstructured":"Anna C. Gilbert , Hung Q. Ngo , Ely Porat , Atri Rudra , and Martin J. Strauss . 2013. &ell;2\/&ell;2-foreach sparse recovery with low risk . In Proceedings of ICALP\u201913 . 461--472. Anna C. Gilbert, Hung Q. Ngo, Ely Porat, Atri Rudra, and Martin J. Strauss. 2013. &ell;2\/&ell;2-foreach sparse recovery with low risk. In Proceedings of ICALP\u201913. 461--472."},{"key":"e_1_2_1_29_1","doi-asserted-by":"publisher","DOI":"10.1145\/319758.319775"},{"key":"e_1_2_1_30_1","doi-asserted-by":"publisher","DOI":"10.1145\/2220357.2220363"},{"key":"e_1_2_1_31_1","doi-asserted-by":"publisher","DOI":"10.1145\/382780.382783"},{"key":"e_1_2_1_32_1","doi-asserted-by":"publisher","DOI":"10.1006\/jcss.2001.1809"},{"key":"e_1_2_1_33_1","doi-asserted-by":"publisher","DOI":"10.1145\/1568318.1568320"},{"key":"e_1_2_1_34_1","doi-asserted-by":"publisher","DOI":"10.1145\/152610.152611"},{"key":"e_1_2_1_35_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-41660-6_17"},{"key":"e_1_2_1_36_1","doi-asserted-by":"publisher","DOI":"10.5555\/1109557.1109590"},{"key":"e_1_2_1_37_1","doi-asserted-by":"publisher","DOI":"10.1145\/380752.380867"},{"key":"e_1_2_1_39_1","doi-asserted-by":"publisher","DOI":"10.1007\/s00493-010-2413-6"},{"key":"e_1_2_1_40_1","doi-asserted-by":"publisher","DOI":"10.1016\/S0019-9958(78)90275-9"},{"key":"e_1_2_1_41_1","unstructured":"G. H. Hardy J. E. Littlewood and G. P\u00f3lya. 1988. Inequalities. Cambridge University Press Cambridge. xii+324 pages. Reprint of the 1952 edition.  G. H. Hardy J. E. Littlewood and G. P\u00f3lya. 1988. Inequalities. Cambridge University Press Cambridge. xii+324 pages. Reprint of the 1952 edition."},{"key":"e_1_2_1_42_1","doi-asserted-by":"publisher","DOI":"10.1145\/234313.234367"},{"key":"e_1_2_1_43_1","doi-asserted-by":"publisher","DOI":"10.5555\/1315451.1315455"},{"key":"e_1_2_1_44_1","doi-asserted-by":"publisher","DOI":"10.1145\/115790.115835"},{"key":"e_1_2_1_45_1","doi-asserted-by":"publisher","DOI":"10.1016\/j.jpdc.2004.03.021"},{"key":"e_1_2_1_46_1","doi-asserted-by":"publisher","DOI":"10.1137\/0207033"},{"key":"e_1_2_1_47_1","volume-title":"Proceedings of VLDB.","author":"Jagadish H. V.","unstructured":"H. V. Jagadish , N. Koudas , S. Muthukrishnan , V. Poosala , K. C. Sevcik , and T. Suel . 1998. Optimal histograms with quality guarantees . In Proceedings of VLDB. H. V. Jagadish, N. Koudas, S. Muthukrishnan, V. Poosala, K. C. Sevcik, and T. Suel. 1998. Optimal histograms with quality guarantees. In Proceedings of VLDB."},{"key":"e_1_2_1_48_1","doi-asserted-by":"publisher","DOI":"10.1145\/2902251.2902293"},{"key":"e_1_2_1_49_1","doi-asserted-by":"publisher","DOI":"10.1006\/jcss.2000.1713"},{"key":"e_1_2_1_50_1","volume-title":"Proceedings of VLDB.","author":"K\u00f6nig A. C.","unstructured":"A. C. K\u00f6nig and G. Weikum . 1999. Combining histograms and parametric curve fitting for feedback-driven query result-size estimation . In Proceedings of VLDB. A. C. K\u00f6nig and G. Weikum. 1999. Combining histograms and parametric curve fitting for feedback-driven query result-size estimation. In Proceedings of VLDB."},{"key":"e_1_2_1_51_1","volume-title":"Proceedings of VLDB\u201906","author":"Koudas Nick","year":"2006","unstructured":"Nick Koudas , Chen Li , Anthony K. H. Tung , and Rares Vernica . 2006 . Relaxing join and selection queries . In Proceedings of VLDB\u201906 . Nick Koudas, Chen Li, Anthony K. H. Tung, and Rares Vernica. 2006. Relaxing join and selection queries. In Proceedings of VLDB\u201906."},{"key":"e_1_2_1_52_1","volume-title":"Proceedings of SODA\u201905","author":"Lehman April Rasala","year":"2005","unstructured":"April Rasala Lehman and Eric Lehman . 2005 . Network coding: Does the model need tuning? In Proceedings of SODA\u201905 . Society for Industrial and Applied Mathematics, Philadelphia, PA, 499--504. April Rasala Lehman and Eric Lehman. 2005. Network coding: Does the model need tuning? In Proceedings of SODA\u201905. Society for Industrial and Applied Mathematics, Philadelphia, PA, 499--504."},{"key":"e_1_2_1_53_1","doi-asserted-by":"publisher","DOI":"10.1090\/S0002-9904-1949-09320-5"},{"key":"e_1_2_1_54_1","unstructured":"Russell Lyons. 2011. Probability on Trees and Networks. Retrieved from http:\/\/php.indiana.edu\/rdlyons\/prbtree\/prbtree.html.   Russell Lyons. 2011. Probability on Trees and Networks. Retrieved from http:\/\/php.indiana.edu\/rdlyons\/prbtree\/prbtree.html."},{"key":"e_1_2_1_55_1","volume-title":"The Theory of Relational Databases","author":"Maier David","unstructured":"David Maier . 1983. The Theory of Relational Databases . Computer Science Press . David Maier. 1983. The Theory of Relational Databases. Computer Science Press."},{"key":"e_1_2_1_56_1","volume-title":"Proceedings of ICDT (Lecture Notes in Computer Science), Giorgio Ausiello and Paolo Atzeni (Eds.)","volume":"243","author":"Malvestuto Francesco M.","year":"1986","unstructured":"Francesco M. Malvestuto . 1986 . Modelling large bases of categorial data with acyclic schemes . In Proceedings of ICDT (Lecture Notes in Computer Science), Giorgio Ausiello and Paolo Atzeni (Eds.) , Vol. 243 . Springer, 323--340. Francesco M. Malvestuto. 1986. Modelling large bases of categorial data with acyclic schemes. In Proceedings of ICDT (Lecture Notes in Computer Science), Giorgio Ausiello and Paolo Atzeni (Eds.), Vol. 243. Springer, 323--340."},{"key":"e_1_2_1_57_1","volume-title":"Proceedings of VLDB. 373--384","author":"Markl Volker","year":"2005","unstructured":"Volker Markl , Nimrod Megiddo , Marcel Kutsch , Tam Minh Tran , Peter J. Haas , and Utkarsh Srivastava . 2005 . Consistently estimating the selectivity of conjuncts of predicates . In Proceedings of VLDB. 373--384 . Volker Markl, Nimrod Megiddo, Marcel Kutsch, Tam Minh Tran, Peter J. Haas, and Utkarsh Srivastava. 2005. Consistently estimating the selectivity of conjuncts of predicates. In Proceedings of VLDB. 373--384."},{"key":"e_1_2_1_58_1","doi-asserted-by":"publisher","DOI":"10.1145\/1806689.1806790"},{"key":"e_1_2_1_59_1","volume-title":"Electron. Colloq. Comput. Complex. (ECCC) 15","author":"M\u00fcller Moritz","year":"2008","unstructured":"Moritz M\u00fcller . 2008 . Valiant-Vazirani lemmata for various logics . Electron. Colloq. Comput. Complex. (ECCC) 15 , 063 (2008). Moritz M\u00fcller. 2008. Valiant-Vazirani lemmata for various logics. Electron. Colloq. Comput. Complex. (ECCC) 15, 063 (2008)."},{"key":"e_1_2_1_60_1","doi-asserted-by":"publisher","DOI":"10.1137\/S003614450342480"},{"key":"e_1_2_1_61_1","doi-asserted-by":"publisher","DOI":"10.1145\/2594538.2594547"},{"key":"e_1_2_1_62_1","doi-asserted-by":"publisher","DOI":"10.1145\/2213556.2213565"},{"key":"e_1_2_1_63_1","doi-asserted-by":"publisher","DOI":"10.1145\/2590989.2590991"},{"key":"e_1_2_1_64_1","doi-asserted-by":"publisher","DOI":"10.1145\/2764947.2764948"},{"key":"e_1_2_1_65_1","doi-asserted-by":"publisher","DOI":"10.1145\/1142351.1142384"},{"key":"e_1_2_1_66_1","doi-asserted-by":"publisher","DOI":"10.1016\/j.ipl.2011.12.007"},{"key":"e_1_2_1_67_1","doi-asserted-by":"publisher","DOI":"10.1145\/263661.263664"},{"key":"e_1_2_1_68_1","doi-asserted-by":"publisher","DOI":"10.1145\/233269.233342"},{"key":"e_1_2_1_69_1","doi-asserted-by":"publisher","DOI":"10.1145\/4221.4997"},{"key":"e_1_2_1_70_1","doi-asserted-by":"publisher","DOI":"10.1145\/155271.155277"},{"key":"e_1_2_1_71_1","volume-title":"Combinatorial Optimization. Polyhedra and Efficiency","author":"Schrijver Alexander","unstructured":"Alexander Schrijver . 2003. Combinatorial Optimization. Polyhedra and Efficiency . Vol. A. Algorithms and Combinatorics, Vol. 24 . Springer-Verlag , Berlin . Alexander Schrijver. 2003. Combinatorial Optimization. Polyhedra and Efficiency. Vol. A. Algorithms and Combinatorics, Vol. 24. Springer-Verlag, Berlin."},{"key":"e_1_2_1_72_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICDE.2006.84"},{"key":"e_1_2_1_73_1","doi-asserted-by":"publisher","DOI":"10.1145\/1963405.1963491"},{"key":"e_1_2_1_74_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICDM.2008.72"},{"key":"e_1_2_1_75_1","doi-asserted-by":"publisher","DOI":"10.14778\/3402707.3402724"},{"key":"e_1_2_1_76_1","volume-title":"Principles of Database and Knowledge-Base Systems","author":"Ullman Jeffrey D.","unstructured":"Jeffrey D. Ullman . 1989. Principles of Database and Knowledge-Base Systems , Volume II. Computer Science Press . Jeffrey D. Ullman. 1989. Principles of Database and Knowledge-Base Systems, Volume II. Computer Science Press."},{"key":"e_1_2_1_77_1","doi-asserted-by":"publisher","DOI":"10.5555\/22101.22108"},{"key":"e_1_2_1_78_1","doi-asserted-by":"publisher","DOI":"10.1145\/800070.802186"},{"key":"e_1_2_1_79_1","doi-asserted-by":"publisher","DOI":"10.1145\/212433.212474"},{"key":"e_1_2_1_80_1","volume-title":"Proceedings of ICDT. 96--106","author":"Veldhuizen Todd L.","year":"2014","unstructured":"Todd L. Veldhuizen . 2014 . Triejoin: A simple, worst-case optimal join algorithm . In Proceedings of ICDT. 96--106 . Todd L. Veldhuizen. 2014. Triejoin: A simple, worst-case optimal join algorithm. In Proceedings of ICDT. 96--106."},{"key":"e_1_2_1_81_1","doi-asserted-by":"publisher","DOI":"10.1006\/jcss.1996.0012"},{"key":"e_1_2_1_82_1","doi-asserted-by":"publisher","DOI":"10.1006\/jcss.2002.1848"},{"key":"e_1_2_1_83_1","doi-asserted-by":"publisher","DOI":"10.1145\/1376616.1376720"},{"key":"e_1_2_1_84_1","volume-title":"Proceedings of VLDB. IEEE Computer Society, 82--94","author":"Yannakakis Mihalis","year":"1981","unstructured":"Mihalis Yannakakis . 1981 . Algorithms for acyclic database schemes . In Proceedings of VLDB. IEEE Computer Society, 82--94 . Mihalis Yannakakis. 1981. Algorithms for acyclic database schemes. In Proceedings of VLDB. IEEE Computer Society, 82--94."},{"key":"e_1_2_1_85_1","doi-asserted-by":"publisher","DOI":"10.5555\/795662.796318"},{"key":"e_1_2_1_86_1","volume-title":"Proceedings of IEEE COMPSAC. 306--312","author":"Yu C.","unstructured":"C. Yu and M. Ozsoyoglu . 1979. An algorithm for tree query membership for a distributed query . In Proceedings of IEEE COMPSAC. 306--312 . C. Yu and M. Ozsoyoglu. 1979. An algorithm for tree query membership for a distributed query. In Proceedings of IEEE COMPSAC. 306--312."},{"key":"e_1_2_1_87_1","first-page":"261","article-title":"On determining tree-query membership of a distributed query","volume":"22","author":"Yu C. T.","year":"1984","unstructured":"C. T. Yu and M. Z. Ozsoyoglu . 1984 . On determining tree-query membership of a distributed query . Informatica 22 , 3 (1984), 261 -- 282 . C. T. Yu and M. Z. Ozsoyoglu. 1984. On determining tree-query membership of a distributed query. Informatica 22, 3 (1984), 261--282.","journal-title":"Informatica"}],"container-title":["Journal of the ACM"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3180143","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3180143","content-type":"application\/pdf","content-version":"vor","intended-application":"syndication"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3180143","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,17]],"date-time":"2025-06-17T21:08:18Z","timestamp":1750194498000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3180143"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2018,3,13]]},"references-count":86,"journal-issue":{"issue":"3","published-print":{"date-parts":[[2018,6,30]]}},"alternative-id":["10.1145\/3180143"],"URL":"https:\/\/doi.org\/10.1145\/3180143","relation":{},"ISSN":["0004-5411","1557-735X"],"issn-type":[{"value":"0004-5411","type":"print"},{"value":"1557-735X","type":"electronic"}],"subject":[],"published":{"date-parts":[[2018,3,13]]},"assertion":[{"value":"2013-01-01","order":0,"name":"received","label":"Received","group":{"name":"publication_history","label":"Publication History"}},{"value":"2018-01-01","order":1,"name":"accepted","label":"Accepted","group":{"name":"publication_history","label":"Publication History"}},{"value":"2018-03-13","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}