A Trichotomy in the Complexity of Counting Answers to Conjunctive Queries

Authors Hubie Chen, Stefan Mengel

Thumbnail PDF


  • Filesize: 0.51 MB
  • 17 pages

Document Identifiers

Author Details

Hubie Chen
Stefan Mengel

Cite AsGet BibTex

Hubie Chen and Stefan Mengel. A Trichotomy in the Complexity of Counting Answers to Conjunctive Queries. In 18th International Conference on Database Theory (ICDT 2015). Leibniz International Proceedings in Informatics (LIPIcs), Volume 31, pp. 110-126, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2015)


Conjunctive queries are basic and heavily studied database queries; in relational algebra, they are the select-project-join queries. In this article, we study the fundamental problem of counting, given a conjunctive query and a relational database, the number of answers to the query on the database. In particular, we study the complexity of this problem relative to sets of conjunctive queries. We present a trichotomy theorem, which shows essentially that this problem on a set of conjunctive queries is either tractable, equivalent to the parameterized CLIQUE problem, or as hard as the parameterized counting CLIQUE problem; the criteria describing which of these situations occurs is simply stated, in terms of graph-theoretic conditions.
  • database theory
  • query answering
  • conjunctive queries
  • counting complexity


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. S. Abiteboul, R. Hull, and V. Vianu. Foundations of Databases. Addison-Wesley, 1995. Google Scholar
  2. A.K. Chandra and P.M. Merlin. Optimal implementation of conjunctive queries in relational data bases. In STOC 1977, pages 77-90. ACM, 1977. Google Scholar
  3. Hubie Chen. The tractability frontier of graph-like first-order query sets. CoRR, abs/1407.3429v1, 2014. Conference version appeared in the proceedings of LICS '14. Google Scholar
  4. Hubie Chen and Martin Grohe. Constraint satisfaction with succinctly specified relations. J. Comput. Syst. Sci., 76(8):847-860, 2010. Google Scholar
  5. Hubie Chen and Moritz Müller. One hierarchy spawns another: Graph deconstructions and the complexity classification of conjunctive queries. In LICS, 2014. Google Scholar
  6. V. Dalmau and P. Jonsson. The complexity of counting homomorphisms seen from the other side. Theor. Comput. Sci., 329(1-3):315-323, 2004. Google Scholar
  7. V. Dalmau, P.G. Kolaitis, and M.Y. Vardi. Constraint Satisfaction, Bounded Treewidth, and Finite-Variable Logics. In International Conference on Principles and Practice of Constraint Programming 2002, pages 310-326, 2002. Google Scholar
  8. A. Durand and S. Mengel. Structural tractability of counting of solutions to conjunctive queries. Theory of Computing Systems, pages 1-48, 2014. accepted, to appear, final version available at http://dx.doi.org/10.1007/s00224-014-9543-y. Google Scholar
  9. J. Flum and M. Grohe. Parameterized Complexity Theory. Texts in Theoretical Computer Science. An EATCS Series, 2006. Google Scholar
  10. Georg Gottlob, Nicola Leone, and Francesco Scarcello. Hypertree decompositions and tractable queries. J. Comput. Syst. Sci., 64(3):579-627, 2002. Google Scholar
  11. Gianluigi Greco and Francesco Scarcello. Counting solutions to conjunctive queries: structural and hybrid tractability. In Proceedings of the 33rd ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, PODS'14, pages 132-143, 2014. Google Scholar
  12. M. Grohe. The complexity of homomorphism and constraint satisfaction problems seen from the other side. J. ACM, 54(1), 2007. Google Scholar
  13. P. Kolaitis and M. Vardi. Conjunctive-Query Containment and Constraint Satisfaction. Journal of Computer and System Sciences, 61:302-332, 2000. Google Scholar
  14. Dániel Marx. Tractable hypergraph properties for constraint satisfaction and conjunctive queries. J. ACM, 60(6):42, 2013. Google Scholar
  15. S. Mengel. Conjunctive Queries, Arithmetic Circuits and Counting Complexity. PhD thesis, University of Paderborn, 2013. Google Scholar
  16. C. Papadimitriou and M. Yannakakis. On the Complexity of Database Queries. Journal of Computer and System Sciences, 58(3):407-427, 1999. Google Scholar
  17. R. Pichler and S. Skritek. Tractable counting of the answers to conjunctive queries. Journal of Computer and System Sciences, 2013. Google Scholar
  18. Nicole Schweikardt, Thomas Schwentick, and Luc Segoufin. Database theory: Query languages. In Mikhail J. Atallah and Marina Blanton, editors, Algorithms and Theory of Computation Handbook, volume 2: Special Topics and Techniques, chapter 19. CRC Press, second edition, Nov 2009. Google Scholar
Questions / Remarks / Feedback

Feedback for Dagstuhl Publishing

Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail