Pushing extrema aggregates to optimize logic queries

In this paper, we explore the possibility of transforming queries with minimum and maximum predicates into equivalent queries that can be computed more efficiently. The main contribution of the paper is an algorithm for propagating min and max predicates while preserving query equivalence under certain monotonicity constraints. We show that the algorithm is correct and that the transformed query is often safe when the original one is not. Although in this paper we use logic rules, the technique presented can be used to optimize (possibly recursive) queries expressed using SQL3.

[1]  Kenneth A. Ross,et al.  Foundations of Aggregation Constraints , 1994, Theor. Comput. Sci..

[2]  Hamid Pirahesh,et al.  The Magic of Duplicates and Aggregates , 1990, VLDB.

[3]  Jack Minker Foundations of deductive databases and logic programming , 1988 .

[4]  Limsoon Wong,et al.  New techniques for studying set languages, bag languages and aggregate functions , 1994, PODS '94.

[5]  John Lloyd,et al.  Foundation of logic programming , 1983 .

[6]  Yiu-Kai Ng,et al.  Data Retrieval and Aggregates in SQL*/NR , 1995, CISMOD.

[7]  Carlo Zaniolo,et al.  Negation and Aggregates in Recursive Rules: the LDL++ Approach , 1993, DOOD.

[8]  J. W. Lloyd,et al.  Foundations of logic programming; (2nd extended ed.) , 1987 .

[9]  Lauri Hella,et al.  Logics with aggregate operators , 2001, JACM.

[10]  Sergio Greco,et al.  Greedy Algorithms in Datalog with Choice and Negation , 1998, IJCSLP.

[11]  Alan van Gelser Negation as failure using tight derivations for general logic programs , 1989 .

[12]  Teodor C. Przymusinski On the Declarative Semantics of Deductive Databases and Logic Programs , 1988, Foundations of Deductive Databases and Logic Programming..

[13]  Domenico Saccà,et al.  The Expressive Powers of Stable Models for Bound and Unbound DATALOG Queries , 1997, J. Comput. Syst. Sci..

[14]  Alberto O. Mendelzon,et al.  Low Complexity Aggregation in GraphLog and Datalog , 1993, Theor. Comput. Sci..

[15]  Carlo Zaniolo,et al.  User defined aggregates in object-relational systems , 2000, Proceedings of 16th International Conference on Data Engineering (Cat. No.00CB37073).

[16]  Francesco Buccafurri,et al.  Enhancing Disjunctive Datalog by Constraints , 2000, IEEE Trans. Knowl. Data Eng..

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

[18]  Adrian Walker,et al.  Towards a Theory of Declarative Knowledge , 1988, Foundations of Deductive Databases and Logic Programming..

[19]  Kenneth A. Ross,et al.  Modular stratification and magic sets for Datalog programs with negation , 1994, JACM.

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

[21]  Sergio Greco,et al.  Extrema Predicates in Deductive Databases , 1995, J. Comput. Syst. Sci..

[22]  Peter J. Stuckey,et al.  Semantics of Logic Programs with Aggregates , 1991, ISLP.

[23]  Kenneth A. Ross,et al.  Monotonic aggregation in deductive databases , 1992, J. Comput. Syst. Sci..

[24]  Kenneth A. Ross,et al.  The well-founded semantics for general logic programs , 1991, JACM.

[25]  Kenneth A. Ross,et al.  Efficient Incremental Evaluation of Queries with Aggregation , 1994, ILPS.

[26]  Divesh Srivastava,et al.  Extending the Well-Founded and Valid Semantics for Aggregation , 1993, ILPS.

[27]  Teodor C. Przymusinski,et al.  Weakly Perfect Model Semantics for Logic Programs , 1988, ICLP/SLP.

[28]  Subrata Kumar Das,et al.  Deductive Databases and Logic Programming , 1992 .

[29]  Julius T. Tou,et al.  Information Systems , 1973, GI Jahrestagung.

[30]  Carlo Zaniolo,et al.  Stable models and non-determinism in logic programs with negation , 1990, PODS.

[31]  Sergio Greco,et al.  Dynamic Programming in Datalog with Aggregates , 1999, IEEE Trans. Knowl. Data Eng..

[32]  S. Sudarshan,et al.  Aggregation and Relevance in Deductive Databases , 1991, VLDB.

[33]  Suzanne W. Dietrich,et al.  Shortest path by approximation in logic programs , 1992, LOPL.

[34]  Allen Van Gelder,et al.  Foundations of Aggregation in Deductive Databases , 1993, DOOD.

[35]  Jürgen Dix,et al.  On Well-Behaved Semantics Suitable for Aggregation , 1997, ILPS.

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

[37]  Sergio Greco,et al.  Optimization of Logic Queries with MIN and MAX Predicates , 1998, FQAS.

[38]  Maurizio Rafanelli,et al.  Querying aggregate data , 1999, PODS '99.

[39]  Chengwen Liu,et al.  A framework for global optimization of aggregate queries , 1997, CIKM '97.

[40]  Alberto O. Mendelzon,et al.  Low Complexity Aggregation in GraphLog and Datalog , 1990, Theor. Comput. Sci..