Conjunctive Query Evaluation by Search Tree Revisited

  • Albert Atserias
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3363)


The most natural and perhaps most frequently used method for testing membership of an individual tuple into a conjunctive query is based on search trees. We investigate the question of evaluating conjunctive queries with a time-bound guarantee that is measured as a function of the size of the minimal search tree. We provide an algorithm that, given a database D, a conjunctive query Q, and a tuple t, tests whether Q(t) holds in D in time bounded by (sn) O(logk) (sn) O(loglog n), where n is the size of the domain of the database, k is the number of bound variables of the conjunctive query, and s is the size of the optimal search tree. In many cases of interest, this bound is significantly smaller than the n O(k) bound provided by the naive search-tree method. Moreover, our algorithm has the advantage of guaranteeing the bound for any given conjunctive query. In particular, it guarantees the bound for queries that admit an equivalent form that is much easier to evaluate, even when finding such a form is an NP-hard task. Concrete examples include the conjunctive queries that can be non-trivially folded into a conjunctive query of bounded size or bounded treewidth. All our results translate to the context of constraint-satisfaction problems via the well-publicized correspondence between both frameworks.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [AKV04]
    Atserias, A., Kolaitis, P.G., Vardi, Y.M.: Constraint propagation as a proof system. In: Wallace, M. (ed.) CP 2004. LNCS, vol. 3258, pp. 77–91. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  2. [BKPS02]
    Beame, P., Karp, R., Pitassi, T., Saks, M.: The efficiency of resolution and Davis-Putnam procedures. SIAM Journal of Computing, 1048–1075 (2002)Google Scholar
  3. [Bod98]
    Bodlaender, H.L.: A partial k-arboretum of graphs with bounded treewidth. Theoretical Computer Science 209, 1–45 (1998)zbMATHCrossRefMathSciNetGoogle Scholar
  4. [BP96]
    Beame, P., Pitassi, T.: Simplified and improved resolution lower bounds. In: 37th Annual IEEE Symposium on Foundations of Computer Science, pp. 274–282 (1996)Google Scholar
  5. [BPR00]
    Bonet, M.L., Pitassi, T., Raz, R.: On interpolation and automatization for Frege systems. SIAM Journal of Computing 29(6), 1939–1967 (2000); A preliminary version appeared in FOCS 1997zbMATHCrossRefMathSciNetGoogle Scholar
  6. [CM77]
    Chandra, A.K., Merlin, P.M.: Optimal implementation of conjunctive queries in relational databases. In: 9th Annual ACM Symposium on the Theory of Computing, pp. 77–90 (1977)Google Scholar
  7. [CR97]
    Chekuri, C., Rajaraman, A.: Conjunctive query containment revisited. In: 6th International Conference on Database Theory. LNCS, vol. 1997, pp. 56–70. Springer, Heidelberg (1997)Google Scholar
  8. [DKV02]
    Dalmau, V., Kolaitis, G.P., Vardi, M.Y.: Constraint satisfaction, bounded treewidth, and finite variable logics. In: Van Hentenryck, P. (ed.) CP 2002. LNCS, vol. 2470, pp. 310–326. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  9. [GLS98]
    Gottlob, G., Leone, N., Scarcello, F.: The complexity of acyclic conjunctive queries. In: 39th Annual IEEE Symposium on Foundations of Computer Science, pp. 706–715 (1998)Google Scholar
  10. [KV00]
    Kolaitis, G.P., Vardi, M.Y.: Conjunctive-query containment and constraint satisfaction. Journal of Computer and System Sciences 61(2), 302–332 (2000)zbMATHCrossRefMathSciNetGoogle Scholar
  11. [PY99]
    Papadimitriou, C.H., Yannakakis, M.: On the complexity of database queries. Journal of Computer and System Sciences 58(3), 407–427 (1999)zbMATHCrossRefMathSciNetGoogle Scholar
  12. [Yan81]
    Yannakakis, M.: Algorithms for acyclic database schemes. In: 7th International Conference on Very Large Data Bases, pp. 82–94 (1981)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2004

Authors and Affiliations

  • Albert Atserias
    • 1
  1. 1.Universitat Politècnica de CatalunyaBarcelonaSpain

Personalised recommendations