Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

Conjunctive Queries with Negation and Aggregation: A Linear Time Characterization

Published: 14 May 2024 Publication History

Abstract

In this paper, we study the complexity of evaluating Conjunctive Queries with negation (\cqneg). First, we present an algorithm with linear preprocessing time and constant delay enumeration for a class of CQs with negation called free-connex signed-acyclic queries. We show that no other queries admit such an algorithm subject to lower-bound conjectures. Second, we extend our algorithm to Conjunctive Queries with negation and aggregation over a general semiring, which we call Functional Aggregate Queries with negation (\faqneg). Such an algorithm achieves constant delay enumeration for the same class of queries but with a slightly increased preprocessing time, which includes an inverse Ackermann function. We show that this surprising appearance of the Ackermmann function is probably unavoidable for general semirings but can be removed when the semiring has a specific structure. Finally, we show an application of our results to computing the difference of CQs.

References

[1]
Amir Abboud, Karl Bringmann, Holger Dell, and Jesper Nederlof. More consequences of falsifying SETH and the orthogonal vectors conjecture. In STOC, pages 253--266. ACM, 2018.
[2]
Mahmoud Abo Khamis, Hung Q. Ngo, and Dan Suciu. What do shannon-type inequalities, submodular width, and disjunctive datalog have to do with one another? In Proceedings of the 36th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, PODS '17, page 429--444, New York, NY, USA, 2017. ACM.
[3]
Guillaume Bagan, Arnaud Durand, and Etienne Grandjean. On acyclic conjunctive queries and constant delay enumeration. In CSL, volume 4646 of Lecture Notes in Computer Science, pages 208--222. Springer, 2007.
[4]
Christoph Berkholz, Fabian Gerhardt, and Nicole Schweikardt. Constant delay enumeration for conjunctive queries: a tutorial. ACM SIGLOG News, 7(1):4--33, 2020.
[5]
Johann Brault-Baron. A negative conjunctive query is easy if and only if it is beta-acyclic. In CSL, volume 16 of LIPIcs, pages 137--151. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2012.
[6]
Johann Brault-Baron. De la pertinence de l'énumération : complexité en logiques propositionnelle et du premier ordre. PhD thesis, University of Caen Normandy, France, 2013.
[7]
Johann Brault-Baron. Hypergraph acyclicity revisited. ACM Comput. Surv., 49(3), Dec 2016.
[8]
Andries E Brouwer and Antoon W. J. Kolen. A super-balanced hypergraph has a nest point. Technical report, Math. centr. report ZW146, Amsterdam, 1980.
[9]
Florent Capelli and Oliver Irwin. Direct access for conjunctive queries with negation. 27th International Conference on Database Theory, ICDT 2024, March 25--28, 2024, Paestum, Italy, pages 13:1--13:20, 2024.
[10]
Nofar Carmeli and Markus Kröll. On the enumeration complexity of unions of conjunctive queries. ACM Trans. Database Syst., 46(2), May 2021.
[11]
B. Chazelle and B. Rosenberg. Computing partial sums in multidimensional arrays. In Proceedings of the Fifth Annual Symposium on Computational Geometry, SCG '89, page 131--139, New York, NY, USA, 1989. ACM.
[12]
Bernard Chazelle and Burton Rosenberg. The complexity of computing partial sums off-line. Int. J. Comput. Geom. Appl., 1(1):33--45, 1991.
[13]
Austen Z. Fan, Paraschos Koutris, and Hangdong Zhao. The fine-grained complexity of boolean conjunctive queries and sum-product problems. In ICALP, volume 261 of LIPIcs, pages 127:1--127:20, 2023.
[14]
François Le Gall. Powers of tensors and fast matrix multiplication. In ISSAC, pages 296--303. ACM, 2014.
[15]
Etienne Grandjean and Louis Jachiet. Which arithmetic operations can be performed in constant time in the RAM model with addition? CoRR, abs/2206.13851, 2022.
[16]
Juris Hartmanis and Janos Simon. On the power of multiplication in random access machines. In SWAT, pages 13--23. IEEE Computer Society, 1974.
[17]
Xiao Hu and Qichen Wang. Computing the difference of conjunctive queries efficiently. Proc. ACM Manag. Data, 2023.
[18]
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), 2020.
[19]
Mahmoud Abo Khamis, Hung Q. Ngo, and Atri Rudra. FAQ: questions asked frequently. In Tova Milo and Wang-Chiew Tan, editors, Proceedings of the 35th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, PODS 2016, San Francisco, CA, USA, June 26 - July 01, 2016, pages 13--28. ACM, 2016.
[20]
Matthias Lanzinger. Tractability beyond ß-acyclicity for conjunctive queries with negation. In PODS 2021, pages 355--369. ACM, 2021.
[21]
Ran Raz. On the complexity of matrix product. SIAM J. Comput., 32(5):1356--1369, 2003.
[22]
Janos Simon and Mario Szegedy. On the complexity of RAM with various operation sets. In STOC, pages 624--631. ACM, 1992.
[23]
Virginia Vassilevska Williams. Multiplying matrices faster than coppersmith-winograd. In STOC, pages 887--898, 2012.
[24]
Mihalis Yannakakis. Algorithms for acyclic database schemes. In VLDB, pages 82--94. IEEE Computer Society, 1981.
[25]
Andrew Chi-Chih Yao. Space-time tradeoff for answering range queries (extended abstract). In STOC, pages 128--136. ACM, 1982.
[26]
Andrew Chi-Chih Yao. On the complexity of maintaining partial sums. SIAM J. Comput., 14(2):277--288, 1985.
[27]
Hangdong Zhao, Austen Z. Fan, Xiating Ouyang, and Paraschos Koutris. Conjunctive queries with negation and aggregation: A linear time characterization. CoRR, abs/2310.05385, 2023.

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Management of Data
Proceedings of the ACM on Management of Data  Volume 2, Issue 2
PODS
May 2024
852 pages
EISSN:2836-6573
DOI:10.1145/3665155
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution International 4.0 License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 14 May 2024
Published in PACMMOD Volume 2, Issue 2

Author Tags

  1. aggregation
  2. negation
  3. query optimization
  4. range queries.
  5. signed-acyclicity

Qualifiers

  • Research-article

Funding Sources

  • NSf

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 108
    Total Downloads
  • Downloads (Last 12 months)108
  • Downloads (Last 6 weeks)32
Reflects downloads up to 03 Oct 2024

Other Metrics

Citations

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media