Patent EP0336584A2 successfully refreshed from Google Patents.
← Back to Patent Explorer
EP0336584A2 Expired / Lapsed EP ⏱️ 0.0 years remaining

Sort merge output

Assignee: International Business Machines Corp
•
Filing: 1989-03-16
•
Granted: —
•
Expires: 2009-03-16
📄 Original PDF 🌐 Google Patents 🔄 Sync Now

Abstract

Abstract In a relational database system, a method is used that increases the performance of the sort operation. An optimiser routine in the relational database manager analyses a user's complete query to determine whether the final sorted results can be used directly by the user as sorting occurs. If the sort results can be used, the sort results are sent to Relational Data Services in the relational database manager for output to the user. Depending upon the determination made by the optimiser routine, one of two output modes for the final sorted sequence string of data are selected by the relational database manager. In disk output mode, the last pass of the final sorted sequence string is written to disk. In fast direct output mode, the records of data are sent to the user as the final sorted sequence string is being merged during the last pass. Such an arrangement reduces the total sort time by eliminating the overhead of writing to disk during the fast direct output mode. Also, the response time, or availability for each record is reduced since each record is retrieved or sent to the Relational Data Services immediately after it has been sorted into the final sort order instead of completing the entire sort first, and then writing to disk.

Inventors

  • 👤 Philip Yen-Tan Chang
  • 👤 Daniel Jerome Coyle, Jr.
  • 👤 Timothy Ray Malkemus
  • 👤 Rebecca Ann Rodriguez
  • 👤 Philip John Welti

Bibliographic Details

Application Number —
Jurisdiction EP
Data Source google_patents
Last Synchronized 2026-10-30 13:06
CPC Classifications
G; G06; G06F; G06F16/00; G06F16/20; G06F16/24; G06F16/245; G06F16/2453; G06F16/2455; G06F16/24553; G06F16/24554; G06F16/24556; G06F16/2457; Y; Y10; Y10S; Y10S707/00; Y10S707/99931; Y10S707/99932; Y10S707/99937

Claims Analysis

Total Claims: 13
Claim 1
Independent Claim 91 words
A relational data base computer system supporting a relational data base, which data base can be interrogated by a user via a query statement to produce a sorted query result, the system including a relational data base manager, responsive to query statements, to determine, inter alia, which of two modes of output is to apply to the current query operation whereby, if the first mode is selected, the products of a sort operation are passed directly to the user and, in the second mode, the products are written into backing storage.
Claim 2
Dependent Claim 91 words
A relational data base computer system supporting a relational data base, which data base can be interrogated by a user via a query statement to produce a sorted query result, the system including a relational data base manager, responsive to query statements, to determine, inter alia, which of two modes of output is to apply to the current query operation whereby, if the first mode is selected, the products of a sort operation are passed directly to the user and, in the second mode, the products are written into backing storage.
Claim 3
Dependent Claim 57 words
A system as claimed in claim 1, wherein the relational database manager generates a plan for processing the query statement, and includes an optimiser which analyses the plan, determines if the sort result are required at least a predetermined number of times in the plan and, if so, selecting the second mode, else selecting the first mode.
Claim 4
Dependent Claim 63 words
A system as claimed in claim 2, wherein the output of the sort operation is directly passed in the first mode to a user of the relational database system if the plan has a sort input plan to a root plan of a table access plan or if the plan has a sort input plan to an outer plan of a join plan.
Claim 5
Dependent Claim 27 words
A system as claimed in claim 2, wherein the mode selected by the relational database manager can be determined by analysis of the query statement, per se.
Claim 6
Dependent Claim 27 words
A system as claimed in claim 4, wherein the first mode is selected if the query statement is an ORDER BY statement or a GROUP BY statement.
Claim 7
Dependent Claim 52 words
A system as claimed in claim 2, wherein the first mode is selected if an outer pass operation of a MERGE JOIN operation of the query statement is being performed and the second mode is selected if a different operation of the MERGE JOIN operation of the query statement is being performed.
Claim 8
Dependent Claim 105 words
A method of processing a query statement in a relational database system as claimed in claim 1, the method comprising: analysing the query statement or the execution thereof to determine if sorted output data of a sort operation of the query statement will be used a predetermined number of times; writing the sorted output to disk if the sorted output data will be used the predetermined number of times; and passing the sorted output data to a user of the relational database system as the sorted output data is ordered if the sorted output data will be used less than the predetermined number of times.
Claim 9
Dependent Claim 96 words
A method as claimed in claim 7, including: ordering a plurality of rows in the relational database into a plurality of ordered sequence strings; merging the ordered sequence strings into a plurality of merged sequence strings during at least one intermediate merge pass; returning sequentially, to a user of the relational database system, a plurality of final sorted rows resulting from a final merge pass of the merged sequence strings as each one of the final sorted rows are ordered, in the first mode; and writing the final sorted rows to disk, in the second mode.
Claim 10
Dependent Claim 170 words
A relational database system for performing a sort operation, the system comprising: means in a relational database manager, for determining, by analysis of a query statement and/or the execution thereof, a first or second mode for directing a final sort output of the sort operation; means for ordering a plurality of rows in a relational database into a plurality of ordered sequence strings; means for merging the ordered sequence strings into a plurality of merged sequence strings during at least one intermediate merge pass; means for selecting sequentially one of the rows from a top entry from each of the merged sequence strings as a next entry in a final single ordered string during a final merge pass; means for returning sequentially, to a user of the relational database system, the one of the rows as the row is being selected as the next entry in the final single ordered string, in the first mode; and means for writing the final single ordered string to disk in the second mode.
Claim 11
Dependent Claim 170 words
A relational database system for performing a sort operation, the system comprising: means in a relational database manager, for determining, by analysis of a query statement and/or the execution thereof, a first or second mode for directing a final sort output of the sort operation; means for ordering a plurality of rows in a relational database into a plurality of ordered sequence strings; means for merging the ordered sequence strings into a plurality of merged sequence strings during at least one intermediate merge pass; means for selecting sequentially one of the rows from a top entry from each of the merged sequence strings as a next entry in a final single ordered string during a final merge pass; means for returning sequentially, to a user of the relational database system, the one of the rows as the row is being selected as the next entry in the final single ordered string, in the first mode; and means for writing the final single ordered string to disk in the second mode.
Claim 12
Independent Claim 164 words
A method of performing a sort operation, in a relational data base system responsive to query statements requiring the same, the method comprising: determining a first or second mode for directing a final sort output of the sort operation by analysis of the query statement and/or the execution thereof; ordering a plurality of rows in the relational database into a plurality of ordered sequence strings; merging the ordered sequence strings into a plurality of merged sequence strings during at least one intermediate merge pass; selecting sequentially one of the rows from a top entry from each of the merged sequence strings as a next entry in a final single ordered string during a final merge pass; returning sequentially, to a user of the relational database system, the one of the rows as the row is being selected as the next entry in the final single ordered string, in the first mode; and writing the final single ordered string to disk in the second mode.
Claim 13
Independent Claim 164 words
A method of performing a sort operation, in a relational data base system responsive to query statements requiring the same, the method comprising: determining a first or second mode for directing a final sort output of the sort operation by analysis of the query statement and/or the execution thereof; ordering a plurality of rows in the relational database into a plurality of ordered sequence strings; merging the ordered sequence strings into a plurality of merged sequence strings during at least one intermediate merge pass; selecting sequentially one of the rows from a top entry from each of the merged sequence strings as a next entry in a final single ordered string during a final merge pass; returning sequentially, to a user of the relational database system, the one of the rows as the row is being selected as the next entry in the final single ordered string, in the first mode; and writing the final single ordered string to disk in the second mode.

References Cited (Backward Citations)

No citation records indexed.

USPTO Annuity & Maintenance Windows

Maintenance schedule is calculated for granted US utility patents.

Assigned Categories & Tags

No categories assigned to this patent yet.

Assign Category Tag