Bag Containment of Join-On-Free Queries

Authors George Konstantinidis , Fabio Mogavero



PDF
Thumbnail PDF

File

LIPIcs.ICDT.2025.5.pdf
  • Filesize: 0.86 MB
  • 18 pages

Document Identifiers

Author Details

George Konstantinidis
  • University of Southampton, UK
Fabio Mogavero
  • Università degli Studi di Napoli Federico II, Italy

Acknowledgements

We would like to thank the anonymous reviewers for their insightful comments (e.g., regarding the connection with the Möbius inversion formula) that considerably improved the paper.

Cite As Get BibTex

George Konstantinidis and Fabio Mogavero. Bag Containment of Join-On-Free Queries. In 28th International Conference on Database Theory (ICDT 2025). Leibniz International Proceedings in Informatics (LIPIcs), Volume 328, pp. 5:1-5:18, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2025) https://doi.org/10.4230/LIPIcs.ICDT.2025.5

Abstract

Bag-semantics allows for atomic relations and query answers to contain multiple copies of the same data tuple, reflecting real-world database systems more accurately. Deciding containment under bag-semantics (or simply, bag-containment) for two conjunctive queries (CQs) requires determining whether the answer of the first query, taking multiplicities into account, is contained within the answer of the second query, across all databases. Despite numerous attempts in the last thirty years, this problem of determining decidability and complexity of this task remains open as one of the prominent challenges in database theory, given its relevance in important applications.
Previous works have established the decidability of the problem for specific classes of queries, among which is the the bag-containment of projection-free queries (PFQs), i.e., queries without existentially quantified variables, into general CQs. In this work, we push the boundaries further by addressing a broader, yet natural, fragment of CQs, called join-on-free queries (JoFQ), which allows existential variables, while prohibiting joins involving them. We prove decidability of bag-containment of a JoFQ within a general CQ, placing the complexity of the problem in the first non-deterministic layer of the exponential hierarchy. The approach involves a homomorphism-counting reduction to the solution of a system of Diophantine inequalities with a specific structure (an undecidable problem in its general form) and an algorithm designed to address this category of inequalities.

Subject Classification

ACM Subject Classification
  • Theory of computation → Database query languages (principles)
  • Theory of computation → Database query processing and optimization (theory)
  • Theory of computation → Logic and databases
  • Mathematics of computing → Combinatorics
Keywords
  • Query Containment
  • Bag Semantics
  • Bag Containment
  • Diophantine Problems

Metrics

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

References

  1. S. Abiteboul, R. Hull, and V. Vianu. Foundations of Databases. Addison-Wesley, 1995. Google Scholar
  2. F.N. Afrati, M. Damigos, and M. Gergatsoulis. Query Containment under Bag and Bag-Set Semantics. IPL, 110(10):360-369, 2010. URL: https://doi.org/10.1016/J.IPL.2010.02.017.
  3. R.J. Brachman and H.J. Levesque. Knowledge Representation and Reasoning. Morgan Kaufmann, 2004. Google Scholar
  4. A.K. Chandra and P.M. Merlin. Optimal Implementation of Conjunctive Queries in Relational Data Bases. In STOC'77, pages 77-90. ACM, 1977. URL: https://doi.org/10.1145/800105.803397.
  5. S. Chaudhuri and M.Y. Vardi. Optimization of Real Conjunctive Queries. In PODS'93, pages 59-70. ACM, 1993. Google Scholar
  6. R. Chirkova. Equivalence and Minimization of Conjunctive Queries under Combined Semantics. In ICDT'12, pages 262-273. OpenProceedings.org, 2012. Google Scholar
  7. R. Chirkova. Combined-Semantics Equivalence and Minimization of Conjunctive Queries. TCJ, 57(5):775-795, 2014. URL: https://doi.org/10.1093/COMJNL/BXT032.
  8. R. Chirkova. Combined-Semantics Equivalence of Conjunctive Queries: Decidability and Tractability Results. JCSS, 82(3):395-465, 2016. URL: https://doi.org/10.1016/J.JCSS.2015.11.001.
  9. S. Cohen. Equivalence of Queries Combining Set and Bag-Set Semantics. In PODS'06, pages 70-79. ACM, 2006. URL: https://doi.org/10.1145/1142351.1142362.
  10. S. Cohen. Equivalence of Queries that are Sensitive to Multiplicities. PVLDB, 18(3):765-785, 2009. URL: https://doi.org/10.1007/S00778-008-0122-1.
  11. M. Davis. Hilbert’s Tenth Problem is Unsolvable. AMM, 80(3):233-269, 1973. Google Scholar
  12. S. Grumbach and T. Milo. Towards Tractable Algebras for Bags. JCSS, 52(3):570-588, 1996. URL: https://doi.org/10.1006/JCSS.1996.0042.
  13. H. Grunert and A. Heuer. Query Rewriting by Contract under Privacy Constraints. OJIOT, 4(1):54-69, 2018. URL: https://www.ronpub.com/ojiot/OJIOT_2018v4i1n05_Grunert.html.
  14. Y.E. Ioannidis and R. Ramakrishnan. Containment of Conjunctive Queries: Beyond Relations as Sets. TODS, 20(3):288-324, 1995. URL: https://doi.org/10.1145/211414.211419.
  15. Y.E. Ioannidis and E. Wong. Towards an Algebraic Theory of Recursion. JACM, 38(2):329-381, 1991. URL: https://doi.org/10.1145/103516.103521.
  16. T.S. Jayram, P.G. Kolaitis, and E. Vee. The Containment Problem for Real Conjunctive Queries with Inequalities. In PODS'06, pages 80-89. ACM, 2006. URL: https://doi.org/10.1145/1142351.1142363.
  17. M.A. Khamis, P.G. Kolaitis, H.Q. Ngo, and D. Suciu. Bag Query Containment and Information Theory. In PODS'20, pages 95-112. ACM, 2020. URL: https://doi.org/10.1145/3375395.3387645.
  18. M.A. Khamis, P.G. Kolaitis, H.Q. Ngo, and D. Suciu. Bag Query Containment and Information Theory. TODS, 46(3):1-39, 2021. URL: https://doi.org/10.1145/3472391.
  19. M.A. Khamis, H.Q. Ngo, and A. Rudra. FAQ: Questions Asked Frequently. In PODS'16, pages 13-28. ACM, 2016. URL: https://doi.org/10.1145/2902251.2902280.
  20. P.G. Kolaitis. The Query Containment Problem: Set Semantics vs. Bag Semantics. In AMW'13, CEUR-WS 1949, 2013. Google Scholar
  21. G. Konstantinidis and J.L. Ambite. Scalable Query Rewriting: A Graph-Based Approach. In SIGMOD'11, pages 97-108. ACM, 2011. URL: https://doi.org/10.1145/1989323.1989335.
  22. G. Konstantinidis and J.L. Ambite. Scalable Containment for Unions of Conjunctive Queries under Constraints. In SWIM'13, pages 4:1-8. ACM, 2013. URL: https://doi.org/10.1145/2484712.2484716.
  23. G. Konstantinidis, J. Holt, and A. Chapman. Enabling Personal Consent in Databases. PVLDB, 15(2):375-387, 2021. URL: https://doi.org/10.14778/3489496.3489516.
  24. G. Konstantinidis and F. Mogavero. Attacking Diophantus: Solving a Special Case of Bag Containment. In PODS'19, pages 399-413. ACM, 2019. URL: https://doi.org/10.1145/3294052.3319689.
  25. S. Kopparty and B. Rossman. The Homomorphism Domination Exponent. EJC, 32(7):1097-1114, 2011. URL: https://doi.org/10.1016/J.EJC.2011.03.009.
  26. A.Y. Levy, A.O. Mendelzon, Y. Sagiv, and D. Srivastava. Answering Queries Using Views. In PODS'95, pages 95-104. ACM, 1995. Google Scholar
  27. A. Machanavajjhala and J. Gehrke. On the Efficiency of Checking Perfect Privacy. In PODS'06, pages 163-172. ACM, 2006. URL: https://doi.org/10.1145/1142351.1142375.
  28. J. Marcinkowski and M. Orda. Bag Semantics Conjunctive Query Containment. Four Small Steps Towards Undecidability. PACMMOD, 2(2):103, 2024. URL: https://doi.org/10.1145/3651604.
  29. Y. Matiyasevich. Hilbert’s 10th Problem. MIT Press, 1993. Google Scholar
  30. J. Robinson. Solving Diophantine Equations. In Studies in Logic and the Foundations of Mathematics, volume 74, pages 63-67. Elsevier, 1973. Google Scholar
  31. G. Rota. On the Foundations of Combinatorial Theory I. Theory of Möbius Functions. In Classic Papers in Combinatorics, volume 2, pages 340-368. Springer, 1964. Google Scholar
  32. A. Schrijver. Theory of Linear and Integer Programming. Wiley, 1986. Google Scholar
  33. R.P. Stanley. Enumerative Combinatorics: Volume 1. CUP, 2011. 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