1. A computer-implemented method for transforming a query, comprising the steps of: generating a transformed query for the query, wherein: the query includes an outer query that has (1) a GROUP BY clause and (2) a HAVING clause that contains a subquery; the outer query includes a first set of one or more join operations; the subquery includes a second set of the one or more join operations; any join operation that is in the second set of one or more join operations is included in the first set of one or more join operations; any join operation that is in the first set of one or more join operations and not in the second set of one or more join operations is lossless; and at least one of the outer query and the subquery computes an algebraic aggregate function; and wherein generating the transformed query comprises the steps of: eliminating the subquery; creating an inline view, wherein the inline view: includes a set of join operations that is equivalent to the first set of join operations; includes a GROUP BY clause that is equivalent to the GROUP BY clause in the outer query; computes an algebraic aggregate window function that computes an algebraic aggregate function over a range; creating a predicate in the outer query that references the inline view; and wherein the steps of the method are performed by one or more computing devices.
1. A computer-implemented method for transforming a query, comprising the steps of: generating a transformed query for the query, wherein: the query includes an outer query that has (1) a GROUP BY clause and (2) a HAVING clause that contains a subquery; the outer query includes a first set of one or more join operations; the subquery includes a second set of the one or more join operations; any join operation that is in the second set of one or more join operations is included in the first set of one or more join operations; any join operation that is in the first set of one or more join operations and not in the second set of one or more join operations is lossless; and at least one of the outer query and the subquery computes an algebraic aggregate function; and wherein generating the transformed query comprises the steps of: eliminating the subquery; creating an inline view, wherein the inline view: includes a set of join operations that is equivalent to the first set of join operations; includes a GROUP BY clause that is equivalent to the GROUP BY clause in the outer query; computes an algebraic aggregate window function that computes an algebraic aggregate function over a range; creating a predicate in the outer query that references the inline view; and wherein the steps of the method are performed by one or more computing devices. 3. The method of claim 1 , wherein: the GROUP BY clause in the outer query is a first GROUP BY clause that references one or more columns; the subquery includes a second GROUP BY clause that references one or more columns; the one or more columns referenced in the first GROUP BY clause includes the one or more columns referenced in the second GROUP BY clause; and generating the transformed query further comprises the steps of: creating a second inline view; wherein: the inline view is a first inline view; the first inline view is nested within the second inline view; the algebraic aggregate window function includes a partition-by clause that references the one or more columns references in the second GROUP BY clause; and the predicate in the outer query that references the first inline view also references the second inline view.