Direct Access for Answers to Conjunctive Queries with Aggregation

Authors Idan Eldar , Nofar Carmeli , Benny Kimelfeld



PDF
Thumbnail PDF

File

LIPIcs.ICDT.2024.4.pdf
  • Filesize: 0.84 MB
  • 20 pages

Document Identifiers

Author Details

Idan Eldar
  • Technion - Israel Institute of Technology, Haifa, Israel
Nofar Carmeli
  • Inria, LIRMM, Univ Montpellier, CNRS, France
Benny Kimelfeld
  • Technion - Israel Institute of Technology, Haifa, Israel

Cite AsGet BibTex

Idan Eldar, Nofar Carmeli, and Benny Kimelfeld. Direct Access for Answers to Conjunctive Queries with Aggregation. In 27th International Conference on Database Theory (ICDT 2024). Leibniz International Proceedings in Informatics (LIPIcs), Volume 290, pp. 4:1-4:20, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2024)
https://doi.org/10.4230/LIPIcs.ICDT.2024.4

Abstract

We study the fine-grained complexity of conjunctive queries with grouping and aggregation. For some common aggregate functions (e.g., min, max, count, sum), such a query can be phrased as an ordinary conjunctive query over a database annotated with a suitable commutative semiring. Specifically, we investigate the ability to evaluate such queries by constructing in log-linear time a data structure that provides logarithmic-time direct access to the answers ordered by a given lexicographic order. This task is nontrivial since the number of answers might be larger than log-linear in the size of the input, and so, the data structure needs to provide a compact representation of the space of answers. In the absence of aggregation and annotation, past research provides a sufficient tractability condition on queries and orders. For queries without self-joins, this condition is not just sufficient, but also necessary (under conventional lower-bound assumptions in fine-grained complexity). We show that all past results continue to hold for annotated databases, assuming that the annotation itself is not part of the lexicographic order. On the other hand, we show infeasibility for the case of count-distinct that does not have any efficient representation as a commutative semiring. We then investigate the ability to include the aggregate and annotation outcome in the lexicographic order. Among the hardness results, standing out as tractable is the case of a semiring with an idempotent addition, such as those of min and max. Notably, this case captures also count-distinct over a logarithmic-size domain.

Subject Classification

ACM Subject Classification
  • Theory of computation → Database query languages (principles)
  • Theory of computation → Database query processing and optimization (theory)
Keywords
  • aggregate queries
  • conjunctive queries
  • provenance semirings
  • commutative semirings
  • annotated databases
  • direct access
  • ranking function
  • answer orderings
  • query classification

Metrics

  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    0
    PDF Downloads

References

  1. Guillaume Bagan, Arnaud Durand, and Etienne Grandjean. On acyclic conjunctive queries and constant delay enumeration. In Jacques Duparc and Thomas A. Henzinger, editors, Computer Science Logic, pages 208-222, Berlin, Heidelberg, 2007. Springer Berlin Heidelberg. URL: https://doi.org/10.1007/978-3-540-74915-8_18.
  2. Guillaume Bagan, Arnaud Durand, Etienne Grandjean, and Frédéric Olive. Computing the JTH solution of a first-order query. RAIRO - Theoretical Informatics and Applications (RAIRO: ITA), 42:147-164, 2008. URL: https://hal.archives-ouvertes.fr/hal-00221730, URL: https://doi.org/10.1051/ita:2007046.
  3. Christoph Berkholz, Jens Keppeler, and Nicole Schweikardt. Answering FO+MOD queries under updates on bounded degree databases. ACM Trans. Database Syst., 43(2):7:1-7:32, 2018. URL: https://doi.org/10.1145/3232056.
  4. Johann Brault-Baron. De la pertinence de l'énumération: Complexité en logiques propositionnelle et du premier ordre. Theses, Université de Caen, apr 2013. URL: https://tel.archives-ouvertes.fr/tel-01081392.
  5. Karl Bringmann, Nofar Carmeli, and Stefan Mengel. Tight fine-grained bounds for direct access on join queries. In PODS, pages 427-436. ACM, 2022. URL: https://doi.org/10.1145/3517804.3526234.
  6. Nofar Carmeli, Nikolaos Tziavelis, Wolfgang Gatterbauer, Benny Kimelfeld, and Mirek Riedewald. Tractable orders for direct access to ranked answers of conjunctive queries. In PODS, pages 325-341. ACM, 2021. URL: https://doi.org/10.1145/3452021.3458331.
  7. Nofar Carmeli, Shai Zeevi, Christoph Berkholz, Alessio Conte, Benny Kimelfeld, and Nicole Schweikardt. Answering (unions of) conjunctive queries using random access and random-order enumeration. ACM Trans. Database Syst., 47(3):9:1-9:49, 2022. URL: https://doi.org/10.1145/3531055.
  8. Henri Cohen. A course in computational algebraic number theory, volume 138 of Graduate texts in mathematics. Springer, 1993. URL: https://www.worldcat.org/oclc/27810276.
  9. Sara Cohen, Werner Nutt, and Yehoshua Sagiv. Deciding equivalences among conjunctive aggregate queries. J. ACM, 54(2):5-es, apr 2007. URL: https://doi.org/10.1145/1219092.1219093.
  10. Idan Eldar, Nofar Carmeli, and Benny Kimelfeld. Direct access for answers to conjunctive queries with aggregation. CoRR, abs/2303.05327, 2023. URL: https://doi.org/10.48550/arXiv.2303.05327.
  11. Anka Gajentaan and Mark H Overmars. On a class of o(n2) problems in computational geometry. Computational Geometry, 5(3):165-185, 1995. URL: https://doi.org/10.1016/0925-7721(95)00022-2.
  12. Étienne Grandjean and Louis Jachiet. Which arithmetic operations can be performed in constant time in the ram model with addition?, 2022. URL: https://doi.org/10.48550/arXiv.2206.13851.
  13. Todd J. Green, Grigoris Karvounarakis, and Val Tannen. Provenance semirings. In PODS, PODS '07, pages 31-40, New York, NY, USA, 2007. Association for Computing Machinery. URL: https://doi.org/10.1145/1265530.1265535.
  14. Muhammad Idris, Martin Ugarte, and Stijn Vansummeren. The dynamic yannakakis algorithm: Compact and efficient query processing under updates. In SIGMOD, pages 1259-1274, New York, NY, USA, 2017. Association for Computing Machinery. URL: https://doi.org/10.1145/3035918.3064027.
  15. Mahmoud Abo Khamis, Ryan R. Curtin, Benjamin Moseley, Hung Q. Ngo, XuanLong Nguyen, Dan Olteanu, and Maximilian Schleich. Functional aggregate queries with additive inequalities. ACM Trans. Database Syst., 45(4):17:1-17:41, 2020. URL: https://doi.org/10.1145/3426865.
  16. Mahmoud Abo Khamis, Hung Q. Ngo, and Atri Rudra. FAQ: questions asked frequently. In PODS, pages 13-28. ACM, 2016. URL: https://doi.org/10.1145/2902251.2902280.
  17. Dan Olteanu and Maximilian Schleich. Factorized databases. SIGMOD Rec., 45(2):5-16, 2016. URL: https://doi.org/10.1145/3003665.3003667.
  18. Dan Olteanu and Jakub Závodný. Size bounds for factorised representations of query results. ACM Trans. Database Syst., 40(1), mar 2015. URL: https://doi.org/10.1145/2656335.
  19. Mihai Patrascu. Towards polynomial lower bounds for dynamic problems. In Proceedings of the Forty-Second ACM Symposium on Theory of Computing, STOC '10, pages 603-610, New York, NY, USA, 2010. Association for Computing Machinery. URL: https://doi.org/10.1145/1806689.1806772.
  20. Christopher Ré and Dan Suciu. The trichotomy of HAVING queries on a probabilistic database. VLDB J., 18(5):1091-1116, 2009. URL: https://doi.org/10.1007/s00778-009-0151-4.
  21. Thomas Schwentick, Nils Vortmeier, and Thomas Zeume. Dynamic complexity under definable changes. ACM Trans. Database Syst., 43(3):12:1-12:38, 2018. URL: https://doi.org/10.1145/3241040.
  22. Virginia Vassilevska Williams. Hardness of easy problems: Basing hardness on popular conjectures such as the strong exponential time hypothesis (invited talk). In IPEC. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2015. URL: https://doi.org/10.4230/LIPIcs.IPEC.2015.17.
  23. Mihalis Yannakakis. Algorithms for acyclic database schemes. In VLDB, VLDB '81, pages 82-94. VLDB Endowment, 1981. Google Scholar
Questions / Remarks / Feedback
X

Feedback for Dagstuhl Publishing


Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail