Patent ID: 7293037

Claim:
A method of identifying which group of first values and corresponding second values from a set of values stored in a database to use for providing an estimated aggregation result for the set of values, the method comprising: collecting information related to the group of first values using a workload, the workload being representative of one or more past queries executed against the database; obtaining a variance for each of the first values in one or more different groups of first values using the collected information; selecting the group of first values and corresponding second values having the variance that satisfies a variance criterion along with the corresponding second values for that group to use for obtaining the estimated aggregation result for the set of values; allocating a set of given memory in the database between the one or more different groups of first values in direct proportion to the variance associated with each of the one or more different groups of first values; and storing the selected group of first values and corresponding second values.