The complexity of acyclic conjunctive queries

This paper deals with the evaluation of acyclic Booleanconjunctive queries in relational databases. By well-known resultsof Yannakakis[1981], this problem is solvable in polynomial time;its precise complexity, however, has not been pinpointed so far. Weshow that the problem of evaluating acyclic Boolean conjunctivequeries is complete for LOGCFL, the class of decision problems thatare logspace-reducible to a context-free language. Since LOGCFL iscontained in AC1 and NC2, the evaluation problem of acyclic Booleanconjunctive queries is highly parallelizable. We present a paralleldatabase algorithm solving this problem with alogarithmic number ofparallel join operations. The algorithm is generalized to computingthe output of relevant classes of non-Boolean queries. We also showthat the acyclic versions of the following well-known database andAI problems are all LOGCFL-complete: The Query Output Tuple problemfor conjunctive queries, Conjunctive Query Containment, ClauseSubsumption, and Constraint Satisfaction. The LOGCFL-completenessresult is extended to the class of queries of bounded tree widthand to other relevant query classes which are more general than theacyclic queries.

[1]  Moni Naor,et al.  Fast parallel algorithms for chordal graphs , 1987, STOC '87.

[2]  John C. Mitchell,et al.  On the Sequential Nature of Unification , 1984, J. Log. Program..

[3]  Jeffrey D. Ullman,et al.  Information integration using logical views , 1997, Theor. Comput. Sci..

[4]  Marc Gyssens,et al.  Decomposing Constraint Satisfaction Problems Using Database Techniques , 1994, Artif. Intell..

[5]  Georg Gottlob,et al.  A Comparison of Structural CSP Decomposition Methods , 1999, IJCAI.

[6]  Jeffrey D. Ullman,et al.  Introduction to Automata Theory, Languages and Computation , 1979 .

[7]  David Maier,et al.  The Theory of Relational Databases , 1983 .

[8]  Mihalis Yannakakis,et al.  On the Complexity of Database Queries , 1999, J. Comput. Syst. Sci..

[9]  Kenneth Steiglitz,et al.  Combinatorial Optimization: Algorithms and Complexity , 1981 .

[10]  Divesh Srivastava,et al.  Answering Queries Using Views. , 1999, PODS 1995.

[11]  Ronald Fagin,et al.  Degrees of acyclicity for hypergraphs and relational database schemes , 1983, JACM.

[12]  Nathan Goodman,et al.  Syntactic Characterization of Tree Database Schemas , 1983, JACM.

[13]  A. Bonato,et al.  Graphs and Hypergraphs , 2022 .

[14]  Anand Rajaraman,et al.  Conjunctive query containment revisited , 1997, Theor. Comput. Sci..

[15]  Peter M. G. Apers,et al.  Parallel evaluation of multi-join queries , 1995, SIGMOD '95.

[16]  Leslie G. Valiant,et al.  A complexity theory based on Boolean algebra , 1981, 22nd Annual Symposium on Foundations of Computer Science (sfcs 1981).

[17]  Paul D. Seymour,et al.  Graph minors. V. Excluding a planar graph , 1986, J. Comb. Theory B.

[18]  Rina Dechter,et al.  Tree Clustering for Constraint Networks , 1989, Artif. Intell..

[19]  Detlef Seese,et al.  Easy Problems for Tree-Decomposable Graphs , 1991, J. Algorithms.

[20]  Karen Chase Join Graphs and Acyclic Database Schemes , 1981, VLDB.

[21]  Richard Hull Acyclic Join Dependency and Data Base Projections , 1981, J. Comput. Syst. Sci..

[22]  Peter Jeavons,et al.  A Survey of Tractable Constraint Satisfaction Problems , 1997 .

[23]  Marc Gyssens On the complexity of join dependencies , 1986, TODS.

[24]  Stephen A. Cook,et al.  Problems Complete for Deterministic Logarithmic Space , 1987, J. Algorithms.

[25]  Francesco M. Malvestuto,et al.  Modelling Large Bases of Categorial Data With Acyclic Schemes , 1986, ICDT.

[26]  Catriel Beeri,et al.  Properties of acyclic database schemes , 1981, STOC '81.

[27]  Sheila A. Greibach,et al.  The Hardest Context-Free Language , 1973, SIAM J. Comput..

[28]  Nathan Goodman,et al.  Tree queries: a simple class of relational queries , 1982, TODS.

[29]  Philip S. Yu,et al.  Effectiveness of Parallel Joins , 1990, IEEE Trans. Knowl. Data Eng..

[30]  J. Kruskal On the shortest spanning subtree of a graph and the traveling salesman problem , 1956 .

[31]  Marina Moscarini,et al.  Recognition Algorithms and Design Methodologies for Acyclic Database Schemes , 1986, Adv. Comput. Res..

[32]  Domenico Saccà Closures of database hypergraphs , 1985, JACM.

[33]  Xiaolei Qian,et al.  Query folding , 1996, Proceedings of the Twelfth International Conference on Data Engineering.

[34]  Stephen A. Cook,et al.  Characterizations of Pushdown Machines in Terms of Time-Bounded Computers , 1971, J. ACM.

[35]  José L. Balcázar,et al.  Structural Complexity I , 1995, Texts in Theoretical Computer Science An EATCS Series.

[36]  Anand Rajaraman,et al.  Answering queries using templates with binding patterns (extended abstract) , 1995, PODS.

[37]  Simon Kasif,et al.  Local Consistency in Parallel Constraint Satisfaction Networks , 1994, Artif. Intell..

[38]  Philip A. Bernstein,et al.  Using Semi-Joins to Solve Relational Queries , 1981, JACM.

[39]  Ivan Hal Sudborough Time and Tape Bounded Auxiliary Pushdown Automata , 1977, MFCS.

[40]  Paul D. Seymour,et al.  Graph Minors. II. Algorithmic Aspects of Tree-Width , 1986, J. Algorithms.

[41]  Robert E. Tarjan,et al.  Simple Linear-Time Algorithms to Test Chordality of Graphs, Test Acyclicity of Hypergraphs, and Selectively Reduce Acyclic Hypergraphs , 1984, SIAM J. Comput..

[42]  Moshe Y. Vardi The complexity of relational query languages (Extended Abstract) , 1982, STOC '82.

[43]  Phokion G. Kolaitis,et al.  Conjunctive-query containment and constraint satisfaction , 1998, PODS.

[44]  C. R. Ramakrishnan,et al.  Subsumption Algorithms Based on Search Trees , 1996, CAAP.

[45]  Neil D. Jones,et al.  Computability and complexity - from a programming perspective , 1997, Foundations of computing series.

[46]  Ronald Fagin,et al.  A simplied universal relation assumption and its properties , 1982, TODS.

[47]  Patrick Valduriez,et al.  Open issues in parallel query optimization , 1996, SGMD.

[48]  Ashok K. Chandra,et al.  Optimal implementation of conjunctive queries in relational data bases , 1977, STOC '77.

[49]  Ivan Hal Sudborough,et al.  On the Tape Complexity of Deterministic Context-Free Languages , 1978, JACM.

[50]  H. Venkateswaran,et al.  Properties that characterize LOGCFL , 1987, J. Comput. Syst. Sci..

[51]  Walter L. Ruzzo On Uniform Circuit Complexity , 1981, J. Comput. Syst. Sci..

[52]  Clement T. Yu,et al.  An algorithm for tree-query membership of a distributed query , 1979, COMPSAC.

[53]  Serge Abiteboul,et al.  Foundations of Databases , 1994 .

[54]  Allan Borodin,et al.  Two Applications of Inductive Counting for Complementation Problems , 1989, SIAM J. Comput..

[55]  Mihalis Yannakakis,et al.  On the complexity of database queries (extended abstract) , 1997, PODS.

[56]  David J. DeWitt,et al.  Parallel database systems: the future of high performance database systems , 1992, CACM.

[57]  Richard C. T. Lee,et al.  Symbolic logic and mechanical theorem proving , 1973, Computer science classics.

[58]  Larry Wos,et al.  Subsumption, a Sometimes Undervalued Procedure , 1991, Computational Logic - Essays in Honor of Alan Robinson.

[59]  Stephen A. Cook,et al.  A Taxonomy of Problems with Fast Parallel Algorithms , 1985, Inf. Control..

[60]  Philip N. Klein Efficient Parallel Algorithms for Chordal Graphs , 1996, SIAM J. Comput..

[61]  Philip A. Bernstein,et al.  Power of Natural Semijoins , 1981, SIAM J. Comput..

[62]  Jeffrey D. Ullman,et al.  Answering queries using templates with binding patterns (extended abstract) , 1995, PODS '95.

[63]  Oded Shmueli,et al.  Solving queries by tree projections , 1993, TODS.

[64]  Pierre McKenzie,et al.  Extensions to Barrington's M-Program Model , 1993, Theor. Comput. Sci..

[65]  YannakakisMihalis,et al.  On the Desirability of Acyclic Database Schemes , 1983 .

[66]  Marek Karpinski,et al.  The Matching Problem for Strongly Chordal Graphs is in $NC$ , 1986 .

[67]  Christos H. Papadimitriou,et al.  Symmetric Space-Bounded Computation , 1982, Theor. Comput. Sci..

[68]  Egon Wanke,et al.  Bounded Tree-Width and LOGCFL , 1993, J. Algorithms.

[69]  Clement Yu,et al.  On determining tree query membership of a distributed query , 1980 .

[70]  Noam Nisan,et al.  Symmetric logspace is closed under complement , 1995, STOC '95.

[71]  Mihalis Yannakakis,et al.  Algorithms for Acyclic Database Schemes , 1981, VLDB.

[72]  Georg Gottlob,et al.  Hypertree decompositions and tractable queries , 1998, J. Comput. Syst. Sci..

[73]  Claude Berge,et al.  Graphs and Hypergraphs , 2021, Clustering.

[74]  Walter L. Ruzzo,et al.  Tree-size bounded alternation(Extended Abstract) , 1979, J. Comput. Syst. Sci..

[75]  Jeffrey D. Ullman,et al.  Principles of Database and Knowledge-Base Systems, Volume II , 1988, Principles of computer science series.

[76]  Georg Gottlob,et al.  Computing LOGCFL certificates , 1999, Theor. Comput. Sci..

[77]  Richard M. Karp,et al.  Parallel Algorithms for Shared-Memory Machines , 1991, Handbook of Theoretical Computer Science, Volume A: Algorithms and Complexity.

[78]  Alan K. Mackworth,et al.  Parallel and Distributed Finite Constraint Satisfaction: Complexity, Algorithms and Experiments , 1992 .

[79]  Egon Wanke Bounded Tree-Width and LOGCFL , 1993, WG.

[80]  守屋 悦朗,et al.  J.E.Hopcroft, J.D. Ullman 著, "Introduction to Automata Theory, Languages, and Computation", Addison-Wesley, A5変形版, X+418, \6,670, 1979 , 1980 .

[81]  Marc Gyssens,et al.  Closure properties of constraints , 1997, JACM.

[82]  Michael Stonebraker,et al.  Optimization of parallel query execution plans in XPRS , 1991, [1991] Proceedings of the First International Conference on Parallel and Distributed Information Systems.

[83]  Anand Rajaraman,et al.  Conjunctive query containment revisited , 2000, Theor. Comput. Sci..

[84]  David S. Johnson,et al.  Computers and Intractability: A Guide to the Theory of NP-Completeness , 1978 .

[85]  H. James Hoover,et al.  Limits to Parallel Computation: P-Completeness Theory , 1995 .

[86]  David S. Johnson,et al.  A Catalog of Complexity Classes , 1991, Handbook of Theoretical Computer Science, Volume A: Algorithms and Complexity.

[87]  Marc Gyssens,et al.  A Decomposition Methodology for Cyclic Databases , 1982, Advances in Data Base Theory.

[88]  Catriel Beeri,et al.  On the Desirability of Acyclic Database Schemes , 1983, JACM.

[89]  José L. Balcázar,et al.  Structural complexity 1 , 1988 .

[90]  Georg Gottlob,et al.  Advanced Parallel Algorithms far Processing Acyclic Conjunctive Queries, Rules, and Constraints, , 2000 .

[91]  Divesh Srivastava,et al.  Answering Queries Using Views. , 1999, PODS 1995.

[92]  Jeffrey D. Uuman Principles of database and knowledge- base systems , 1989 .

[93]  Paul D. Seymour,et al.  Graph Minors: XV. Giant Steps , 1996, J. Comb. Theory, Ser. B.