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.
aggregates databases query optimization