Grammars and Automata to Optimize Chain Logic Queries

The critical problem of finding efficient implementations for recursive queries with bound arguments offers many open challenges of practical and theoretical import. In particular, there is a need to find methods that are effective for the general case, such as non-linear programs, as well as for specialized cases, such as left-recursive linear programs. In this paper, we propose a novel approach that solves this problem for chain queries, i.e., for queries where bindings are propagated from arguments in the head to arguments in the tail of the rules, in a chain-like fashion. The method, called pushdown method, is based on the fact that a chain query can have associated a context-free language and a pushdown automaton recognizing this language can be emulated by rewriting the query as a particular factorized left-linear program. The proposed method generalizes and unifies previous techniques such as the 'counting' and 'right-, left-, mixed-linear' methods. It also succeeds in reducing many non-linear programs to query-equivalent linear ones.

[1]  Domenico Saccà,et al.  Comparison of Methods for Logic-Query Implementation , 1991, J. Log. Program..

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

[3]  Jeffrey D. Ullman,et al.  Parallel complexity of logical query programs , 1986, 27th Annual Symposium on Foundations of Computer Science (sfcs 1986).

[4]  Laurent Vieille,et al.  Recursive Query Processing: The Power of Logic , 1989, Theor. Comput. Sci..

[5]  Jeffrey D. Ullman The Interface Between Language Theory and Database Theory , 1992, Theoretical Studies in Computer Science.

[6]  Yatin P. Saraiya Linearising nonlinear recursions in polynomial time , 1989, PODS.

[7]  Mihalis Yannakakis,et al.  Graph-theoretic methods in database theory , 1990, PODS.

[8]  Jeffrey F. Naughton,et al.  Efficient evaluation of right-, left-, and multi-linear rules , 1989, SIGMOD '89.

[9]  Clement T. Yu,et al.  Linearization of Nonlinear Recursive Rules , 1989, IEEE Trans. Software Eng..

[10]  Sergio Greco,et al.  Efficient Execution of Recursive Queries Through Controlled Binding Propagation , 1994, ISMIS.

[11]  John Wylie Lloyd,et al.  Foundations of Logic Programming , 1987, Symbolic Computation.

[12]  Raghu Ramakrishnan,et al.  Performance Evaluation of Data Intensive Logic Programs , 1988, Foundations of Deductive Databases and Logic Programming..

[13]  Sergio Greco,et al.  The PushDown Method to Optimize Chain Logic Programs (Extended Abstract) , 1995, ICALP.

[14]  Catriel Beeri,et al.  On the power of magic , 1987, J. Log. Program..

[15]  Jeffrey F. Naughton,et al.  Argument Reduction by Factoring , 1989, VLDB.

[16]  Catriel Beeri,et al.  Bounds on the propagation of selection into logic programs , 1987, J. Comput. Syst. Sci..

[17]  Guozhu Dong Datalog expressiveness of chain queries: grammar tools and characterizations , 1992, PODS '92.

[18]  Foto N. Afrati,et al.  Expressiveness of restricted recursive queries , 1989, STOC '89.

[19]  Sergio Greco,et al.  Optimization of Linear Logic Programs Using Counting Methods , 1992, EDBT.

[20]  Christos H. Papadimitriou,et al.  The parallel complexity of simple chain queries , 1987, PODS '87.

[21]  Peter T. Wood,et al.  Factoring Augmented Regular Chain Programs , 1990, VLDB.

[22]  Sergio Greco,et al.  Implementation of Chain Logic Queries , 1996, APPIA-GULP-PRODE.

[23]  Eugene Wong,et al.  Transforming Nonlinear Recursion into Linear Recursion , 1988, Expert Database Conf..

[24]  Alfred V. Aho,et al.  The Design and Analysis of Computer Algorithms , 1974 .

[25]  Carlo Zaniolo,et al.  On the implementation of a simple class of logic queries for databases , 1985, PODS.

[26]  Fernando Pereira,et al.  Definite clause grammars for language analysis , 1986 .

[27]  David Maier,et al.  Magic sets and other strange ways to implement logic programs (extended abstract) , 1985, PODS '86.

[28]  Carlo Zaniolo,et al.  Magic counting methods , 1987, SIGMOD '87.

[29]  Bernard Lang,et al.  Datalog Automata , 1988, JCDKB.

[30]  Yannis E. Ioannidis Commutativity and its Role in the Processing of Linear Recursion , 1992, J. Log. Program..

[31]  Jeffrey D. Ullman,et al.  Parallel Complexity of Logical Query Programs , 1986, FOCS.

[32]  Jiawei Han,et al.  Selection of Processing Strategies for Different Recursive Queries , 1988, JCDKB.

[33]  Jeffrey D. Ullman,et al.  Logical Query Optimization by Proff-Tree Transformation , 1993, J. Comput. Syst. Sci..

[34]  Jeffrey F. Naughton,et al.  A Counting Algorithm for a Cyclic Binary Query , 1991, J. Comput. Syst. Sci..

[35]  Guozhu Dong,et al.  On Datalog Linearization of Chain Queries , 1991, Theoretical Studies in Computer Science.