metamx/druid — pull request #467 by nishantmonu51 (2014-04-07 21:59:33+00:00)
Title: Optimize post agg calculation

This PR improves performance by only calculating the postAggregations once, rather then calculating N times during merge process when N results are being merged into single result.

* Calculate postAggregations only after all the results are merged while finalizing results.
* For topN in case sorting is done on a post aggregated value only that is calculated before finalization