Nova Patents
EP0336584A2

Sort merge output.

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.

EP0336584A2, drawing sheet 1
Sheet 1 of 12

Term

Term ended

Projected expiry passed 16 March 2009, 17.5 years ago.

  1. Priority
  2. Filed
  3. Published
  4. Projected expiry
  5. Today

10 claims: 3 independent, 7 dependent

  1. 1
    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.
  2. 9
    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.
  3. 10
    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.