1. A method comprising: determining a plurality of candidate distribution keys corresponding to a plurality of different rollup levels, wherein each candidate distribution key of said plurality of candidate distribution keys comprises one or more group-by columns specified by a database statement that includes a GROUP-BY clause that operates on a set of group-by columns and a ROLLUP keyword that operates on an ordered set of rollup columns selected from the set of group-by columns; determining, in a set of rows specified by the database statement, a plurality of numbers of distinct values (NDVs) for the plurality of candidate distribution keys corresponding to the plurality of different rollup levels; selecting a distribution key from said plurality of candidate distribution keys based at least in part on the plurality of NDVs for the plurality of candidate distribution keys corresponding to the plurality of different rollup levels; distributing the set of rows, based at least in part on the selected distribution key, to a plurality of parallel executing processes comprising first parallel executing processes and second parallel executing processes; performing one or more rollup operations specified by the database statement by the plurality of parallel executing processes against the set of rows; wherein the method is performed by one or more computing devices.