×

Optimizing database queries using subquery composition

  • US 9,665,619 B1
  • Filed: 09/18/2015
  • Issued: 05/30/2017
  • Est. Priority Date: 05/04/2012
  • Status: Active Grant
First Claim
Patent Images

1. A computer implemented method for optimizing a database queries, the method comprising:

  • Receiving, by a database system, a request to optimize a database query, the database query configured to process a plurality of records of a database table stored in the database systemIdentifying an inner subquery and an outer subquery in the database query, the inner subquery nested within the outer subquery, wherein each of the inner subquery and the out subquery specifies one or more expression representing results of the subquery;

    Identifying an inner aggregate function in the one or more expressions representing results of the inner subquery and an outer aggregate function in the one or more expressions representing results of the outer subquery, wherein each aggregate function receives a plurality of input values and determines a numeric results by aggregating the plurality of input values;

    Determining if the result of the inner aggregate function is provided as an input to the outer aggregate function;

    Selecting a new aggregate function based on the inner aggregate function and the outer aggregate function if the result of the inner aggregate function is determined to be provided as an input to the outer aggregate functionGenerating a combined database query based on the outer subquery and the inner subquery, the combined database query specifying the new aggregate function; and

    Storing the combined database query.

View all claims
  • 6 Assignments
Timeline View
Assignment View
    ×
    ×