A computer-implemented method for processing input data in a mapreduce framework, the method comprising: receiving, in the mapreduce framework, a data processing request for input data, wherein the data processing request identifies a number of keys in the input data; performing a size evaluation of the identified number of keys with regard to a size of the input data, wherein performing the size evaluation further comprises determining whether at least one criterion regarding a generic aggregation is met, wherein the at least one criterion determines whether generic aggregation should be used in both a map and a reduce operation; initiating, based on the data processing request, a map operation on the input data by multiple mappers in the mapreduce framework, each of the mappers using an aggregator to partially aggregate the input data into one or more intermediate key/value pairs; initiating a reduce operation on the intermediate key/value pairs by a first and a second branch of the reduce operation in the mapreduce framework, further comprising: choosing the first branch of the reduce operation if the result of the size evaluation leads to using the generic aggregator, wherein the first branch includes at least one non-sorted aggregation, and choosing the second branch of the reduce operation if the result of the size evaluation leads to not using the generic aggregator, wherein the second branch includes at least one sorting operation and at least one sorted aggregation;; and providing the output values in response to the data processing request. receiving, in the mapreduce framework, a data processing request for input data, wherein the data processing request identifies a number of keys in the input data; performing a size evaluation of the identified number of keys with regard to a size of the input data, wherein performing the size evaluation further comprises determining whether at least one criterion regarding a generic aggregation is met, wherein the at least one criterion determines whether generic aggregation should be used in both a map and a reduce operation; initiating, based on the data processing request, a map operation on the input data by multiple mappers in the mapreduce framework, each of the mappers using an aggregator to partially aggregate the input data into one or more intermediate key/value pairs; initiating a reduce operation on the intermediate key/value pairs by a first and a second branch of the reduce operation in the mapreduce framework, further comprising: choosing the first branch of the reduce operation if the result of the size evaluation leads to using the generic aggregator, wherein the first branch includes at least one non-sorted aggregation, and choosing the second branch of the reduce operation if the result of the size evaluation leads to not using the generic aggregator, wherein the second branch includes at least one sorting operation and at least one sorted aggregation;; and choosing the first branch of the reduce operation if the result of the size evaluation leads to using the generic aggregator, wherein the first branch includes at least one non-sorted aggregation, and choosing the second branch of the reduce operation if the result of the size evaluation leads to not using the generic aggregator, wherein the second branch includes at least one sorting operation and at least one sorted aggregation;; and providing the output values in response to the data processing request.