Query Optimization: Eager and Lazy Aggregation
P-A (Paul) Larson
University of Waterloo
Currently on leave at IBM Santa Theresa
Efficient processing of aggregation queries is essential
for decision support applications. This talk describes a class of
query transformations, called eager aggregation and lazy
aggregation, that allows a query optimizer to move group-by
operations up and down the query tree. For some queries, this type
of transformation can reduce the processing time by 90% or more.
Eager aggregation partially pushes a group-by past a join and begins
to produce partial groups early, thereby reducing the number of rows
flowing into subsequent operations. The reverse transformation,
lazy aggregation, moves a group-by past a join and combines
two group-by operations into one. This transformation is typically of
interest when an aggregation query references a grouped view
(a view containing a group-by). We show that eager/lazy aggregation
can be applied if certain (derived) functional dependencies are guaranteed
to hold in the join result. The talk will also show that sometimes we
have several ways of transforming a query and outline a practical algorithm
for finding all valid transformations.
This is joint work with Paul Yan, University of Waterloo.
Publications Related to Talk
Please contact Paul Yan (email@example.com) if
you have specific questions about the talk.