9. The computer system of claim 8 , wherein the OUTER JOIN operation is one of a FULL OUTER JOIN, a LEFT OUTER JOIN or a RIGHT OUTER JOIN.
8. A computer system for processing a structured query language (SQL) statement, the SQL statement comprising at least an OUTER JOIN operation, the computer system comprising: one or more computer processors; one or more computer readable storage media; and program instructions stored on the one or more computer readable storage media for execution by at least one of the one or more processors, the program instructions comprising program instructions to: determine whether a first query and a second query are equivalent, the first and second queries being respectively the left side and the right side operands of the OUTER JOIN operation; determine whether an output of the right side of the OUTER JOIN operation contains an output of the left side of the OUTER JOIN operation; determine whether partitioning columns of a GROUP BY operation are the same as partitioning columns of the OUTER JOIN operation; determine whether columns quantified by the right side of the OUTER JOIN operation include one or both of multiple distinct aggregation operations or multiple aggregation operations; determine whether there are no filter predicates or having clause in the GROUP BY operation; determine whether a SELECT output of the SQL statement does not refer to database columns from the left side of the OUTER JOIN operation which are not also partitioning columns of the OUTER JOIN operation; and responsive to determining that: (i) output of the first side of the OUTER JOIN operation contains the output of the left side of the OUTER JOIN operation, (ii) the partitioning columns of the GROUP BY operation are the same as the partitioning columns of the OUTER JOIN operation, (iii) the columns quantified by the right side of the OUTER JOIN operation include one or both of multiple distinct aggregation operations or multiple aggregation operations, (iv) there are no filter predicates or having clause in the GROUP BY operation, (v) the first query and the second query are equivalent, and (vi) the SELECT output of the SQL statement does not refer to database columns from the left side of the OUTER JOIN operation which are not also partitioning columns of the OUTER JOIN operation, transform the SQL statement into an optimized query SQL statement by removing the OUTER JOIN operation.