Conjunctive query containment revisited

Extended abstract
  • Chandra Chekuri
  • Anand Rajaraman
Contributed Papers Session 1: Conjunctive Queries in Heterogeneneous Databases
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1186)

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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [ASU79a]
    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. [ASU79b]
    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. [Bod93]
    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. [CKPS95]
    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. [CM77]
    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. [Gra79]
    M.H. Graham. On the universal relation. Technical report, University of Toronto, Ontario, Canada, 1979.Google Scholar
  7. [JK83]
    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. [KM96]
    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. [LMSS95]
    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. [LRO96]
    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. [LRU96]
    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. [LY85]
    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. [Qia96]
    X. Qian. Query folding. In Proceedings of the Twelfth International Conference on Data Engineering, 1996.Google Scholar
  14. [RSU95]
    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. [TY84]
    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. [Ull89]
    J.D. Ullman. Principles of Database and Knowledge-Base Systems, Volume II: The New Technologies. Computer Science Press, Rockville, MD, 1989.Google Scholar
  17. [Yan81]
    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. [YL87]
    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. [YO79]
    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

Copyright information

© Springer-Verlag 1997

Authors and Affiliations

  • Chandra Chekuri
    • 1
  • Anand Rajaraman
    • 1
  1. 1.Department of Computer ScienceStanford UniversityUSA

Personalised recommendations