Patent ID: 8290933

Claim:
A method for estimating a result size of a Group-By operation comprising: organizing a database stored on a computer readable data storage medium with data records maintained in multiple tables and defining a selectivity for each column as a number of distinct values in a column divided by the number of rows in a table; calculating a cumulative selectivity for a Group-By operation based upon aggregation of normalized selectivity of each column in a group of tables in the Group-By operation, including adding to a Group-By list columns equivalent to columns specified in the Group-By operation, said equivalent columns unspecified in the Group-By operation and accounting for dependency of columns originating from a same table in said Group-By operation by subtracting a product of normalized selectivities for said columns originating from the same table from a sum of normalized selectivities for said columns; computing a memory requirement for said Group-By operation based on said calculated cumulative selectivity; and allocating memory for said Group-By operation based upon said memory requirement.