Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
129 tokens/sec
GPT-4o
28 tokens/sec
Gemini 2.5 Pro Pro
42 tokens/sec
o3 Pro
4 tokens/sec
GPT-4.1 Pro
38 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Counting Solutions to Conjunctive Queries: Structural and Hybrid Tractability (2311.14579v2)

Published 24 Nov 2023 in cs.DB and cs.AI

Abstract: Counting the number of answers to conjunctive queries is a fundamental problem in databases that, under standard assumptions, does not have an efficient solution. The issue is inherently #P-hard, extending even to classes of acyclic instances. To address this, we pinpoint tractable classes by examining the structural properties of instances and introducing the novel concept of #-hypertree decomposition. We establish the feasibility of counting answers in polynomial time for classes of queries featuring bounded #-hypertree width. Additionally, employing novel techniques from the realm of fixed-parameter computational complexity, we prove that, for bounded arity queries, the bounded #-hypertree width property precisely delineates the frontier of tractability for the counting problem. This result closes an important gap in our understanding of the complexity of such a basic problem for conjunctive queries and, equivalently, for constraint satisfaction problems (CSPs). Drawing upon #-hypertree decompositions, a ''hybrid'' decomposition method emerges. This approach leverages both the structural characteristics of the query and properties intrinsic to the input database, including keys or other (weaker) degree constraints that limit the permissible combinations of values. Intuitively, these features may introduce distinct structural properties that elude identification through the ''worst-possible database'' perspective inherent in purely structural methods.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (53)
  1. Foundations of Databases. Addison-Wesley, 1995.
  2. Hypertree-Width and Related Hypergraph Invariants. European Journal of Combinatorics, 28, pp. 2167–2181, 2007.
  3. Counting the Answers to a Query. SIGMOD Rec., 51(3):6–17, 2022.
  4. When is approximate counting for conjunctive queries tractable? In Proc. of STOC’21, pp. 1015–1027, 2021.
  5. #NFA Admits an FPRAS: Efficient Enumeration, Counting, and Uniform Generation for Logspace Classes. J. ACM, 68(6):48:1–48:40, 2021.
  6. Answering conjunctive queries under updates. In Emanuel Sallinger, Jan Van den Bussche, and Floris Geerts, editors, Proceedings of the 36th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, PODS 2017, Chicago, IL, USA, May 14-19, 2017, pages 303–318. ACM, 2017.
  7. Answering ucqs under updates and in the presence of integrity constraints. In Benny Kimelfeld and Yael Amsterdamer, editors, 21st International Conference on Database Theory, ICDT 2018, March 26-29, 2018, Vienna, Austria, volume 98 of LIPIcs, pages 8:1–8:19. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2018.
  8. P.A. Bernstein and N. Goodman. The power of natural semijoins. SIAM Journal on Computing, 10(4), pp. 751–771, 1981.
  9. A.A. Bulatov. The complexity of the counting constraint satisfaction problem. Journal of the ACM, 60(5), Article 34, 2013.
  10. The expressibility of functions on the boolean domain, with applications to counting CSPs. Journal of the ACM, 60(5), Article 32, 2013.
  11. Optimal implementation of conjunctive queries in relational data bases. In STOC 1977, pages 77–90. ACM, 1977.
  12. H. 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.
  13. C. Chekuri and A. Rajaraman. Conjunctive query containment revisited. Theoretical Computer Science, 239(2), pp. 211–229, 2000.
  14. A trichotomy in the complexity of counting answers to conjunctive queries. In Marcelo Arenas and Martín Ugarte, editors, 18th International Conference on Database Theory, ICDT 2015, March 23-27, 2015, Brussels, Belgium, volume 31 of LIPIcs, pages 110–126. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2015.
  15. Counting answers to existential positive queries: A complexity classification. In Tova Milo and Wang-Chiew Tan, editors, Proceedings of the 35th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, PODS 2016, San Francisco, CA, USA, June 26 - July 01, 2016, pages 315–326. ACM, 2016.
  16. The logic of counting query answers. In 32nd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2017, Reykjavik, Iceland, June 20-23, 2017, pages 1–12. IEEE Computer Society, 2017.
  17. Beyond Hypertree Width: Decomposition Methods Without Decompositions. In Proc. of CP’05, pp. 167–181, 2005.
  18. Counting answers to existential questions. In Christel Baier, Ioannis Chatzigiannakis, Paola Flocchini, and Stefano Leonardi, editors, 46th International Colloquium on Automata, Languages, and Programming, ICALP 2019, July 9-12, 2019, Patras, Greece, volume 132 of LIPIcs, pages 113:1–113:15. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2019.
  19. R. Downey and M. Fellows. Parameterized Complexity. Springer, 1999.
  20. R. Fagin. Degrees of acyclicity for hypergraphs and relational database schemes. Journal of the ACM, 30(3):514–550, 1983.
  21. Answer Counting Under Guarded TGDs. Log. Methods Comput. Sci., 19(3), 2023.
  22. Query evaluation via tree-decompositions. Journal of the ACM, 49(6):716–752, 2002.
  23. Approximately counting answers to conjunctive queries with disequalities and negations. In Proc. of PODS’22, pp. 315–324, 2022.
  24. Counting list homomorphisms from graphs of bounded treewidth: tight complexity bounds. In Proc. of SODA’22, pp. 431–458, 2022.
  25. Tight Complexity Bounds for Counting Generalized Dominating Sets in Bounded-Treewidth Graphs. In Proc. of SODA’23, pp. 3664–3683, 2023.
  26. Counting CSP solutions using generalized XOR constraints. In Proc. of AAAI’07, pp. 204–209, 2007.
  27. Tree projections and constraint optimization problems: Fixed-parameter tractability and parallel algorithms. J. Comput. Syst. Sci., 94:11–40, 2018.
  28. Hypertree decompositions and tractable queries. Journal of Computer and System Sciences, 64(3):579–627, 2002.
  29. Size and Treewidth Bounds for Conjunctive Queries. Journal of the ACM, 59(3), 2012.
  30. Robbers, marshals, and guards: game theoretic and logical characterizations of hypertree width. Journal of Computer and System Sciences, 66(4):775–808, 2003.
  31. Hypertree Decompositions: Questions and Answers. In Proc. of PODS’16, Gems of PODS session, pp. 57–74, 2016. Robbers, marshals, and guards: game theoretic and logical characterizations of hypertree width. Journal of Computer and System Sciences, 66(4):775–808, 2003.
  32. Generalized hypertree decompositions: NP-hardness and tractable variants. Journal of the ACM, 56(6), Article 16, 2009.
  33. The tree projection theorem and relational query processing. Journal of Computer and System Sciences, 29(3):767–786, 1984.
  34. Hypertree Decompositions for Query Optimization. In Proc. of ICDE ’07, pp. 36–45, 2007.
  35. Structural tractability of enumerating CSP solutions. Constraints, 18(1):8–74, 2013.
  36. The Power of Local Consistency in Conjunctive Queries and Constraint Satisfaction Problems. SIAM J. Comput., 46(3):1111–1145, 2017.
  37. Tree projections and structural decomposition methods: Minimality and game-theoretic characterization. Theor. Comput. Sci., 522: 95-114, 2014.
  38. Counting solutions to conjunctive queries: structural and hybrid tractability. In Richard Hull and Martin Grohe, editors, Proceedings of the 33rd ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, PODS’14, Snowbird, UT, USA, June 22-27, 2014, pages 132–143. ACM, 2014.
  39. Greedy strategies and larger islands of tractability for conjunctive queries and constraint satisfaction problems. Inf. Comput., 252:201–220, 2017.
  40. M. Grohe. The complexity of homomorphism and constraint satisfaction problems seen from the other side. Journal of the ACM, 54(1), Article 1, 2007.
  41. M. Grohe and D. Marx. Constraint solving via fractional edge covers. ACM Trans. Algorithms, 11(1):4:1–4:20, 2014.
  42. Manas Joglekar, Christopher Ré. It’s All a Matter of Degree - Using Degree Information to Optimize Multiway Joins. Theory Comput. Syst., 62(4):810–853, 2018.
  43. FAQ: Questions Asked Frequently. In Proc. of PODS’16, pp. 13–28, 2016.
  44. Functional Aggregate Queries with Additive Inequalities. ACM Trans. Database Syst. 45(4):17:1–17:41, 2020.
  45. Incrementally computing ordered answers of acyclic conjunctive formulas. In Proc. of NGITS’06, pp. 33–38, 2006.
  46. D. Marx. Approximating fractional hypertree width. ACM Tran. on Algorithms, 6(2), Article 29, 2010.
  47. D. Marx. Tractable Hypergraph Properties for Constraint Satisfaction and Conjunctive Queries. J. ACM, 60(6):42:1–42:51, 2013.
  48. G. Pesant. Counting solutions of CSPs: a structural approach. In Proc. of IJCAI’05, pp. 260–265, 2005.
  49. Graph minors III: Planar tree-width. Journal of Combinatorial Theory, Series B, 36:49–64, 1984.
  50. Graph minors V: Excluding a planar graph. Journal of Combinatorial Theory, Series B, 41:92–114, 1986.
  51. Counting Homomorphisms from Hypergraphs of Bounded Generalised Hypertree Width: A Logical Characterisation. In Proc. of MFCS’23, 79:1-79:15, 2023.
  52. J. D. Ullman. Principles of Database and Knowledge Base Systems. Computer Science Press, 1989.
  53. M. Yannakakis. Algorithms for acyclic database schemes. In Proc. of VLDB’81, pp. 82–94, 1981.
Citations (19)

Summary

We haven't generated a summary for this paper yet.

X Twitter Logo Streamline Icon: https://streamlinehq.com