2. The method of claim 1 , further comprising: identifying an inner aggregate function specified in the inner subquery and an outer aggregate function specified in the outer subquery; determining whether a result of the inner aggregate function is provided as an input to the outer aggregate function; responsive to determining that the result of the inner aggregate function is provided as the input to the outer aggregate function, determining a new aggregate function corresponding to a composition of the inner aggregate function and the outer aggregate function; and wherein the combined database query specifies the new aggregate function.
2. The method of claim 1 , further comprising: identifying an inner aggregate function specified in the inner subquery and an outer aggregate function specified in the outer subquery; determining whether a result of the inner aggregate function is provided as an input to the outer aggregate function; responsive to determining that the result of the inner aggregate function is provided as the input to the outer aggregate function, determining a new aggregate function corresponding to a composition of the inner aggregate function and the outer aggregate function; and wherein the combined database query specifies the new aggregate function. 7. The method of claim 2 , wherein the inner aggregate function computes a minimum of values and the outer aggregate function computes a minimum of values, wherein the new aggregate function corresponding to a composition of the inner aggregate function and the outer aggregate function computes a minimum of values.