Skip to main content

Conjunctive query containment revisited

Extended abstract

  • Contributed Papers
  • Conference paper
  • First Online:
Book cover Database Theory — ICDT '97 (ICDT 1997)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1186))

Included in the following conference series:

Abstract

We consider the problems of conjunctive query containment and minimization, which are known to be NP-complete, and show that these problems can be solved in polynomial time for the class of acyclic queries. We then generalize the notion of acyclicity and define a parameter called query width that captures the “degree of cyclicity” of a query: in particular, a query is acyclic if and only if its query width is 1. We give algorithms for containment and minimization that run in time polynomial in nk, where n is the input size and k is the query width. These algorithms naturally generalize those for acyclic queries, and are of practical significance because many queries have small query width compared to their sizes. We show that we can obtain good bounds on the query width of Q using the treewidth of the incidence graph of Q. Finally, we apply our containment algorithm to the practically important problem of finding equivalent rewritings of a query using a set of materialized views.

Supported by NSF Award CCR-9357849, with matching funds from IBM, Mitsubishi, Schlumberger Foundation, Shell Foundation, and Xerox Corporation.

Supported by NSF grant IRI-92-23405, ARO grant DAAH04-95-1-0192, and USAF contract F33615-93-1-1339.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. A.V. Aho, Y. Sagiv, and J.D. Ullman. Efficient optimization of a class of relational expressions. ACM Transactions on Database Systems, 4(4):435–454, December 1979.

    Google Scholar 

  2. A.V. Aho, Y. Sagiv, and J.D. Ullman. Equivalence of relational expressions. SIAM Journal on Computing, 8(2):218–246, May 1979.

    Google Scholar 

  3. H.L. Bodlaender. A linear time algorithm for finding tree-decompositions of small treewidth. In Proceedings of the 25th ACM Symposium on the Theory of Computing, pages 226–234, 1993.

    Google Scholar 

  4. S. Chaudhuri, R. Krishnamurthy, S. Potamianos, and K. Shim. Optimizing queries with materialized views. In Proceedings of the Eleventh International Conference on Data Engineering, pages 190–200, 1995.

    Google Scholar 

  5. A.K. Chandra and P.M. Merlin. Optimal implementation of conjunctive queries in relational databases. In Proceedings of the Ninth ACM Symposium on Theory of Computing, pages 77–90, 1977.

    Google Scholar 

  6. M.H. Graham. On the universal relation. Technical report, University of Toronto, Ontario, Canada, 1979.

    Google Scholar 

  7. D.S. Johnson and A. Klug. Optimizing conjunctive queries that contain untyped variables. SIAM Journal on Computing, 12(4):616–640, November 1983.

    Google Scholar 

  8. S. Khanna and R. Motwani. Towards a syntactic characterization of PTAS. In Proceedings of the 28th ACM Symposium on the Theory of Computing, 1996.

    Google Scholar 

  9. A.Y. Levy, A.O. Mendelzon, Y. Sagiv, and D. Srivastava. Answering queries using views. In Proceedings of the Fourteenth ACM Symposium on Principles of Database Systems, pages 95–104, 1995.

    Google Scholar 

  10. A.Y. Levy, A. Rajaraman, and J.J. Ordille. Querying heterogeneous information sources using source descriptions. In Proceedings of the 22nd International Conference on Very Large Data Bases, 1996.

    Google Scholar 

  11. A.Y. Levy, A. Rajaraman, and J.D. Ullman. Answering queries using limited external query processors. In Proceedings of the Fifteenth ACM Symposium on Principles of Database Systems, pages 227–237, 1996.

    Google Scholar 

  12. P.A. Larson and H.Z. Yang. Computing queries from derived relations. In Proceedings of the Eleventh International Conference on Very Large Data Bases, pages 259–269, 1985.

    Google Scholar 

  13. X. Qian. Query folding. In Proceedings of the Twelfth International Conference on Data Engineering, 1996.

    Google Scholar 

  14. A. Rajaraman, Y. Sagiv, and J.D. Ullman. Answering queries using templates with binding patterns. In Proceedings of the Fourteenth ACM Symposium on Principles of Database Systems, pages 105–112, 1995.

    Google Scholar 

  15. R.E. Tarjan and M. Yannakakis. Simple linear-time algorithms to test chordality of graphs, test acyclicity of hypergraphs, and selectively reduce acyclic hypergraphs. SIAM Journal on Computing, 13(3):566–579, 1984.

    Google Scholar 

  16. J.D. Ullman. Principles of Database and Knowledge-Base Systems, Volume II: The New Technologies. Computer Science Press, Rockville, MD, 1989.

    Google Scholar 

  17. M. Yannakakis. Algorithms for acyclic database schemes. In Proceedings of the Seventh International Conference on Very Large Data Bases, pages 82–94, 1981.

    Google Scholar 

  18. H.Z. Yang and P.A. Larson. Query transformation for PSJ-queries. In Proceedings of the Thirteenth International Conference on Very Large Data Bases, pages 245–254, 1987.

    Google Scholar 

  19. C.T. Yu and M.Z. Ozsoyoglu. An algorithm for tree-query membership of a distributed query. In Proceedings of IEEE COMPSAC, pages 306–312, 1979.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Foto Afrati Phokion Kolaitis

Rights and permissions

Reprints and permissions

Copyright information

© 1996 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Chekuri, C., Rajaraman, A. (1996). Conjunctive query containment revisited. In: Afrati, F., Kolaitis, P. (eds) Database Theory — ICDT '97. ICDT 1997. Lecture Notes in Computer Science, vol 1186. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-62222-5_36

Download citation

  • DOI: https://doi.org/10.1007/3-540-62222-5_36

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-62222-2

  • Online ISBN: 978-3-540-49682-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics