English

Bag Semantics Query Containment: The CQ vs. UCQ Case and Other Stories

Databases 2025-06-03 v3

Abstract

Query Containment Problem (QCP) is a fundamental decision problem in query processing and optimization. While QCP has for a long time been completely understood for the case of set semantics, decidability of QCP for conjunctive queries under multi-set semantics (QCPCQbagQCP_{\text{CQ}}^{\text{bag}}) remains one of the most intriguing open problems in database theory. Certain effort has been put, in last 30 years, to solve this problem and some decidable special cases of QCPCQbagQCP_{\text{CQ}}^{\text{bag}} were identified, as well as some undecidable extensions, including QCPUCQbagQCP_{\text{UCQ}}^{\text{bag}}. In this paper we introduce a new technique which produces, for a given UCQ Φ\Phi, a CQ ϕ\phi such that the application of ϕ\phi to a database DD is, in some sense, an approximation of the application of Φ\Phi to DD. Using this technique we could analyze the status of QCPbagQCP^{\text{bag}} when one of the queries in question is a CQ and the other is a UCQ, and we reached conclusions which surprised us a little bit. We also tried to use this technique to translate the known undecidability proof for QCPUCQbagQCP_{\text{UCQ}}^{\text{bag}} into a proof of undecidability of QCPCQbagQCP_{\text{CQ}}^{\text{bag}}. And, as you are going to see, we got stopped just one infinitely small ε\varepsilon before reaching this ultimate goal.

Keywords

Cite

@article{arxiv.2503.07219,
  title  = {Bag Semantics Query Containment: The CQ vs. UCQ Case and Other Stories},
  author = {Jerzy Marcinkowski and Piotr Ostropolski-Nalewaja},
  journal= {arXiv preprint arXiv:2503.07219},
  year   = {2025}
}

Comments

Expanded explanations to provide better intuitions