Optimization of SQL queries involving aggregate expressions using a plurality of local and global aggregation operations
First Claim
1. A method of optimizing a query in a computer system, the query being performed by the computer system to retrieve data from a relational database stored in one or more electronic storage devices coupled to the computer system, the method comprising the steps of:
- (a) examining the query in the computer system to determine whether the query includes one or more aggregation operations on rows of a table in the relational database;
(b) performing a plurality of local aggregation operations in the computer system, wherein rows of the table are locally aggregated by each of the local aggregation operations to create a plurality of local aggregate result rows; and
(c) performing a plurality of global aggregation operations in the computer system, wherein the local aggregate result rows created by the local aggregation operations are re-distributed to the plurality of global aggregation operations to be coalesced thereby to create a plurality of global aggregate result rows.
2 Assignments
0 Petitions
Accused Products
Abstract
A method, apparatus, and article of manufacture for optimizing SQL queries in a relational database management system involving aggregate and grouping functions. A local aggregation operation is performed on one or more processors of a massively parallel processor (MPP) computer system, wherein rows of the table that are local to each processor are locally aggregated to create one or more aggregate result rows. The aggregate result rows created by each of the local aggregation operations are then re-distributed to one or more processors and coalesced into a global aggregate result row by a global aggregation operation.
313 Citations
42 Claims
-
1. A method of optimizing a query in a computer system, the query being performed by the computer system to retrieve data from a relational database stored in one or more electronic storage devices coupled to the computer system, the method comprising the steps of:
-
(a) examining the query in the computer system to determine whether the query includes one or more aggregation operations on rows of a table in the relational database; (b) performing a plurality of local aggregation operations in the computer system, wherein rows of the table are locally aggregated by each of the local aggregation operations to create a plurality of local aggregate result rows; and (c) performing a plurality of global aggregation operations in the computer system, wherein the local aggregate result rows created by the local aggregation operations are re-distributed to the plurality of global aggregation operations to be coalesced thereby to create a plurality of global aggregate result rows. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)
-
-
15. An apparatus for optimizing a query, comprising:
-
(a) a computer system having one or more electronic storage devices coupled thereto, the data storage devices storing a relational database; (b) means, performed by the computer system, for examining the query in the computer system to determine whether the query includes one or more aggregation operations on rows of a table in the relational database; (c) means, performed by the computer system, for performing a plurality of local aggregation operations in the computer system, wherein rows of the table are locally aggregated by each of the local aggregation operations to create a plurality of local aggregate result rows; and (d) means, performed by the computer system, for performing a plurality of global aggregation operations in the computer system, wherein the local aggregate result rows created by the local aggregation operations are re-distributed to the plurality of global aggregation operations to be coalesced thereby to create a plurality of global aggregate result rows. - View Dependent Claims (16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28)
-
-
29. A program storage device, readable by a computer system, tangibly embodying one or more programs of instructions executable by the computer systems to perform method steps for executing a query, the query being performed by the computer to retrieve data from a relational database stored in one or more electronic storage devices coupled to the computer system, the method comprising the steps of:
-
(a) examining the query in the computer system to determine whether the query includes one or more aggregation operations on rows of a table in the relational database; (b) performing a plurality of local aggregation operations in the computer system, wherein rows of the table are locally aggregated by each of the local aggregation operations to create a plurality of local aggregate result rows; and (c) performing a plurality of global aggregation operations in the computer system, wherein the local aggregate result rows created by the local aggregation operations are re-distributed to the plurality of global aggregation operations to be coalesced thereby to create a plurality of global aggregate result rows. - View Dependent Claims (30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42)
-
Specification