Database Theory — ICDT 2003

Volume 2572 of the series Lecture Notes in Computer Science pp 346-360


Containment of Conjunctive Queries with Safe Negation

  • Fang WeiAffiliated withUniversity of Freiburg, Institute for Computer Science
  • , Georg LausenAffiliated withUniversity of Freiburg, Institute for Computer Science

* Final gross prices may vary according to local VAT.

Get Access


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 Q 1Q 2, 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.