Patent ID: 9244974
Filing Date: 2016-01-26
CPC Classification: G06F

Claim Text:
1. A computer-implemented method to optimize database queries having grouped aggregation functions, the computer-implemented method comprising: determining characteristics of a database query having a grouped aggregation function; generating, by operation of one or more computer processors, a predicted cardinality statistic based on a probability function and the determined characteristics and without executing the database query, wherein the predicted cardinality statistic predicts a probable cardinality of results of the grouped aggregation function; selecting, from a plurality of candidate query plans and based at least on the predicted cardinality statistic, a first candidate query plan to use in executing the database query, thereby optimizing the database query based on the predicted cardinality statistic; and executing the selected query plan in order to generate a set of query results, wherein the set of query results is returned to a requesting entity.