Patent ID: 7917526

Claim:
A computer system having a Group-By operation size estimator comprising: a processor in communication with storage media; said storage media having a database with data records maintained in tables; a selectivity manager in communication with said database, said selectivity manager adapted to calculate a cumulative selectivity based upon an aggregation of selectivity of an individual column in a group of tables in a Group-By operation, wherein the step of calculating a cumulative selectivity is based upon the following mathematical relationship: S ab =S a +S b −(S a ×S b ), wherein S a is a selectivity of column “a”, S b is the selectivity of column “b”, and S ab is a cumulative selectivity of columns “a” and column “b”; and a result size manager in communication with said database adapted to receive said calculated cumulative selectivity from said selectivity manager, to estimate a size of said Group-By operation as a product of said calculated cumulative selectivity and an input size of said Group-By operation, to compute a memory requirement for said Group-By operation based on said estimated size of said Group-By operation, and to allocate memory for said operation based upon said memory requirement.