skip to main content
10.1145/2594538.2594559acmconferencesArticle/Chapter ViewAbstractPublication PagespodsConference Proceedingsconference-collections
research-article

Counting solutions to conjunctive queries: structural and hybrid tractability

Published:18 June 2014Publication History

ABSTRACT

Counting the number of answers to conjunctive queries is an intractable problem, formally #P-hard, even over classes of acyclic queries. However, Durand and Mengel have recently introduced the notion of quantified star size that, combined with hypertree decompositions, identifies islands of tractability for the problem. They also wonder whether such a notion precisely characterizes those classes for which the counting problem is tractable. We show that this is the case only for bounded-arity simple queries, where relation symbols cannot be shared by different query atoms. Indeed, we give a negative answer to the question in the general case, by exhibiting a more powerful structural method based on the novel concept of #-generalized hypertree decomposition. On classes of queries with bounded #-generalized hypertree width, counting answers is shown to be feasible in polynomial time, after a fixed-parameter polynomial-time preprocessing that only depends on the query structure. A weaker variant (but still more general than the technique based on the quantified starsize) is also proposed, for which tractability is established without any exponential dependency on the query size. Based on #-generalized hypertree decompositions, a hybrid decomposition method is eventually conceived, where structural properties of the query are exploited in combination with properties of the given database, such as keys or other (weaker) dependencies among attributes that limit the allowed combinations of values. Intuitively, such features may induce different structural properties that are not identified by the worst-possible database perspective of purely structural methods.

References

  1. S. Abiteboul, R. Hull, and V. Vianu. Foundations of Databases. Addison-Wesley, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. . Adler, G. Gottlob, and M. Grohe. Hypertree-Width and Related Hypergraph Invariants. European Journal of Combinatorics, 28, pp. 2167--2181, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. . Atserias, M. Grohe, and D. Marx. Size bounds and query plans for relational joins. SIAM Journal on Computing, 42(4):1737--1767, 2013.Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. . Bagan, A. Durand, and E. Grandjean. On acyclic conjunctive queries and constant delay enumeration. In phProc. of CSL'07, pp. 208--222, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. . Bulatov, V. Dalmau, M. Grohe, and D. Marx. Enumerating Homomorphisms. phJournal of Computer and System Sciences, 78(2): 638--650, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. .A. Bernstein and N. Goodman. The power of natural semijoins. SIAM Journal on Computing, 10(4), pp. 751--771, 1981.Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. .A. Bulatov. The complexity of the counting constraint satisfaction problem. Journal of the ACM, 60(5), Article 34, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. .A. Bulatov, M. Dyer, L.A. Goldberg, M. Jerrum, and C. Mcquillan. The expressibility of functions on the boolean domain, with applications to counting CSPs. Journal of the ACM, 60(5), Article 32, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. . Chekuri and A. Rajaraman. Conjunctive query containment revisited. Theoretical Computer Science, 239(2), pp. 211--229, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. .A. Cohen, M.C. Cooper, P. Creed, D. Marx, and A.Z. Salamon. The tractability of CSP classes defined by forbidden patterns. phJournal of Artificial Intelligence Research, 45:47--78, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. .C. Cooper, P.G. Jeavons, and A.Z. Salamon. Generalizing constraint satisfaction on trees: Hybrid tractability and variable elimination. phArtificial Intelligence, 174(9--10):570--584, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. . Dalmau and P. Jonsson. The complexity of counting homomorphisms seen from the other side. phTheor. Computer Science, 329(1--3), pp. 315--323, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. . Downey and M. Fellows. Parameterized Complexity. Springer, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. A.Durand and S. Mengel. Structural Tractability of Counting of Solutions to Conjunctive Queries. In Proc. of ICDT'13, pp. 81--92, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. . Fagin. Degrees of acyclicity for hypergraphs and relational database schemes. Journal of the ACM, 30(3):514--550, 1983. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. . Flum, M. Frick, and M. Grohe. Query evaluation via tree-decompositions. Journal of the ACM, 49(6):716--752, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. . Flum and M. Grohe. The parameterized complexity of counting problems, phSIAM Journal on Computing, 33:892--922, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. .P. Gomes, W.J. Van Hoeve, A. Sabharwal, and B. Selman. Counting CSP solutions using generalized XOR constraints. In Proc. of AAAI'07, pp. 204--209. %, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. . Gottlob, N. Leone, and F. Scarcello. Hypertree decompositions and tractable queries. Journal of Computer and System Sciences, 64(3):579--627, 2002.Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. . Gottlob, S. Tien Lee, G. Valiant, and P. Valiant. Size and Treewidth Bounds for Conjunctive Queries. phJournal of the ACM, 59(3), 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. . Gottlob, N. Leone, and F. Scarcello. Robbers, marshals, and guards: game theoretic and logical characterizations of hypertree width. Journal of Computer and System Sciences, 66(4):775--808, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. . Gottlob, Z. Miklós, and T. Schwentick. Generalized hypertree decompositions: NP-hardness and tractable variants. Journal of the ACM, 56(6), Article 16, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. . Goodman and O. Shmueli. The tree projection theorem and relational query processing. Journal of Computer and System Sciences, 29(3):767--786, 1984.Google ScholarGoogle Scholar
  24. . Ghionna, L.Granata, G. Greco, and F. Scarcello.Hypertree Decompositions for Query Optimization.In Proc. of ICDE '07, pp. 36--45, 2007.Google ScholarGoogle Scholar
  25. . Greco and F. Scarcello. Structural tractability of enumerating CSP solutions. Constraints, 18(1):8--74, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. . Greco and F. Scarcello. The power of tree projections: local consistency, greedy algorithms, and larger islands of tractability. In Proc. of PODS'10, pp. 327--338, 2010. Full version available as CoRR technical report ph1205.3321. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. . Greco and F. Scarcello. Tree Projections: Hypergraph Games and Minimality. In Proc. of ICALP'08, pp. 736--747, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. . Grohe. The complexity of homomorphism and constraint satisfaction problems seen from the other side. Journal of the ACM, 54(1), Article 1, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. . Grohe and D. Marx. Constraint solving via fractional edge covers. In Proc. of SODA'06, pp. 289--298, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. . Koch. Processing queries on tree-structured data efficiently. In phProc. of PODS'06, pp. 213--224, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. . Kimelfeld and Y. Sagiv. Incrementally computing ordered answers of acyclic conjunctive formulas. In Proc. of NGITS'06, pp. 33--38, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. . Marx. Approximating fractional hypertree width. ACM Tran. on Algorithms, 6(2), Article 29, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. . Marx. Tractable Hypergraph Properties for Constraint Satisfaction and Conjunctive Queries. In phProc. of STOC'10, pp. 735--744, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. . Pesant. Counting solutions of CSPs: a structural approach. In Proc. of IJCAI'05, pp. 260--265, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. . Pichler and A. Skritek. Tractable Counting of the Answers to Conjunctive Queries. phJournal of Computer and System Sciences, 79(6):984--1001, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. . Robertson and P.D. Seymour. Graph minors III: Planar tree-width. Journal of Combinatorial Theory, Series B, 36:49--64, 1984.Google ScholarGoogle ScholarCross RefCross Ref
  37. . Robertson and P.D. Seymour. Graph minors V: Excluding a planar graph. Journal of Combinatorial Theory, Series B, 41:92--114, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. . Saccà, E. Serra, and A. Guzzo. Count Constraints and the Inverse OLAP Problem: Definition, Complexity and a Step toward Aggregate Data Exchange.In Proc. of FOIKS'12, pp. 352--369, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. . Scarcello, G. Greco, and N. Leone. Weighted Hypertree Decompositions and Optimal Query Plans. In Proc. of PODS'04, pp. 210--221, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. . D. Ullman. Principles of Database and Knowledge Base Systems. Computer Science Press, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. M. Yannakakis. Algorithms for acyclic database schemes. In Proc. of VLDB'81, pp. 82--94, 1981. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Counting solutions to conjunctive queries: structural and hybrid tractability

      Recommendations

      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 '14: Proceedings of the 33rd ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systems
        June 2014
        300 pages
        ISBN:9781450323758
        DOI:10.1145/2594538
        • General Chair:
        • Richard Hull,
        • Program Chair:
        • Martin Grohe

        Copyright © 2014 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 18 June 2014

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        PODS '14 Paper Acceptance Rate22of67submissions,33%Overall Acceptance Rate642of2,707submissions,24%

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader