Conjunctive query evaluation by search-tree revisited

  • Authors:
  • Albert Atserias

  • Affiliations:
  • Universitat Politècnica de Catalunya, c/Jordi Girona Salgado 1-3, 08034 Barcelona, Spain

  • Venue:
  • Theoretical Computer Science
  • Year:
  • 2007

Quantified Score

Hi-index 5.23

Visualization

Abstract

The most natural and perhaps most frequently used method for testing membership of an individual tuple in a conjunctive query is based on searching trees of partial solutions, or 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 optimal search-tree. We provide an algorithm that, given a database D, a conjunctive query Q, and a tuple a, tests whether Q(a) holds in D in time bounded by a polynomial in (sn)^l^o^g^k(sn)^l^o^g^l^o^g^n and n^r, where n is the size of the domain of the database, k is the number of bound variables of the conjunctive query, s is the size of the optimal search-tree, and r is the maximum arity of the relations. 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.