skip to main content
10.1145/1807085.1807091acmconferencesArticle/Chapter ViewAbstractPublication PagesmodConference Proceedingsconference-collections
research-article

Positive higher-order queries

Published:06 June 2010Publication History

ABSTRACT

We investigate a higher-order query language that embeds operators of the positive relational algebra within the simply-typed λ-calculus. Our language allows one to succinctly define ordinary positive relational algebra queries (conjunctive queries and unions of conjunctive queries) and, in addition, second-order query functionals, which allow the transformation of CQs and UCQs in a generic (i.e., syntax-independent) way. We investigate the equivalence and containment problems for this calculus, which subsumes traditional CQ/UCQ containment. Query functionals are said to be equivalent if the output queries are equivalent, for each possible input query, and similarly for containment. These notions of containment and equivalence depend on the class of (ordinary relational algebra) queries considered. We show that containment and equivalence are decidable when query variables are restricted to positive relational algebra and we identify the precise complexity of the problem. We also identify classes of functionals where containment is tractable. Finally, we provide upper bounds to the complexity of the containment problem when functionals act over other classes.

References

  1. S. Abiteboul, R. Hull, and V. Vianu. Foundations of Databases. Addison-Wesley, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. A. V. Aho, Y. Sagiv, and J. D. Ullman. Efficient optimization of a class of relational expressions. ACM TODS, 4(4), 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. S. Amer-Yahia, S. Cho, and D. Srivastava. Tree Pattern Relaxation. In EDBT, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. J. Avigad. Eliminating Definitions and Skolem Functions in First-order Logic. ACM TOCL, 4(3):402--415, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. F. Bancilhon. On the completeness of query languages for relational data bases. In MFCS, 1978.Google ScholarGoogle ScholarCross RefCross Ref
  6. A. Beckmann. Exact Bounds for Lengths of Reductions in Typed λ-Calculus. J. Symb. Log., 66(3):1277--1285, 2001.Google ScholarGoogle ScholarCross RefCross Ref
  7. M. Benedikt and G. Gottlob. The Impact of Views on Containment, 2010. Manuscript in preparation.Google ScholarGoogle Scholar
  8. M. Benedikt and C. Koch. From XQuery to Relational Logics. ACM TODS, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. P. Buneman and R. Frankel. FQL: a Functional Query Language. In SIGMOD, 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. M. Casanova, R. Fagin, and C. Papadimitriou. Inclusion Dependencies and Their Interaction with Functional Dependencies. JCSS, 28(1):29--59, 1984.Google ScholarGoogle Scholar
  11. B. Cautis, A. Deutsch, and N. Onose. Querying Data Sources that Export Infinite sets of Views. In ICDT, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. A. Chandra and P. Merlin. Optimal Implementation of Conjunctive Queries in Relational Data Bases. In STOC, 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. E. Dantsin, T. Eiter, G. Gottlob, and A. Voronkov. Complexity and Expressive Power of Logic Programming. ACM Comp. Surv., 33(3):374--425, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. G. H. L. Fletcher, M. Gyssens, J. Paredaens, and D. V. Gucht. On the expressive power of the relational algebra on finite sets of relation pairs. IEEE Trans. Knowl. Data Eng., 21(6):939--942, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. G. Gottlob, N. Leone, and F. Scarcello. Hypertree Decompositions and Tractable Queries. JCSS, 64(3):579--627, 2002.Google ScholarGoogle Scholar
  16. G. Gottlob and C. Papadimitriou. On the Complexity of Single-rule Datalog Queries. Inf. Comput., 183(1), 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. G. Hillebrand and P. Kanellakis. Functional Database Query Languages as Typed Lambda Calculi of Fixed Order. In PODS, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. G. Hillebrand, P. Kanellakis, and H. Mairson. Database Query Languages Embedded in the Typed Lambda Calculus. In LICS, 1993.Google ScholarGoogle ScholarCross RefCross Ref
  19. D. S. Johnson and A. C. Klug. Testing Containment of Conjunctive Queries under Functional and Inclusion Dependencies. JCSS, 28(1), 1984.Google ScholarGoogle Scholar
  20. C. Koch. On the Complexity of Nonrecursive XQuery and Functional Query Languages on Complex Values. ACM TODS, 31(4):1215--1256, 2006 Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. N. Koudas, C. Li, A. Tung, and R. Vernica. Relaxing Join and Selection Queries. In VLDB, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. D. Kozen. Lower Bounds for Natural Proof Systems. In FOCS, 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. L. V. S. Lakshmanan, F. Sadri, and I. N. Subramanian. On the logical foundations of schema integration and evolution in heterogeneous database systems. In DOOD, 1993.Google ScholarGoogle ScholarCross RefCross Ref
  24. A. Levy, A. Rajaraman, and J. Ullman. Answering Queries using Limited External Query Processors. In PODS, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. A. Levy and D. Suciu. Deciding Containment for Queries with Complex Objects. In PODS, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. F. Neven, D. Van Gucht, J. Van den Bussche, and G. Vossen. Typed query languages for databases containing queries. In PODS, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. A. Ohori, P. Buneman, and V. Breazu-Tannen. Database programming in Machiavelli|a polymorphic language with static type inference. In SIGMOD, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. J. Paredaens. On the expressive power of the relational algebra. Inf. Process. Lett., 7(2):107--111, 1978.Google ScholarGoogle Scholar
  29. J. Paredaens and D. Van Gucht. Converting Nested Algebra Expressions into Flat Algebra Expressions. ACM TODS, 17(1):65--93, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. K. A. Ross. Relations with relation names as arguments: algebra and calculus. In PODS, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. K. A. Ross. On negation in HiLog. In J. Log. Program., 1994.Google ScholarGoogle ScholarCross RefCross Ref
  32. Y. Sagiv and M. Yannakakis. Equivalences among relational expressions with the union and difference operators. J. ACM, 27(4):633--655, 1980. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. V. Tannen, P. Buneman, and L. Wong. Naturally Embedded Query Languages. In ICDT, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. M. Y. Vardi. The Complexity of Relational Query Languages. In STOC, 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. V. Vassalos and Y. Papakonstantinou. Expressive Capabilities Description Languages and Query Rewriting Algorithms. The Journal of Logic Programming, 43(1):75 -- 122, 2000.Google ScholarGoogle Scholar
  36. S. Vorobyov and A. Voronkov. Complexity of nonrecursive logic programs with complex values. Technical Report MPI-I-97-2-010, Max-Planck Institut fir Informatik, Saarbriicken, November 1997.Google ScholarGoogle Scholar
  37. L. Wong. Kleisli, a functional query system. J. Funct. Program., 10(1):19--56, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. M. Yannakakis. Algorithms for acyclic database schemes. In VLDB, 1981. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Positive higher-order queries

    Recommendations

    Reviews

    Mark L Wambach

    This paper provides additional research on the issue of finding a general way to process database queries and obtain results verifiable in polynomial time. The authors continue the exploration of using lambda calculus [1], adding logical language features to allow certain types of queries to occur without worrying about the specific semantics of the query itself. Their language is completely abstracted from the database attributes and query semantics of traditional, functional database languages. Computer scientists and mathematicians who are interested in the issues of complexity, first-order and second-order logic, relational algebra, and the containment problem as it regards queries are the target audience. The first half of the paper defines the proposed language. It allows positive relational algebra (conjunctive queries and unions of conjunctive queries) within lambda calculus. The normal form for queries and signature and well-formed formulas are defined. After introducing their language, the paper investigates the complexity of various types of queries and whether their complexity makes them tractable or intractable regarding containment. The paper closes by summarizing the related work of various researchers. The authors suggest that their language is unique in its ability to generalize and manage complexity. The authors acknowledge that some other approaches are more complete, making them more powerful than their proposed language. After a relaxed introduction, the paper is formal and research oriented, and includes proofs and analyses of complexity. The summary is informal. The information is worth reading for those interested in query containment and higher-order database queries. Online Computing Reviews Service

    Access critical reviews of Computing literature here

    Become a reviewer for Computing Reviews.

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      PODS '10: Proceedings of the twenty-ninth ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systems
      June 2010
      350 pages
      ISBN:9781450300339
      DOI:10.1145/1807085

      Copyright © 2010 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 6 June 2010

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate476of1,835submissions,26%

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!