← Back to Patent Explorer
US5884299A Expired / Lapsed US ⏱️ 0.0 years remaining

Optimization of SQL queries involving aggregate expressions using a plurality of local and global aggregation operations

Assignee: Teradata US Inc
•
Filing: 1997-02-06
•
Granted: 1999-03-16
•
Expires: 2017-02-06
📄 Original PDF 🌐 Google Patents 🔄 Sync Now

Abstract

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.

Inventors

  • 👤 Bhashyam Ramesh
  • 👤 Timothy Brent Kraus
  • 👤 Todd Allan Walter

Bibliographic Details

Application Number —
Jurisdiction US
Data Source google_patents
Last Synchronized 2026-10-24 23:00
CPC Classifications
G; G06; G06F; G06F16/00; G06F16/20; G06F16/24; G06F16/245; G06F16/2455; G06F16/24553; G06F16/24554; G06F16/24556; G06F16/2453; G06F16/24532; Y; Y10; Y10S; Y10S707/00; Y10S707/99931; Y10S707/99932; Y10S707/99933

Claims Analysis

Total Claims: 45
Claim 1
Independent Claim 155 words
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.
Claim 2
Independent Claim 155 words
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.
Claim 3
Dependent Claim 15 words
The method of claim 1 above, wherein the computer system comprises a plurality of processors.
Claim 4
Dependent Claim 43 words
The method of claim 2 above, wherein the performing step (b) comprises the step of performing the local aggregation operations in two or more of the processors, wherein rows of the table are locally aggregated by the processors in the local aggregation operations.
Claim 5
Dependent Claim 80 words
The method of claim 3 above, wherein each of the local aggregation operations comprises the steps of: scanning rows from the table and qualifying the scanned rows; building one or more local aggregate result rows containing results from the local aggregation operation for the scanned rows; caching the local aggregate result rows in a memory of the computer system; and re-distributing the local aggregate result rows from the cache to the plurality of global aggregation operations in the computer system.
Claim 6
Dependent Claim 57 words
The method of claim 2 above, wherein the performing step (c) comprises the step of performing the global aggregation operations in two or more of the processors, wherein the local aggregate result rows created by the local aggregation operations are globally aggregated by the processors in the global aggregation operations to create the global aggregate result rows.
Claim 7
Dependent Claim 52 words
The method of claim 5 above, wherein each of the global aggregation operations comprises the steps of: receiving the local aggregate result rows from the plurality of local aggregation operations in the computer system; and building the plurality of global aggregate result rows containing results from the received local aggregate result rows.
Claim 8
Dependent Claim 24 words
The method of claim 2 above, further comprising the step of storing distinct sub-portions of the table on a different ones of the processors.
Claim 9
Dependent Claim 27 words
The method of claim 1 above, wherein the aggregation operations comprise one or more functions selected from a group comprising MAX, MIN, AVG, COUNT, and SUM functions.
Claim 10
Dependent Claim 14 words
The method of claim 1 above, wherein the aggregation operation comprises a grouping function.
Claim 11
Dependent Claim 70 words
The method of claim 1 above, wherein the performing step (b) further comprises the steps of: (1) storing the local aggregate result rows in a cache; (2) purging a purgeable portion of the cache to a spool file when there is an overflow of the cache; and (3) upon completion of the local aggregation operation, performing a sort-coalesce function on the spool file to create the local aggregate result rows.
Claim 12
Dependent Claim 43 words
The method of claim 10 above, wherein the performing step (3) further comprises the steps of: reading purged local aggregate result rows from the spool file; sorting the read rows by result groups; and coalescing the sorted rows that have identical result groups.
Claim 13
Dependent Claim 36 words
The method of claim 10 above, wherein the performing step (b) further comprises the step of re-distributing the local aggregate result rows from the spool file and the cache to the plurality of global aggregation operations.
Claim 14
Dependent Claim 70 words
The method of claim 1 above, wherein the performing step (c) further comprises the steps of: (1) storing the global aggregate result rows in a cache; (2) purging a purgeable portion of the cache to a spool file when there is an overflow of the cache; and (3) upon completion of the global aggregation operation, performing a sort-coalesce function on the spool file to create the global aggregate result rows.
Claim 15
Dependent Claim 43 words
The method of claim 13 above, wherein the performing step (3) further comprises the steps of: reading purged global aggregate result rows from the spool file; sorting the read rows by result groups; and coalescing the sorted rows that have identical result groups.
Claim 16
Independent Claim 160 words
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.
Claim 17
Independent Claim 160 words
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.
Claim 18
Dependent Claim 15 words
The apparatus of claim 15 above, wherein the computer system comprises a plurality of processors.
Claim 19
Dependent Claim 43 words
The apparatus of claim 16 above, wherein the means for performing (c) comprises means for performing the local aggregation operations in two or more of the processors, wherein rows of the table are locally aggregated by the processors in the local aggregation operations.
Claim 20
Dependent Claim 85 words
The apparatus of claim 17 above, wherein each of the local aggregation operations comprises: means for scanning rows from the table and qualifying the scanned rows; means for building one or more local aggregate result rows containing results from the local aggregation operation for the scanned rows; means for caching the local aggregate result rows in a memory of the computer system; and means for re-distributing the local aggregate result rows from the cache to the plurality of global aggregation operations in the computer system.
Claim 21
Dependent Claim 57 words
The apparatus of claim 16 above, wherein the means for performing (d) comprises means for performing the global aggregation operations in two or more of the processors, wherein the local aggregate result rows created by the local aggregation operations are globally aggregated by the processors in the global aggregation operations to create the global aggregate result rows.
Claim 22
Dependent Claim 53 words
The apparatus of claim 19 above, wherein each of the global aggregation operations comprises: means for receiving the local aggregate result rows from the plurality of local aggregation operations in the computer system; and means for building the plurality of global aggregate result rows containing results from the received local aggregate result rows.
Claim 23
Dependent Claim 22 words
The apparatus of claim 16 above, further comprising means for storing distinct sub-portions of the table on different ones of the processors.
Claim 24
Dependent Claim 27 words
The apparatus of claim 15 above, wherein the aggregation operations comprise one or more functions selected from a group comprising MAX, MIN, AVG, COUNT, and SUM functions.
Claim 25
Dependent Claim 14 words
The apparatus of claim 15 above, wherein the aggregation operation comprises a grouping function.
Claim 26
Dependent Claim 74 words
The apparatus of claim 15 above, wherein the means for performing (c) further comprises: (1) means for storing the local aggregate result rows in a cache; (2) means for purging a purgeable portion of the cache to a spool file when there is an overflow of the cache; and (3) means for performing a sort-coalesce function on the spool file to create the local aggregate result rows, upon completion of the local aggregation operation.
Claim 27
Dependent Claim 47 words
The apparatus of claim 24 above, wherein the means for performing 3) further comprises: means for reading purged local aggregate result rows from the spool file; means for sorting the read rows by result groups; and means for coalescing the sorted rows that have identical result groups.
Claim 28
Dependent Claim 36 words
The apparatus of claim 24 above, wherein the means for performing (c) further comprises means for re-distributing the local aggregate result rows from the spool file and the cache to the plurality of global aggregation operations.
Claim 29
Dependent Claim 74 words
The apparatus of claim 15 above, wherein the means for performing (d) further comprises: (1) means for storing the global aggregate result rows in a cache; (2) means for purging a purgeable portion of the cache to a spool file when there is an overflow of the cache; and (3) means for performing a sort-coalesce function on the spool file to create the global aggregate result rows, upon completion of the global aggregation operation.
Claim 30
Dependent Claim 47 words
The apparatus of claim 27 above, wherein the means for performing (3) further comprises: means for reading purged global aggregate result rows from the spool file; means for sorting the read rows by result groups; and means for coalescing the sorted rows that have identical result groups.
Claim 31
Dependent Claim 174 words
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.
Claim 32
Dependent Claim 174 words
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.
Claim 33
Dependent Claim 15 words
The method of claim 29 above, wherein the computer system comprises a plurality of processors.
Claim 34
Dependent Claim 43 words
The method of claim 30 above, wherein the performing step (b) comprises the step of performing the local aggregation operations in two or more of the processors, wherein rows of the table are locally aggregated by the processors in the local aggregation operations.
Claim 35
Dependent Claim 80 words
The method of claim 31 above, wherein each of the local aggregation operations comprises the steps of: scanning rows from the table and qualifying the scanned rows; building one or more local aggregate result rows containing results from the local aggregation operation for the scanned rows; caching the local aggregate result rows in a memory of the computer system; and re-distributing the local aggregate result rows from the cache to the plurality of global aggregation operations in the computer system.
Claim 36
Dependent Claim 57 words
The method of claim 30 above, wherein the performing step (c) comprises the step of performing the global aggregation operations in two or more of the processors, wherein the local aggregate result rows created by the local aggregation operations are globally aggregated by the processors in the global aggregation operations to create the global aggregate result rows.
Claim 37
Dependent Claim 52 words
The method of claim 33 above, wherein each of the global aggregation operations comprises the steps of: receiving the local aggregate result rows from the plurality of local aggregation operations in the computer system; and building the plurality of global aggregate result rows containing results from the received local aggregate result rows.
Claim 38
Dependent Claim 23 words
The method of claim 30 above, further comprising the step of storing distinct sub-portions of the table on different ones of the processors.
Claim 39
Dependent Claim 27 words
The method of claim 29 above, wherein the aggregation operations comprise one or more functions selected from a group comprising MAX, MIN, AVG, COUNT, and SUM functions.
Claim 40
Dependent Claim 14 words
The method of claim 29 above, wherein the aggregation operation comprises a grouping function.
Claim 41
Dependent Claim 70 words
The method of claim 29 above, wherein the performing step (b) further comprises the steps of: (1) storing the local aggregate result rows in a cache; (2) purging a purgeable portion of the cache to a spool file when there is an overflow of the cache; and (3) upon completion of the local aggregation operation, performing a sort-coalesce function on the spool file to create the local aggregate result rows.
Claim 42
Dependent Claim 43 words
The method of claim 38 above, wherein the performing step (3) further comprises the steps of: reading purged local aggregate result rows from the spool file; sorting the read rows by result groups; and coalescing the sorted rows that have identical result groups.
Claim 43
Dependent Claim 36 words
The method of claim 38 above, wherein the performing step (b) further comprises the step of re-distributing the local aggregate result rows from the spool file and the cache to the plurality of global aggregation operations.
Claim 44
Dependent Claim 70 words
The method of claim 29 above, wherein the performing step (c) further comprises the steps of: (1) storing the global aggregate result rows in a cache; (2) purging a purgeable portion of the cache to a spool file when there is an overflow of the cache; and (3) upon completion of the global aggregation operation, performing a sort-coalesce function on the spool file to create the global aggregate result rows.
Claim 45
Dependent Claim 43 words
The method of claim 41 above, wherein the performing step (3) further comprises the steps of: reading purged global aggregate result rows from the spool file; sorting the read rows by result groups; and coalescing the sorted rows that have identical result groups.

References Cited (Backward Citations)

US5655080A Cited

USPTO Annuity & Maintenance Windows

Annuity Stage Window Opens Payment Deadline Surcharge Period Until Estimated Fee Status
3.5 Years (Year 4) 2002-03-15 2002-09-14 2003-03-16 $2000.00 Window Closed / Lapsed
7.5 Years (Year 8) 2006-03-15 2006-09-14 2007-03-16 $3760.00 Window Closed / Lapsed
11.5 Years (Year 12) 2010-03-15 2010-09-14 2011-03-16 $7700.00 Window Closed / Lapsed

Assigned Categories & Tags

No categories assigned to this patent yet.

Assign Category Tag