🤖 AI Summary
This paper investigates the query containment problem (QCP) under bag semantics, specifically the decidability of conjunctive query (CQ) containment in unions of conjunctive queries (UCQs)—a long-standing open problem. To address the inherent difficulty of characterizing UCQ behavior under bag semantics, we introduce the novel technique of *approximate homomorphisms*, enabling the first asymptotic approximation of a CQ by a UCQ under bag semantics. By integrating query unfolding, instance encoding, and model-theoretic analysis, we establish the decidability of QCP₆ₐ₉(CQ ⊆ UCQ). This result uncovers a fundamental asymmetry: while CQ ⊆ UCQ is decidable under bag semantics, UCQ ⊆ UCQ remains undecidable—resolving a key theoretical gap. Our work fully settles the decidability of bag-semantics CQ containment in UCQs, precisely locating the undecidability threshold of QCP₆ₐ₉ at an ε-neighborhood of the critical boundary.
📝 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 (QCPbag(CQ)) 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 QCPbag(CQ) were identified, as well as some undecidable extensions, including QCPbag(UCQ). 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 D is, in some sense, an approximation of the application of {Phi} to D. Using this technique we could analyze the status of QCPbag 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 QCPbag(UCQ) into a proof of undecidability of QCPbag(CQ). And, as you are going to see, we got stopped just one infinitely small {epsilon} before reaching this ultimate goal.