Polynomial heuristics for query optimization
Eager aggregation and lazy aggregation