Wei F., Lausen G. (2003) Containment of Conjunctive Queries with Safe Negation. In: Calvanese D., Lenzerini M., Motwani R. (eds) Database Theory — ICDT 2003. ICDT 2003. Lecture Notes in Computer Science, vol 2572. Springer, Berlin, Heidelberg
We consider the problem of query containment for conjunctive queries with safe negated subgoals (CQ⌝s). We propose a new method for the containment test of CQ⌝s. Comparing to the previous known approach, which always requires an exponential number of canonical databases to be verified to prove that Q1 ⊑ Q2, the algorithm proposed in this paper exploits the containment mappings of their positive counterparts, and terminates once the specified test succeeds. We show that in the worst case, the algorithm has the same performance as the one proposed in previous work. We also extend our algorithm to unions of CQ⌝s in a natural way. Due to the close relation between query containment and answering queries using views, we give some notes on considering answering queries using views when both queries and views have safe negated subgoals.