Answering conjunctive queries is a fundamental problem in database theory, and it is equivalent to solving constraint satisfaction problems in artificial intelligence and to other fundamental problems arising in computer science, which can be recast in terms of looking for homomorphisms between relational structures. The problem is NP-hard, so that several research efforts have been made in the literature for identifying tractable classes, known as islands of tractability, as well as for devising clever heuristics for solving efficiently real-world instances. Many heuristic approaches are based on enforcing on the given instance a property called local consistency (also, relational arc-consistency), where each tuple in every query atom matches at least one tuple in every other query atom. Interestingly, for many well-known classes of instances, such as for the acyclic ones, enforcing local consistency is even sufficient to solve the given instance correctly. However, the precise power of such a procedure was unclear, but for some very restricted cases. The paper provides answers to long-standing questions about the precise power of algorithms based on enforcing local consistency. The paper deals with both the general framework of tree projections, where local consistency is enforced among arbitrary views defined over the given database instance, and the specific cases where such views are computed according to the so-called structural decomposition methods, such as generalized hypertree width, component hypertree decompositions, and so on. Moreover, the paper deals with both decision and computation problems, by characterizing those tuples that are correct projections of query answers, which finds application in algorithms for answering queries and solving constraint satisfaction problems. As a relevant special case, the power of algorithms based on enforcing local consistency is characterized over the fundamental and deeply studied class of acyclic conjunctive queries. It turns out that local consistency provides the correct answer to a Boolean acyclic query if, and only if, the query is semantically acyclic.
Read full abstract