Conjunctive-Query Containment and Constraint Satisfaction

Conjunctive-Query Containment and Constraint Satisfaction

ConjunctiveQuery Containment and Constraint Satisfaction y z Phokion G Kolaitis Moshe Y Vardi Computer Science Department Department of Computer Science University of California Santa Cruz Rice University Santa Cruz CA USA Houston TX USA kolaitiscseucscedu vardicsriceedu Abstract Conjunctivequery containment is recognized as a fundamental problem in database query evaluation and optimization At the same time constraint satisfaction is recog nized as a fundamental problem in articial intelligence What do conjunctivequery containment and constraint satisfaction have in common Our main conceptual con tribution in this pap er is to p oint out that despite their very dierent formulation conjunctivequery containment and constraint satisfaction are essentially the same problem The reason is that they can b e recast as the following fundamental algebraic problem given two nite relational structures A and B is there a homomorphism h A ! B As formulated ab ove the homomorphism problem is uniform in the sense that b oth relational structures A and B are part of the input By xing the structure B one obtains the following nonuniform problem given a nite relational structure A is there a homomorphism h A ! B In general nonuniform tractability results do not uniformize Thus it is natural to ask which tractable cases of nonuniform tractability results for constraint satisfaction and conjunctivequery containment do uniformize Our main technical contribution in this pap er is to show that several cases of tractable nonuniform constraint satisfaction problems do indeed uniformize We ex hibit three nonuniform tractability results that uniformize and thus give rise to p olynomialtime solvable cases of constraint satisfaction and conjunctivequery con tainment We b egin by examining the tractable cases of Bo olean constraintsatisfaction problems and show that they do uniformize This can b e applied to conjunctivequery containment via Booleanization in particular it yields one of the known tractable cases of conjunctive query containment After this we show that tractability results for constraintsatisfaction problems that can b e expressed using Datalog programs A preliminary version of this pap er app eared in Proc th ACM Symp on Principles of Database Systems June pp y Partially supp orted by NSF grant CCR z Partially supp orted by NSF grants CCR and CCR URL httpwwwcsriceedu vardi with b ounded number of distinct variables also uniformize Finally we establish that tractability results for queries with b ounded treewidth uniformize as well via a con nection with rstorder logic a with b ounded number of distinct variables Introduction Conjunctive queries have had a conspicuous presence in b oth the theory and practice of database systems since the s Conjunctive queries constitute a broad class of frequently used queries b ecause their expressive p ower is equivalent to that of the SelectJoinPro ject queries in relational algebra AHV Ull For this reason several algorithmic problems concerning conjunctive queries have b een investigated in depth In particular conjunctive query containment was recognized fairly early as a fundamental problem in database query evaluation and optimization Indeed conjunctivequery containment is essentially the same problem as conjunctive query evaluation moreover conjunctivequery containment can b e used as a to ol in query optimization since query equivalence is reducible to query contain ment Chandra and Merlin CM studied the computational complexity of conjunctive query containment and showed that it is an NPcomplete problem In recent years there has b een renewed interest in the study of conjunctive query containment b ecause of its close relationship to the problem of answering queries using materialized views LMSS RSU The latter has emerged as a central problem in integrating information from heterogeneous sources an area that lately has b een the fo cus of concentrated research eorts see Ull for survey Since conjunctivequery containment is intractable in its full generality researchers have embarked on a search for tractable cases These are obtained by imp osing syntactic or structural restrictions on the conjunctive queries Q and Q that serve as input to the 1 2 problem is Q Q In particular Saraiya Sar showed that conjunctivequery 1 2 containment can b e solved in linear time if every database predicate o ccurs at most twice in the b o dy of Q More recently Chekuri and Ra jaraman CR CR showed that for 1 every k conjunctivequery containment can b e solved in p olynomial time if Q has 2 querywidth at most k and a query decomposition of Q of width k is available The concept 2 of querywidth is closely related to the wellstudied concept of treewidth of a graph see vL Bo d It should b e noted that queries of width are precisely the acyclic queries thus Chekuri and Ra jaramans results extend the earlier work of Yannakakis Yan and Qian Qia on query evaluation and containment for acyclic queries Starting with the pioneering work of Montanari Mos researchers in articial intelli gence have investigated a class of combinatorial problems that b ecame known as constraint satisfaction problems CSP The input to such a problem consists of a set of variables a set of p ossible values for the variables and a set of constraints b etween the variables the question is to determine whether there is an assignment of values to the variables that satises the given constraints The study of constraint satisfaction o ccupies a prominent place in articial intelligence b ecause many problems that arise in dierent areas can b e mo deled as constraintsatisfaction problems in a natural way these areas include Bo olean satisability temp oral reasoning b elief maintenance machine vision and scheduling see Dec Kum Mes Tsa In its full generality constraint satisfaction is a NP complete problem For this reason researchers in articial intelligence have pursued b oth heuristics for constraintsatisfaction problems and tractable cases obtained by imp osing re strictions on the constraints see MF Dec PJ What do conjunctivequery contaiment and constraint satisfaction have in common De spite their very dierent formulation it turns out that conjunctivequery containment and constraint satisfaction are essentially the same problem The reason is that they can b e recast as the following fundamental algebraic problem given two nite relational structures A and B is there a homomorphism h A B Indeed on the side of conjunctivequery contain D D ment it is well known that Q Q if and only if there is a homomorphism h Q Q 1 2 2 1 D is the canonical database asso ciated with the query Q i CM On where Q i i the side of constraint satisfaction a p erusal of the literature reveals that all constraint satisfaction problems studied can b e viewed as sp ecial cases of the ab ove homomorphism problem FV FV see also Jea It should b e noted that several researchers includ ing Bib Dec GJC PJ have observed that there are tight connections b etween constraintsatisfaction problems and certain problems in relational databases In particular Gyssens Jeavons and Cohen GJC p ointed out that the set of all solutions to a constraint satisfaction problem coincides with the join of certain relations extracted from the given constraintsatisfaction problem Thus solving constraintsatisfaction problems and evaluat ing joins are interreducible In turn conjunctivequery evaluation and join valuation are also reducible to each other Ull Since Chandra and Merlin CM showed that conjunctive query evaluation and conjunctive query containment are equivalent problems this provides a dierent although less direct way to establish the tight connection b etween conjunctive query containment and constraint satisfaction Nonetheless it is fair to say that overall there is little interaction b etween the community that pursues tractable cases of conjunctive query containment and the community that pursues tractable cases of constraint satisfaction One of our main goals in this pap er is to make the connection b etween conjunctive query contain ment and constraint satisfaction explicit bring it to front stage and thus further enhance the interaction b etween database theory and articial intelligence As formulated ab ove the homomorphism problem is uniform in the sense that b oth re lational structures A and B are part of the input By xing the structure B one obtains the following nonuniform problem CSPB given a nite relational structure A is there a homomorphism h A B Over the past twenty years researchers in computational complexity have studied such nonuniform problems in an attempt to determine for which structures B the asso ciated CSPB problem is tractable and for which it is intractable The rst remarkable success on this front was obtained by Schaefer Sch who pinp ointed the computational complexity of Boolean CSP B problems in which the structure B is Bo olean ie has the set f g as its universe Schaefer established a dichotomy theorem for Bo olean CSPB problems Sp ecically he identied six classes of Bo olean structures and showed that CSP B is solvable in p olynomial time if B is in one of these classes but CSP B is NPcomplete in all other cases Note that each Bo olean CSPB problem can b e viewed as a generalized satisability problem In particular Schaefers Sch dichotomy theorem provides a coherent explanation for the computational complexity of Horn Sat isability Satisability OneinThree Satisability and other such Bo olean satisability problems

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    31 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us