Report Number: CS-TN-94-14
Institution: Stanford University, Department of Computer Science
Title: Generalized Projections: A Powerful Query-Optimization Technique
Author: Harinarayan, Venky
Author: Gupta, Ashish
Date: November 1994
Abstract: In this paper we introduce generalized projections (GP). GPs capture aggregations, groupbys, conventional projection with duplicate elimination (Distinct), and duplicate preserving projections. We develop a technique for pushing GPs down query trees of Select-project-join queries that may use aggregations like Max, Sum, etc. and that use arbitrary functions in their selection conditions. Our technique pushes down to the lowest levels of a query tree aggregation computation, duplicate elimination, and function computation. The technique also creates aggregations in queries that did not use aggregation to begin with. Our technique is important since applying aggregations early in query processing can provide significant performance improvements. In addition to their value in query optimization, generalized projections unify set and duplicate semantics, and help better understand aggregations.