Efficient processing of aggregation queries is essential for decision support applications. This paper describes a class of query transformations, called eager aggregation and laty aggregation, that allows a query optimizer to move group-by operations up and down the query tree. Eager aggregation partially pushes a groupby past a join. After a group-by is partially pushed down, we still need to perform the original groupby in the upper query block. Eager aggregation reduces the number of input rows to the join and thus may result in a better overall plan. The reverse transformation, lazy aggregation, pulls a group-by above 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 groupby). Experimental results show that the technique is very beneficial for queries in the TPC-D benchmark.
[1]
Kyuseok Shim,et al.
Including Group-By in Query Optimization
,
1994,
VLDB.
[2]
Per-Ake Larson,et al.
Performing Group-By before Join
,
1994,
ICDE 1994.
[3]
Hamid Pirahesh,et al.
Extensible/rule based query rewrite optimization in Starburst
,
1992,
SIGMOD '92.
[4]
Guy M. Lohman,et al.
Grammar-like functional rules for representing query optimization alternatives
,
1988,
SIGMOD '88.
[5]
Weipeng P. Yan.
Rewrite optimization of SQL queries containing group-by
,
1996
.
[6]
Ashish Gupta,et al.
Aggregate-Query Processing in Data Warehousing Environments
,
1995,
VLDB.