JP2943693B2 - Sort work file space management method - Google Patents

Sort work file space management method

Info

Publication number
JP2943693B2
JP2943693B2 JP8130751A JP13075196A JP2943693B2 JP 2943693 B2 JP2943693 B2 JP 2943693B2 JP 8130751 A JP8130751 A JP 8130751A JP 13075196 A JP13075196 A JP 13075196A JP 2943693 B2 JP2943693 B2 JP 2943693B2
Authority
JP
Japan
Prior art keywords
work file
output
cylinder position
file
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP8130751A
Other languages
Japanese (ja)
Other versions
JPH09293008A (en
Inventor
英司 北村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
Nippon Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP8130751A priority Critical patent/JP2943693B2/en
Publication of JPH09293008A publication Critical patent/JPH09293008A/en
Application granted granted Critical
Publication of JP2943693B2 publication Critical patent/JP2943693B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、主記憶装置に入り
切らないような大量のデータを作業ファイルを用いてソ
ートするソート処理方式に関し、特にソート処理を高速
に行うためのソート作業ファイルスペース管理方式に関
する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a sort processing method for sorting a large amount of data which cannot be stored in a main storage device by using a work file, and more particularly to a sort work file space management for performing a sort processing at high speed. About the method.

【0002】[0002]

【従来の技術】従来、磁気ディスク装置上の作業ファイ
ルを用いてソート処理を行うソートプログラムの内部処
理手順としては、レコードを入力しながらソートを行
い、「ストリング」と呼ばれるソート済みレコード列を
作業ファイルに複数書き出すプリソートフェーズと、各
ストリングのマージ処理を行うコレーションフェーズ
と、に分けて行うのが一般的である。
2. Description of the Related Art Conventionally, as an internal processing procedure of a sort program for performing a sort process using a work file on a magnetic disk drive, sorting is performed while inputting records, and a sorted record sequence called a "string" is processed. In general, a pre-sort phase for writing a plurality of files to a file and a collation phase for merging each string are performed separately.

【0003】コレーションフェーズにおいてストリング
のマージ結果を再度作業ファイルに出力する際には、作
業ファイルからの入力が完了して再利用可能となった領
域(以下「アベイラブルセクタ」ともいう)を使用する
ことにより、磁気ディスク装置上に新たに作業ファイル
スペースを確保することが不要とされている。
In the collation phase, when the result of string merging is output to the work file again, an area (hereinafter, also referred to as an "available sector") which has been completed and has become reusable is used. This eliminates the need to secure a new work file space on the magnetic disk device.

【0004】しかし、このようなアベイラブルセクタ
は、磁気ディスク装置上の連続した領域に確保されると
いう保証はないため、特にデータ量が多く何回もマージ
を繰り返すような場合には、磁気ディスク装置のヘッド
の移動が頻繁に発生して性能の低下を引き起こすおそれ
がある。
However, there is no guarantee that such an available sector is secured in a continuous area on the magnetic disk drive. Therefore, especially when the data amount is large and merging is repeated many times, the magnetic disk drive is not used. Movement of the head frequently occurs, which may cause performance degradation.

【0005】そこで、アベイラブルセクタを使用する際
の性能の低下を防止するために、例えば特開平5−16
5604号公報には、最後に発生したアベイラブルセク
タを用いることにより、磁気ディスク装置のヘッドの移
動距離を小さくして性能の向上を図ることができる方式
が提案されている。
Therefore, in order to prevent a decrease in performance when using an available sector, for example, Japanese Patent Laid-Open Publication No.
Japanese Patent Application Laid-Open No. 5604 proposes a system that can improve the performance by using the last available sector to reduce the moving distance of the head of the magnetic disk drive.

【0006】[0006]

【発明が解決しようとする課題】しかしながら、前述し
た特開平5−165604号公報に記載された従来の方
式では、作業ファイルからの入力処理の直後に作業ファ
イルへの出力処理が行われる場合には有効であるが、ア
ベイラブルセクタが連続した領域ではなく離れた領域に
作られたような場合にはその移動に時間がかかるため、
連続して出力処理が行われるような場合には有効ではな
いという問題がある。
However, in the conventional method described in Japanese Patent Laid-Open No. 5-165604 described above, when output processing to a work file is performed immediately after input processing from a work file, It is effective, but if the available sector is created in a distant area instead of a continuous area, it takes time to move,
There is a problem that it is not effective when output processing is performed continuously.

【0007】また、前述した特開平5−165604号
公報に記載された従来の方式では、作業ファイルからの
入力処理の直後に作業ファイルへの出力処理が行われる
場合であっても、その直前にその別プロセスの入出力処
理による磁気ディスク装置への入出力処理が行われてい
た場合には、その別プロセスの入出力処理により磁気デ
ィスク装置のヘッドが移動してしまい、入力処理の直後
に出力処理が行われる場合であっても再びヘッドを移動
しなければならず、性能の低下が生じるという問題があ
る。
In the conventional method described in Japanese Patent Application Laid-Open No. 5-165604, even if output processing to a work file is performed immediately after input processing from a work file, the processing is performed immediately before the processing. If the input / output processing of the magnetic disk device was performed by the input / output processing of another process, the head of the magnetic disk device was moved by the input / output processing of the other process, and the output was performed immediately after the input processing. Even when the processing is performed, the head must be moved again, and there is a problem that the performance is deteriorated.

【0008】従って、本発明は前述した問題点に鑑みて
なされたものであり、磁気ディスク装置のヘッドの移動
距離が最小となるようにし、作業ファイルの入出力処理
に要する時間を短縮することにより、作業ファイルを用
いた大量のデータのソートを高速化して性能の向上を図
ることができるソート作業ファイルスペース管理方式を
提供することを目的とする。
SUMMARY OF THE INVENTION Accordingly, the present invention has been made in view of the above-mentioned problems, and has been made by minimizing the moving distance of the head of a magnetic disk drive and shortening the time required for input / output processing of a work file. Another object of the present invention is to provide a sort work file space management method capable of improving the performance by speeding up the sorting of a large amount of data using a work file.

【0009】[0009]

【課題を解決するための手段】前述した目的を達成する
ため、本発明は、主記憶装置に入り切らないような大量
のデータを作業ファイルを用いてソートするソート処理
方式において、ソート処理の中間結果を一時的に保存す
るための作業ファイルと、ソート処理の中間結果である
ソート済みレコード列を主記憶装置から前記作業ファイ
ル上に出力する作業ファイル出力手段と、前記作業ファ
イル上に出力されたソート済みレコード列をマージする
ためにソート済みレコード列を再度主記憶装置に読み込
むための作業ファイル入力手段と、前記作業ファイル上
に出力されたソート済みレコード列が主記憶装置に入力
されたことで再利用可能になった前記作業ファイル上の
領域を管理するテーブルであって、前記作業ファイル入
力手段により前記ソート済みレコード列を主記憶装置に
読み込む度に該読み込まれた領域の位置を登録するアベ
イラブルセクタ管理テーブルと、前記作業ファイル上に
出力されたソート済みレコード列をマージしてマージ結
果を再度前記作業ファイルに出力する際に、前記作業フ
ァイル出力手段により呼び出され、次に出力すべき前記
作業ファイル上の領域を前記アベイラブルセクタ管理テ
ーブルから選択して前記作業ファイル出力手段に通知す
るアベイラブルセクタ選択手段と、磁気ディスク装置の
ヘッドの現在のシリンダ位置を取得するためのシリンダ
位置取得手段と、を備え、前記作業ファイル入力手段
は、前記ソート済みレコード列を主記憶装置に読み込む
度に、入出力を行うために必要な位置情報とともに、入
力処理が行われた後に前記シリンダ位置取得手段により
取得した磁気ディスク装置のヘッドのシリンダ位置を前
記アベイラブルセクタ管理テーブルに登録し、前記アベ
イラブルセクタ選択手段は、次に出力すべき前記作業フ
ァイル上の領域を選択する際に、前記シリンダ位置取得
手段により磁気ディスク装置のヘッドの現在のシリンダ
位置を取得し、該取得された現在のシリンダ位置と、前
記アベイラブルセクタ管理テーブルに登録されている各
領域のシリンダ位置と、を比較し、最も近いシリンダ位
置にある領域を選択することを特徴とするソート作業フ
ァイルスペース管理方式を提供する。
SUMMARY OF THE INVENTION In order to achieve the above-mentioned object, the present invention provides a sort processing method for sorting a large amount of data that cannot be stored in a main storage device by using a work file. A work file for temporarily storing the result, a work file output means for outputting a sorted record string which is an intermediate result of the sorting process from the main storage device to the work file, and a work file output means for outputting the work file to the work file. A work file input means for reading the sorted record sequence into the main storage device again to merge the sorted record sequence, and a sorted record sequence output on the work file being input to the main storage device. A table for managing an area on the work file that has become reusable, wherein the work file input means controls the area. Each time a read-out record sequence is read into the main storage device, an available sector management table for registering the position of the read area and the sorted record sequence output on the work file are merged, and the merge result is re-read. An available sector selection unit that is called by the work file output unit when outputting to the work file, selects an area on the work file to be output next from the available sector management table, and notifies the work file output unit of the area; And a cylinder position obtaining means for obtaining the current cylinder position of the head of the magnetic disk drive, wherein the work file input means performs input / output each time the sorted record sequence is read into the main storage device. After the input processing is performed, the cylinder position The cylinder position of the head of the magnetic disk drive obtained by the obtaining unit is registered in the available sector management table, and the available sector selecting unit selects the cylinder position when selecting an area on the work file to be output next. The current cylinder position of the head of the magnetic disk drive is obtained by the obtaining unit, and the obtained current cylinder position is compared with the cylinder position of each area registered in the available sector management table, and the closest A sorting work file space management method characterized by selecting an area at a cylinder position.

【0010】前述した構成のもとで、本発明によれば、
アベイラブルセクタ選択手段が磁気ディスク装置のヘッ
ドの移動距離が最小となるアベイラブルセクタを出力先
として選択するため、連続してアベイラブルセクタに出
力する場合や、他のプロセスによって磁気ディスク装置
のヘッドが移動してしまっている場合でも、磁気ディス
ク装置のヘッドの移動に要する時間を最小にすることが
できる。
According to the present invention with the above-described configuration,
Since the available sector selection means selects the available sector in which the moving distance of the head of the magnetic disk device is the minimum as the output destination, the output of the magnetic disk device is continuously performed, or the head of the magnetic disk device is moved by another process. Even in the case where the magnetic disk drive has been lost, the time required for moving the head of the magnetic disk drive can be minimized.

【0011】[0011]

【発明の実施の形態】次に、本発明の実施の形態につい
て図面を参照して詳細に説明する。
Next, embodiments of the present invention will be described in detail with reference to the drawings.

【0012】図1は、本発明の実施の形態の構成を示す
ブロック図である。図1を参照すると、本発明の実施の
形態は、ソート処理手段1と、主記憶装置2と、磁気デ
ィスク装置3と、から構成される。
FIG. 1 is a block diagram showing a configuration of an embodiment of the present invention. Referring to FIG. 1, the embodiment of the present invention includes a sort processing unit 1, a main storage device 2, and a magnetic disk device 3.

【0013】ソート処理手段1は、アベイラブルセクタ
選択手段11と、作業ファイル出力手段12と、作業フ
ァイル入力手段13と、シリンダ位置取得手段14と、
を有している。また、主記憶装置2は、アベイラブルセ
クタ管理テーブル21を有し、磁気ディスク装置3は、
作業ファイル31を有している。
The sort processing means 1 includes an available sector selection means 11, a work file output means 12, a work file input means 13, a cylinder position acquisition means 14,
have. The main storage device 2 has an available sector management table 21, and the magnetic disk device 3
It has a work file 31.

【0014】ソート処理手段1は、ソート処理のコレー
ションフェーズにおいて作業ファイル出力手段12によ
り磁気ディスク装置3上の作業ファイル31への出力処
理を行い、また作業ファイル入力手段13により磁気デ
ィスク装置3上の作業ファイル31からの入力処理を行
う。
The sort processing means 1 performs output processing to the work file 31 on the magnetic disk drive 3 by the work file output means 12 in the collation phase of the sort processing, and performs the output processing on the magnetic disk drive 3 by the work file input means 13. The input process from the work file 31 is performed.

【0015】図2は、図1に示したアベイラブルセクタ
管理テーブル21の構成を示す図である。
FIG. 2 is a diagram showing a configuration of the available sector management table 21 shown in FIG.

【0016】図2を参照すると、アベイラブルセクタ管
理テーブル21は、磁気ディスク装置3上のファイル内
の特定の領域へのアクセスを行うために必要な位置情報
であるファイル記述子211とファイル内オフセットア
ドレス212とを構成要素として含む他、磁気ディスク
装置3内における物理シリンダ位置213を構成要素と
して含む。
Referring to FIG. 2, the available sector management table 21 includes a file descriptor 211, which is positional information necessary for accessing a specific area in a file on the magnetic disk device 3, and an offset address in the file. 212 as a component, and also includes a physical cylinder position 213 in the magnetic disk drive 3 as a component.

【0017】ここで、「ファイル記述子」とは、オペレ
ーティングシステムに対してプログラムが入出力処理を
行うファイルを指定するための番号であり、ファイルの
オープン時にオペレーティングシステムからプログラム
側へ通知される。また、「ファイル内オフセットアドレ
ス」とは、ファイルの先頭からの位置を表すものであ
る。さらに、「物理シリンダ位置」とは、作業ファイル
31へ出力する際にアベイラブルセクタ選択手段11が
磁気ディスク装置3のヘッドの移動距離が最小となるよ
うな領域を選択するための情報として用いられるもので
ある。すなわち、出力処理が行われようとしているとき
には、磁気ディスク装置3のヘッドの現在のシリンダ位
置に最も近いシリンダ位置を持つアベイラブルセクタが
出力先の領域として選択される。
Here, the "file descriptor" is a number for specifying a file on which the program performs input / output processing with respect to the operating system, and is notified from the operating system to the program when the file is opened. The “offset address in the file” indicates a position from the beginning of the file. Further, the "physical cylinder position" is used as information for the available sector selecting means 11 to select an area in which the moving distance of the head of the magnetic disk drive 3 is minimized when outputting to the work file 31. It is. That is, when an output process is about to be performed, an available sector having a cylinder position closest to the current cylinder position of the head of the magnetic disk drive 3 is selected as an output destination area.

【0018】なお、アベイラブルセクタの選択方法とし
ては、例えば以下のような手順に従う方法がある。すな
わち、まず作業ファイル31からの入力処理時に、その
際に発行された磁気ディスク装置3への入力要求でのシ
リンダ位置をアベイラブルセクタ管理テーブル21に格
納しておく。そして、作業ファイル31への出力処理の
要求時に、最初に磁気ディスク装置3のヘッドの現在の
シリンダ位置を取得し、アベイラブルセクタ管理テーブ
ル21内の1番目と2番目のエントリのそれぞれのアベ
イラブルセクタのシリンダ位置と、ヘッドの現在のシリ
ンダ位置と、の差を比較して、その差がより小さいもの
を選ぶ。その後、選ばれたエントリのシリンダ位置と、
アベイラブルセクタ管理テーブル21内の3番目のエン
トリのアベイラブルセクタのシリンダ位置、4番目のエ
ントリのアベイラブルセクタのシリンダ位置、…との比
較を順に繰り返し、差がより小さいエントリを選んでゆ
き、最終的に磁気ディスク装置3のヘッドのシリンダ位
置と、アベイラブルセクタのシリンダ位置と、の差が最
も小さくなるエントリのアベイラブルセクタを選択す
る。なお、検索中にシリンダ位置の差が“0”となるエ
ントリを発見した場合、すなわち同一シリンダにあるア
ベイラブルセクタを発見した場合には、その時点で検索
を中止し、そのエントリのアベイラブルセクタを選択す
る。
As a method for selecting an available sector, for example, there is a method according to the following procedure. That is, first, at the time of input processing from the work file 31, the cylinder position in the input request to the magnetic disk device 3 issued at that time is stored in the available sector management table 21. At the time of a request for output processing to the work file 31, first, the current cylinder position of the head of the magnetic disk drive 3 is obtained, and the available sector of each of the first and second entries in the available sector management table 21 is obtained. The difference between the cylinder position and the current cylinder position of the head is compared, and the one with the smaller difference is selected. Then, the cylinder position of the selected entry,
The cylinder position of the available sector of the third entry in the available sector management table 21, the cylinder position of the available sector of the fourth entry, and so on are repeated in order, and the entry with the smaller difference is selected. The available sector of the entry that minimizes the difference between the cylinder position of the head of the magnetic disk drive 3 and the cylinder position of the available sector is selected. If an entry with a cylinder position difference of “0” is found during the search, that is, if an available sector in the same cylinder is found, the search is stopped at that time and the available sector of the entry is selected. I do.

【0019】図3は、本発明の実施の形態におけるソー
ト処理を説明するためのフローチャートである。
FIG. 3 is a flowchart for explaining the sort processing in the embodiment of the present invention.

【0020】以下、図3を参照して本発明の実施の形態
の動作を説明する。ただし、図3において、ソート開始
処理、プリソート処理(ステップ310)およびソート
終了処理は、本発明には直接関係ない部分であるので、
ここでの説明は省略する。
The operation of the embodiment of the present invention will be described below with reference to FIG. However, in FIG. 3, the sort start processing, the presort processing (step 310), and the sort end processing are parts that are not directly related to the present invention.
The description here is omitted.

【0021】なお、図3において、ステップ322、3
23、325および326の処理は作業ファイル入力手
段13により実行され、ステップ333、334、33
7および338の処理は作業ファイル出力手段12によ
り実行され、ステップ336の処理はアベイラブルセク
タ選択手段11により実行され、ステップ324および
335の処理はシリンダ位置取得手段14により実行さ
れる。
In FIG. 3, steps 322, 3
23, 325 and 326 are executed by the work file input means 13 and steps 333, 334 and 33 are executed.
7 and 338 are executed by the work file output unit 12, the process of step 336 is executed by the available sector selection unit 11, and the processes of steps 324 and 335 are executed by the cylinder position acquisition unit 14.

【0022】図3を参照すると、プリソート処理(ステ
ップ310)を終了し、コレーション処理(ステップ3
20)を開始した後、レコード入力要求がなされたとき
には(ステップ321)、主記憶装置2上の作業ファイ
ルバッファからレコードを取り出す(ステップ32
6)。ただし、作業ファイルバッファにレコードがない
場合には(ステップ322)、作業ファイル入力手段1
3は作業ファイル31から1ブロック分を作業ファイル
バッファへ入力し(ステップ323)、シリンダ位置取
得手段14によりこの入力された1ブロックのあった作
業ファイル上の領域32のシリンダ位置を取得し(ステ
ップ324)、取得したシリンダ位置とファイル記述子
とファイル内オフセットアドレスとをアベイラブルセク
タ位置情報としてアベイラブルセクタ管理テーブル21
に登録した後(ステップ325)、作業ファイルバッフ
ァからレコードを取り出す(ステップ326)。
Referring to FIG. 3, the presort processing (step 310) is completed, and the collation processing (step 3) is completed.
After the start of step 20), when a record input request is made (step 321), the record is fetched from the work file buffer on the main storage device 2 (step 32).
6). However, if there is no record in the work file buffer (step 322), the work file input means 1
3 inputs one block from the work file 31 to the work file buffer (step 323), and the cylinder position obtaining means 14 obtains the cylinder position of the area 32 in the work file containing the input one block (step 323). 324), the available sector management table 21 using the obtained cylinder position, file descriptor, and offset address in the file as available sector position information.
After that, the record is taken out from the work file buffer (step 326).

【0023】このようにして得られたレコードについて
マージ処理を行い(ステップ330)、レコード出力要
求がなされたときには(ステップ332)、主記憶装置
上の作業ファイルバッファへレコードの転送を行う(ス
テップ338)。ただし、転送しようとするときに作業
ファイルバッファが満杯である場合には(ステップ33
3)、作業ファイル出力手段12はレコードの転送の前
に作業ファイルバッファの内容を作業ファイル31へ出
力する(ステップ337)。このとき、作業ファイル出
力手段12はアベイラブルセクタ選択手段11へアベイ
ラブルセクタを要求し(ステップ334)、アベイラブ
ルセクタ選択手段11はシリンダ位置取得手段14によ
り磁気ディスク装置3のヘッドの現在のシリンダ位置を
取得し(ステップ335)、アベイラブルセクタ管理テ
ーブル21内に登録されているシリンダ位置を参照して
シリンダ位置が最も近く磁気ディスク装置3のヘッドの
移動距離が最小になるようなアベイラブルセクタを選択
し(ステップ336)、選択されたアベイラブルセクタ
の領域を作業ファイルバッファの内容の出力先とする。
The record thus obtained is merged (step 330), and when a record output request is made (step 332), the record is transferred to a work file buffer on the main storage (step 338). ). However, if the work file buffer is full when attempting to transfer (step 33
3), the work file output means 12 outputs the contents of the work file buffer to the work file 31 before transferring the record (step 337). At this time, the work file output unit 12 requests an available sector from the available sector selection unit 11 (step 334), and the available sector selection unit 11 obtains the current cylinder position of the head of the magnetic disk device 3 by the cylinder position obtaining unit 14. (Step 335), referring to the cylinder position registered in the available sector management table 21, select an available sector that has the closest cylinder position and minimizes the moving distance of the head of the magnetic disk drive 3 (Step 335). 336), the area of the selected available sector is set as the output destination of the contents of the work file buffer.

【0024】このようにして、全レコードのマージが完
了するまで(ステップ341)、レコードの入力処理と
出力処理とが繰り返される。なお、レコードの入力処理
と出力処理とは交互に行われるものではなく、特にコレ
ーション処理(ステップ320)での最終マージの段階
では(ステップ331)、作業ファイルへの出力処理は
なく入力処理のみが繰り返され、この間の入力処理では
アベイラブルセクタの登録は行われない。
In this way, the record input processing and the output processing are repeated until the merging of all the records is completed (step 341). Note that the record input processing and the output processing are not performed alternately. Particularly, at the final merge stage (step 331) in the collation processing (step 320), there is no output processing to the work file and only the input processing. Are repeated, and no available sector is registered in the input processing during this time.

【0025】図4は、本発明の実施の形態におけるシリ
ンダ位置取得処理を説明するためのフローチャートであ
る。図1に示したシリンダ位置取得手段14によりシリ
ンダ位置情報を取得するための具体的な方法は、オペレ
ーティングシステム等に依存するため特定はできない
が、その一方法について図4を参照して説明する。
FIG. 4 is a flowchart for explaining a cylinder position obtaining process according to the embodiment of the present invention. Although a specific method for obtaining the cylinder position information by the cylinder position obtaining means 14 shown in FIG. 1 depends on the operating system or the like and cannot be specified, one method will be described with reference to FIG.

【0026】なお、この方法では、最後に入出力が行わ
れたセクタ(磁気ディスク装置の入出力の単位領域であ
り、データのファイルによる管理方法とは無関係に決め
られるもの)の番号がオペレーティングシステムのシス
テム管理領域に記録されているものとする。このような
前提のもとで、シリンダ位置取得手段14は、まず最後
に入出力が行われたセクタ番号mを取得するとともに
(ステップ401)、磁気ディスク装置3のシリンダあ
たりのセクタ数nを取得し(ステップ402)、m/n
(小数点以下切り捨て)の式に従ってヘッドのシリンダ
位置を算出する(ステップ403)。
In this method, the number of the sector (the unit area of the input / output of the magnetic disk device, which is determined independently of the data file management method) is the number of the last input / output sector. It is assumed to be recorded in the system management area. Under such a premise, the cylinder position obtaining means 14 first obtains the sector number m of the last input / output (step 401) and obtains the number n of sectors per cylinder of the magnetic disk drive 3. (Step 402), m / n
The cylinder position of the head is calculated according to the formula (round down the decimal point) (step 403).

【0027】ここで、もしシリンダ位置を計算せずにセ
クタ番号の差のみでアベイラブルセクタを決定したとす
ると、セクタ番号の最も近いアベイラブルセクタであっ
てもシリンダは離れているということが起こり得るた
め、必ずシリンダ位置を計算して判断する。
Here, if the available sector is determined only by the difference between the sector numbers without calculating the cylinder position, it is possible that the cylinders are distant even in the available sector having the closest sector number. Calculate and determine the cylinder position.

【0028】[0028]

【実施例】次に、前述した本発明の実施の形態をより具
体的に説明するために、本発明の実施の形態を適用して
実際にソート処理を行う場合の一実施例について図面を
参照して詳細に説明する。なお、本実施例においては、
ソート処理の後半のコレーションフェーズにおける1回
分のマージについて説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, in order to more specifically describe the above-described embodiment of the present invention, with reference to the drawings, an embodiment in which the embodiment of the present invention is applied and sort processing is actually performed will be described. And will be described in detail. In this embodiment,
One merge in the collation phase in the latter half of the sort process will be described.

【0029】図5は、本発明の一実施例を説明するため
のブロック図である。図5を参照すると、本実施例は、
磁気ディスク装置51と、主記憶装置53と、ソート処
理手段54と、から構成される。
FIG. 5 is a block diagram for explaining an embodiment of the present invention. Referring to FIG. 5, the present embodiment includes:
It comprises a magnetic disk device 51, a main storage device 53, and a sort processing means 54.

【0030】ソート処理手段54は、図1に示したソー
ト処理手段1と同様の構成であるため、ここでの説明は
省略する。
Since the sort processing means 54 has the same configuration as the sort processing means 1 shown in FIG. 1, the description is omitted here.

【0031】磁気ディスク装置51上の作業ファイル領
域52には、ストリング(#1)521、ストリング
(#2)522およびストリング(#3)523という
3本のストリングが出力されている。
In the work file area 52 on the magnetic disk device 51, three strings of a string (# 1) 521, a string (# 2) 522 and a string (# 3) 523 are output.

【0032】ストリング(#1)521およびストリン
グ(#2)522はそれぞれ3ブロックからなり、磁気
ディスク装置51のシリンダ(#1)511に出力され
ている。ストリング(#3)523は4ブロックからな
り、磁気ディスク装置51のシリンダ(#2)512に
出力されている。
The string (# 1) 521 and the string (# 2) 522 are each composed of three blocks and are output to the cylinder (# 1) 511 of the magnetic disk drive 51. The string (# 3) 523 is composed of four blocks and is output to the cylinder (# 2) 512 of the magnetic disk device 51.

【0033】本実施例においては、各ブロックが1セク
タ分のサイズを有するものとし、例えば図5に示した符
号5211、5212および5213は、ストリング5
21を構成するブロックであり、それぞれのブロックの
セクタ位置が1、2および3である。なお、この関係は
ストリング(#2)522およびストリング(#3)5
23についても同様である。
In this embodiment, it is assumed that each block has a size of one sector. For example, reference numerals 5211, 5212 and 5213 shown in FIG.
21 and the sector position of each block is 1, 2 and 3. Note that this relationship is established between the string (# 2) 522 and the string (# 3) 5
The same applies to 23.

【0034】また、各ブロックは2件分のレコードを含
むものとする。例えば図5に示した符号ac、de等は
ブロック内のレコードであり、その符号の1文字が1レ
コード(キーの内容)を示している。なお、以下の説明
においては、各ブロックを“ブロックac”、“ブロッ
クde”等と称する。
It is assumed that each block includes two records. For example, the codes ac and de shown in FIG. 5 are records in the block, and one character of the code indicates one record (contents of a key). In the following description, each block is referred to as “block ac”, “block de”, and the like.

【0035】主記憶装置53は、ソートメモリ531
と、アベイラブルセクタ管理テーブル532と、を有し
ている。なお、ソートメモリ531は、ストリング数
分、すなわち3個の入力バッファ5311、5312お
よび5313と、出力バッファ5314と、を有し、各
ストリングから1ブロックずつ入力バッファへ読み込ん
でいく。
The main storage device 53 has a sort memory 531
And an available sector management table 532. The sort memory 531 has the number of strings, that is, three input buffers 5311, 5312, and 5313, and an output buffer 5314, and reads one block from each string into the input buffer.

【0036】マージ処理においては、入力バッファ内の
レコードを対象に行い、出力レコードが決定すると、そ
れを出力バッファ5314にバッファリングして出力す
る。また、1つの入力バッファ内の全レコードを出力バ
ッファに転送して入力バッファが空になった時点で次の
ブロックを読み込む。
The merge process is performed on records in the input buffer, and when an output record is determined, it is buffered in the output buffer 5314 and output. Also, all records in one input buffer are transferred to the output buffer, and the next block is read when the input buffer becomes empty.

【0037】次に、本実施例の動作を説明する。図6な
いし図9は、本発明の一実施例におけるソート処理を説
明するための図であり、図5に示した構成と同一のもの
については同一の符号を付している。
Next, the operation of this embodiment will be described. 6 to 9 are diagrams for explaining the sorting process in one embodiment of the present invention, and the same components as those shown in FIG. 5 are denoted by the same reference numerals.

【0038】なお、以下の説明および対応する図面にお
いては、入力前のレコードとマージ処理後の出力結果の
レコードとを区別するために、前者を小文字で表し、後
者を大文字で表すものとする。また、本実施例において
は、アベイラブルセクタ管理テーブル532にシリンダ
位置とシリンダ内セクタ位置とを登録するが、その際に
シリンダ1内のセクタ位置1は“位置1−1”という具
合に表すものとする。
In the following description and the corresponding drawings, in order to distinguish between a record before input and a record of an output result after merge processing, the former is represented by a lowercase letter, and the latter is represented by an uppercase letter. In the present embodiment, the cylinder position and the sector position in the cylinder are registered in the available sector management table 532. At this time, the sector position 1 in the cylinder 1 is expressed as "position 1-1". I do.

【0039】以下、ソート処理における時系列的な各段
階を示す図6ないし図9を順次参照して本実施例の動作
を説明する。
The operation of this embodiment will now be described with reference to FIGS. 6 to 9 showing the time-series steps in the sorting process.

【0040】まず、図6を参照して、各ストリングの先
頭のブロックを読み込むまでの動作を説明する。
First, with reference to FIG. 6, the operation up to reading the first block of each string will be described.

【0041】図6を参照すると、作業ファイル入力手段
は、各ストリングの先頭のブロックac、adおよびa
bをストリング#1、#2および#3から順番に入力バ
ッファ5311、5312および5313に読み込み、
読み込んだブロックの位置1−1、1−4および2−1
をアベイラブルセクタ管理テーブル532に登録する。
Referring to FIG. 6, the work file input means includes the first blocks ac, ad and a of each string.
b is read into the input buffers 5311, 5312 and 5313 in order from the strings # 1, # 2 and # 3,
Positions 1-1, 1-4 and 2-1 of the read block
Is registered in the available sector management table 532.

【0042】次に、図7を参照して、図6のようにして
読み込まれたデータをマージして出力し、さらに各スト
リングから2番目のブロックを読み込むまでの動作を説
明する。
Next, with reference to FIG. 7, the operation from merging the data read as shown in FIG. 6, outputting the merged data, and reading the second block from each string will be described.

【0043】図7を参照すると、図6のようにして読み
込まれた6件のレコードは、マージされて2レコードず
つの3個のブロックAA、ABおよびCDに分けて出力
される。
Referring to FIG. 7, the six records read as shown in FIG. 6 are merged and output as three blocks AA, AB and CD of two records each.

【0044】1番目のブロックAAは、最新の入力位置
(現在のシリンダ位置)2−1に出力され、2番目のブ
ロックABは、同一シリンダ#2内にアベイラブルセク
タがないため、位置1−4に出力される。
The first block AA is output to the latest input position (current cylinder position) 2-1. The second block AB has no available sector in the same cylinder # 2. Is output to

【0045】2番目のブロックABを出力した時点で、
ストリング#3の入力バッファ5313が空になり、次
のブロックdfを位置2−2から読み込む。
When the second block AB is output,
The input buffer 5313 of the string # 3 becomes empty, and the next block df is read from the position 2-2.

【0046】さらに、3番目のブロックCDの最初のレ
コードCを出力バッファに移送した時点で、ストリング
#1の入力バッファ5311が空になり、次のブロック
deを位置1−2から読み込む。
Further, when the first record C of the third block CD is transferred to the output buffer, the input buffer 5311 of the string # 1 becomes empty, and the next block de is read from the position 1-2.

【0047】3番目のブロックCDは、最新の入力位置
(現在のシリンダ位置)1−2に出力され、その後、ス
トリング#2の入力バッファ5312が空になり、次の
ブロックdgを位置1−5から読み込む。
The third block CD is output to the latest input position (current cylinder position) 1-2. Thereafter, the input buffer 5312 of the string # 2 becomes empty, and the next block dg is moved to the position 1-5. Read from.

【0048】次に、図8を参照して、図7のようにして
読み込まれたデータをマージして出力し、さらに各スト
リングから3番目のブロックを読み込むまでの動作を説
明する。
Next, with reference to FIG. 8, the operation of merging and outputting the data read as shown in FIG. 7, and further reading the third block from each string will be described.

【0049】図8を参照すると、図7のようにして読み
込まれた6件のレコードは、マージされて2レコードず
つの3個のブロックDD、DEおよびFGに分けて出力
される。
Referring to FIG. 8, the six records read as shown in FIG. 7 are merged and divided into three blocks DD, DE, and FG each having two records and output.

【0050】1番目のブロックDDは、最新の入力位置
(現在のシリンダ位置)1−5に出力され、2番目のブ
ロックDEは、同一シリンダ#1内のアベイラブルセク
タ1−1に出力される。
The first block DD is output to the latest input position (current cylinder position) 1-5, and the second block DE is output to the available sector 1-1 in the same cylinder # 1.

【0051】2番目のブロックDEを出力した時点で、
ストリング#1の入力バッファ5311が空になり、次
のブロックhjを位置1−3から読み込む。
When the second block DE is output,
The input buffer 5311 of the string # 1 becomes empty, and the next block hj is read from the position 1-3.

【0052】さらに、3番目のブロックFGの最初のレ
コードFを出力バッファに移送した時点で、ストリング
#3の入力バッファ5313が空になり、次のブロック
hiを位置2−3から読み込む。
Further, when the first record F of the third block FG is transferred to the output buffer, the input buffer 5313 of the string # 3 becomes empty, and the next block hi is read from the position 2-3.

【0053】3番目のブロックFGは、最新の入力位置
(現在のシリンダ位置)2−3に出力され、その後、ス
トリング#2の入力バッファ5312が空になり、次の
ブロックhkを位置1−6から読み込む。
The third block FG is output to the latest input position (current cylinder position) 2-3, after which the input buffer 5312 of the string # 2 becomes empty, and the next block hk is moved to the position 1-6. Read from.

【0054】最後に、図9を参照して、マージが終了す
るまでの動作を説明する。
Finally, the operation until the merge is completed will be described with reference to FIG.

【0055】図9を参照すると、図8のようにして読み
込まれた6件のレコードは、マージされて2レコードず
つの3個のブロックHH、HIおよびJKに分けて出力
され、最後にストリング#3の4番目のブロックZZが
出力される。
Referring to FIG. 9, the six records read as shown in FIG. 8 are merged and output as three blocks HH, HI and JK of two records each. The third fourth block ZZ is output.

【0056】1番目のブロックHHは、最新の入力位置
(現在のシリンダ位置)1−6に出力され、2番目のブ
ロックHIは、同一シリンダ#1内のアベイラブルセク
タ1−3に出力される。
The first block HH is output to the latest input position (current cylinder position) 1-6, and the second block HI is output to available sectors 1-3 in the same cylinder # 1.

【0057】2番目のブロックHIを出力した時点で、
ストリング#3の入力バッファ5313が空になり、次
のブロックZZを位置2−4から読み込む。
When the second block HI is output,
The input buffer 5313 of the string # 3 becomes empty, and the next block ZZ is read from the position 2-4.

【0058】3番目のブロックJKは、最新の入力位置
(現在のシリンダ位置)2−4に出力され、最後のブロ
ックZZは、同一シリンダ#2内のアベイラブルセクタ
2−2に出力される。
The third block JK is output to the latest input position (current cylinder position) 2-4, and the last block ZZ is output to the available sector 2-2 in the same cylinder # 2.

【0059】図10および図11は、本実施例との比較
のために、本実施例で用いたデータと同一のデータにつ
いて前述した特開平5−165604号公報に記載され
た従来の方式によりソート処理を行った場合の動作を説
明するための図であり、図5ないし図9に示した構成と
同一のものについては同一の符号を付している。
FIGS. 10 and 11 show, for comparison with the present embodiment, the same data as those used in the present embodiment sorted by the conventional method described in the above-mentioned Japanese Patent Application Laid-Open No. 5-165604. FIG. 10 is a diagram for explaining an operation when a process is performed, and the same components as those shown in FIGS. 5 to 9 are denoted by the same reference numerals.

【0060】前述した特開平5−165604号公報に
記載された従来の方式では、アベイラブルセクタはスタ
ックの形式で登録されており、出力処理時には現在のシ
リンダ位置に関係なくアベイラブルセクタの中で最も新
しく入力処理が行われたセクタを選択する。
In the conventional method described in Japanese Patent Laid-Open No. Hei 5-165604, available sectors are registered in the form of a stack. Select the sector for which input processing has been performed.

【0061】なお、各ストリングの2番目のブロックを
読み込むまでの動作については図6および図7と全く同
じであるため、ここでの説明は省略する。
The operation up to reading the second block of each string is exactly the same as in FIGS. 6 and 7, and a description thereof will be omitted.

【0062】図10は、図7のようにして読み込まれた
データをマージして出力し、さらに各ストリングから3
番目のブロックを読み込むまでの動作を説明するための
図であり、図8に対応している。
FIG. 10 shows an example of merging the data read as shown in FIG. 7 and outputting the merged data.
FIG. 9 is a diagram for explaining an operation up to reading a second block, and corresponds to FIG.

【0063】図10を参照すると、図8と同様にブロッ
クDD、DEおよびFGの順に出力されるが、2番目の
ブロックDEが同一シリンダ1内のアベイラブルセクタ
1−1でなくアベイラブルセクタ内の最新の入力位置2
−2に出力される点で図8と相違する。
Referring to FIG. 10, blocks DD, DE, and FG are output in the same order as in FIG. 8, but the second block DE is not the available sector 1-1 in the same cylinder 1 but the latest one in the available sector. Input position 2
8 is different from FIG.

【0064】図11は、マージが終了するまでの動作を
説明するための図であり、図9に対応している。
FIG. 11 is a diagram for explaining an operation until the merge is completed, and corresponds to FIG.

【0065】図11を参照すると、図9と同様にブロッ
クHH、HI、JKおよびZZの順に出力されるが、最
終ブロックZZがアベイラブルセクタ管理テーブルに最
初に登録した位置1−1に出力される点で図9と相違す
る。
Referring to FIG. 11, blocks HH, HI, JK and ZZ are output in the same order as in FIG. 9, but the last block ZZ is output to position 1-1 first registered in the available sector management table. This is different from FIG.

【0066】このように、図10および図11に示した
従来の方式では、作業ファイルに対しての入出力処理時
のシリンダ位置の移動が10回必要であるのに対し、図
6ないし図9に示した本発明の方式では、シリンダ位置
の移動は7回で済み、磁気ディスク装置のヘッドの移動
が少なくて済むことが分かる。
As described above, in the conventional method shown in FIGS. 10 and 11, the cylinder position must be moved ten times at the time of input / output processing for the work file. According to the method of the present invention shown in FIG. 6, the cylinder position needs to be moved seven times, and the movement of the head of the magnetic disk drive can be reduced.

【0067】以上、本発明の実施の形態および実施例に
ついて説明してきたが、本発明はこのような実施の形態
および実施例に限定されるものではない。
While the embodiments and examples of the present invention have been described above, the present invention is not limited to such embodiments and examples.

【0068】例えば、シリンダ位置情報を取得する方法
については、前述したようなオペレーティングシステム
のシステム管理領域に記録されている最後に入出力が行
われたセクタ番号からシリンダ位置を算出する方法の
他、磁気ディスク装置のヘッドの状態を検出して数値と
してセクタ番号やシリンダ位置を取得する方法も採用す
ることができる。
For example, the method of obtaining the cylinder position information includes a method of calculating the cylinder position from the last sector number of the input / output operation recorded in the system management area of the operating system as described above. A method of detecting the state of the head of the magnetic disk device and acquiring the sector number and the cylinder position as numerical values can also be adopted.

【0069】なお、このような方法によれば、ファーム
ウェアによるヘッドの移動等のようにシステムが関知す
ることができないヘッドの移動があっても正確にヘッド
のシリンダ位置を決定することができる。また、セクタ
番号からシリンダ番号を計算するのではなく、直接シリ
ンダ番号を取得することにより、シリンダ番号を計算す
る処理を省略することができ、処理の高速化を実現する
ことができる。
According to such a method, the cylinder position of the head can be accurately determined even if there is a head movement that cannot be recognized by the system, such as a head movement by firmware. Further, by directly obtaining the cylinder number instead of calculating the cylinder number from the sector number, the processing of calculating the cylinder number can be omitted, and the processing can be speeded up.

【0070】[0070]

【発明の効果】以上説明したように、本発明によれば、
主記憶装置に入り切らないような大量のデータを作業フ
ァイルを用いてソートするソート処理方式において、出
力位置としてヘッドの現在のシリンダ位置に最も近いシ
リンダ位置にあるアベイラブルセクタがアベイラブルセ
クタ選択手段により常に選択されるようにするため、コ
レーションフェーズにおける作業ファイルに対しての入
出力処理時に磁気ディスク装置のヘッドの移動が最小限
に抑えられ、ソートの所要時間を減少させることができ
る。
As described above, according to the present invention,
In a sort processing method for sorting a large amount of data that cannot fit in the main storage device using a work file, an available sector at a cylinder position closest to the current cylinder position of the head as an output position is always determined by an available sector selection unit. Since the selection is made, the movement of the head of the magnetic disk device during the input / output processing for the work file in the collation phase is minimized, and the time required for sorting can be reduced.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の実施の形態の構成を示すブロック図で
ある。
FIG. 1 is a block diagram showing a configuration of an embodiment of the present invention.

【図2】本発明の実施の形態におけるアベイラブルセク
タ管理テーブルの構成を示す図である。
FIG. 2 is a diagram showing a configuration of an available sector management table according to the embodiment of the present invention.

【図3】本発明の実施の形態におけるソート処理を説明
するためのフローチャートである。
FIG. 3 is a flowchart illustrating a sorting process according to the embodiment of the present invention.

【図4】本発明の実施の形態におけるシリンダ位置取得
処理を説明するためのフローチャートである。
FIG. 4 is a flowchart illustrating a cylinder position obtaining process according to the embodiment of the present invention.

【図5】本発明の一実施例を説明するためのブロック図
である。
FIG. 5 is a block diagram for explaining one embodiment of the present invention.

【図6】本発明の一実施例におけるソート処理を説明す
るための図である(第1段階)。
FIG. 6 is a diagram for explaining a sorting process in one embodiment of the present invention (first stage).

【図7】本発明の一実施例におけるソート処理を説明す
るための図である(第2段階)。
FIG. 7 is a diagram illustrating a sorting process according to an embodiment of the present invention (second stage).

【図8】本発明の一実施例におけるソート処理を説明す
るための図である(第3段階)。
FIG. 8 is a diagram illustrating a sorting process according to an embodiment of the present invention (third stage).

【図9】本発明の一実施例におけるソート処理を説明す
るための図である(第4段階)。
FIG. 9 is a diagram for explaining a sorting process in one embodiment of the present invention (fourth stage).

【図10】本発明の一実施例で用いたデータと同一のデ
ータについて従来の方式によりソート処理を行った場合
の動作を説明するための図である(第3段階)。
FIG. 10 is a diagram for explaining an operation when the same data as that used in one embodiment of the present invention is sorted by a conventional method (third stage).

【図11】本発明の一実施例で用いたデータと同一のデ
ータについて従来の方式によりソート処理を行った場合
の動作を説明するための図である(第4段階)。
FIG. 11 is a diagram for explaining an operation when the same data as that used in one embodiment of the present invention is sorted by a conventional method (fourth stage).

【符号の説明】[Explanation of symbols]

1 ソート処理手段 11 アベイラブルセクタ選択手段 12 作業ファイル出力手段 13 作業ファイル入力手段 14 シリンダ位置取得手段 2 主記憶装置 21 アベイラブルセクタ管理テーブル 211 ファイル記述子 212 ファイル内オフセットアドレス 213 磁気ディスク装置内シリンダ位置 3 磁気ディスク装置 31 作業ファイル 32 作業ファイル上の領域 51 磁気ディスク装置 511、512 磁気ディスク装置内のシリンダ位置 52 磁気ディスク装置上の作業ファイル領域 521、522、523 作業ファイル内のストリング 5211、5212、5213 ストリング#1を構成
するブロック 5221、5222、5223 ストリング#2を構成
するブロック 5231、5232、5233、5234 ストリング
#3を構成するブロック 53 主記憶装置 531 ソートメモリ 5311、5212、5313 入力バッファ 5314 出力バッファ 532 アベイラブルセクタ管理テーブル 54 ソート処理手段
REFERENCE SIGNS LIST 1 sort processing means 11 available sector selection means 12 work file output means 13 work file input means 14 cylinder position acquisition means 2 main storage device 21 available sector management table 211 file descriptor 212 offset address in file 213 cylinder position in magnetic disk drive 3 Magnetic Disk Unit 31 Work File 32 Area on Work File 51 Magnetic Disk Unit 511, 512 Cylinder Position in Magnetic Disk Unit 52 Work File Area on Magnetic Disk Unit 521, 522, 523 Strings in Work File 5211, 5212, 5213 Blocks 5221, 5222, 5223 constituting string # 1 Blocks 5231, 5232, 5233, 5234 constituting string # 2 String # 3 Sorting Block 53 main storage device 531 for forming memory 5311,5212,5313 input buffer 5314 outputs the buffer 532 Abbaye Reconfigurable sector management table 54 sorting means

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.6,DB名) G06F 12/00 ──────────────────────────────────────────────────続 き Continuation of front page (58) Field surveyed (Int.Cl. 6 , DB name) G06F 12/00

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】主記憶装置に入り切らないような大量のデ
ータを作業ファイルを用いてソートするソート処理方式
において、 ソート処理の中間結果を一時的に保存するための作業フ
ァイルと、 ソート処理の中間結果であるソート済みレコード列を主
記憶装置から前記作業ファイル上に出力する作業ファイ
ル出力手段と、 前記作業ファイル上に出力されたソート済みレコード列
をマージするためにソート済みレコード列を再度主記憶
装置に読み込むための作業ファイル入力手段と、 前記作業ファイル上に出力されたソート済みレコード列
が主記憶装置に入力されたことで再利用可能になった前
記作業ファイル上の領域を管理するテーブルであって、
前記作業ファイル入力手段により前記ソート済みレコー
ド列を主記憶装置に読み込む度に該読み込まれた領域の
位置を登録するアベイラブルセクタ管理テーブルと、 前記作業ファイル上に出力されたソート済みレコード列
をマージしてマージ結果を再度前記作業ファイルに出力
する際に、前記作業ファイル出力手段により呼び出さ
れ、次に出力すべき前記作業ファイル上の領域を前記ア
ベイラブルセクタ管理テーブルから選択して前記作業フ
ァイル出力手段に通知するアベイラブルセクタ選択手段
と、 磁気ディスク装置のヘッドの現在のシリンダ位置を取得
するためのシリンダ位置取得手段と、 を備え、 前記作業ファイル入力手段は、前記作業ファイルから
ート済みレコード列を主記憶装置に読み込む度に、入出
力を行うために必要な位置情報とともに、入力処理が行
われた後に前記シリンダ位置取得手段により取得した磁
気ディスク装置のヘッドのシリンダ位置を前記アベイラ
ブルセクタ管理テーブルに登録し、 前記アベイラブルセクタ選択手段は、次に出力すべき前
記作業ファイル上の領域を選択する際に、前記シリンダ
位置取得手段により磁気ディスク装置のヘッドの現在の
シリンダ位置を取得し、該取得された現在のシリンダ位
置と、前記アベイラブルセクタ管理テーブルに登録され
ている各領域のシリンダ位置と、を比較し、最も近いシ
リンダ位置にある領域を選択することを特徴とするソー
ト作業ファイルスペース管理方式。
In a sort processing method for sorting a large amount of data that cannot be stored in a main storage device using a work file, a work file for temporarily storing intermediate results of the sort processing, A work file output means for outputting a sorted record sequence as an intermediate result from the main storage device to the work file; and a main file unit for sorting the sorted record sequence again for merging the sorted record sequences output on the work file. A work file input means for reading into the storage device, and a table for managing an area on the work file which can be reused by inputting the sorted record sequence output on the work file to the main storage device And
Each time the sorted record sequence is read into the main storage device by the work file input means, an available sector management table for registering the position of the read area is merged with the sorted record sequence output on the work file. When the merged result is output to the work file again, it is called by the work file output means, selects an area on the work file to be output next from the available sector management table, and outputs the selected area to the work file output means. comprising a Abbaye Reconfigurable sector selection means for notifying, the cylinder position acquiring means for acquiring the current cylinder position of the head of the magnetic disk device, wherein the working file input means, source <br/> over preparative from the working file Required to perform I / O every time a read record sequence is read into main storage Along with the position information, the cylinder position of the head of the magnetic disk drive acquired by the cylinder position acquisition means after the input processing is performed is registered in the available sector management table, and the available sector selection means outputs When selecting an area on the work file, the current cylinder position of the head of the magnetic disk drive is acquired by the cylinder position acquisition means, and the acquired current cylinder position is registered in the available sector management table. A sort work file space management method, which compares the cylinder position of each area with the selected area and selects the area at the closest cylinder position.
【請求項2】主記憶装置に入り切らないような大量のデ
ータを作業ファイルを用いてソートするソート処理方式
において、前記作業ファイル上に出力されたソート済みレコード列
が主記憶装置に入力されたことで再利用可能になった作
業ファイル上の領域を記憶管理するためのアベイラブル
セクタ管理テーブルと 、 ソート処理の中間結果であるソート済みレコード列を前
記作業ファイルから主記憶装置に読み込む度に、入出力
を行うために必要な位置情報とともに、入力処理が行わ
れた領域についての磁気ディスク装置のヘッドのシリン
ダ位置を前記アベイラブルセクタ管理テーブルに登録
る手段と、 前記主記憶装置に読み込まれたソート済みレコード列を
マージしてマージ結果を再度前記作業ファイルに出力す
る際に、前記磁気ディスク装置のヘッドの現在のシリン
ダ位置と、前記アベイラブルセクタ管理テーブルに登録
されている各領域のシリンダ位置と、を比較し、最も近
いシリンダ位置にある領域を選択する手段と、を備えた
ことを特徴とするソート作業ファイルスペース管理方
式。
2. A sorted record sequence output on a work file in a sort processing method using a work file to sort a large amount of data that cannot be stored in a main storage device .
Work that can be reused because the
Available for storage management of the area on the business file
Every time a sorted record sequence, which is an intermediate result of the sorting process, is read from the work file into the main storage device, the sector management table and the position information necessary for performing input / output and the information on the area where the input process was performed are performed. Register the cylinder position of the head of the magnetic disk drive in the available sector management table .
Means for merging sorted record strings read into the main storage device and outputting the merged result to the work file again, the current cylinder position of the head of the magnetic disk device, and the available sector management. Means for comparing the cylinder position of each area registered in the table and selecting the area located at the closest cylinder position.
JP8130751A 1996-04-26 1996-04-26 Sort work file space management method Expired - Lifetime JP2943693B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8130751A JP2943693B2 (en) 1996-04-26 1996-04-26 Sort work file space management method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8130751A JP2943693B2 (en) 1996-04-26 1996-04-26 Sort work file space management method

Publications (2)

Publication Number Publication Date
JPH09293008A JPH09293008A (en) 1997-11-11
JP2943693B2 true JP2943693B2 (en) 1999-08-30

Family

ID=15041778

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8130751A Expired - Lifetime JP2943693B2 (en) 1996-04-26 1996-04-26 Sort work file space management method

Country Status (1)

Country Link
JP (1) JP2943693B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140281194A1 (en) 2013-03-15 2014-09-18 Seagate Technology Llc Dynamically-sizeable granule storage
US9588886B2 (en) 2013-03-15 2017-03-07 Seagate Technology Llc Staging sorted data in intermediate storage

Also Published As

Publication number Publication date
JPH09293008A (en) 1997-11-11

Similar Documents

Publication Publication Date Title
US6954759B2 (en) Data processing method using record division storing scheme and apparatus therefor
US8001134B2 (en) Method for performing an external (disk-based) sort of a large data file which takes advantage of “presorted” data already present in the input
JPH08129551A (en) Hash system
JP2943693B2 (en) Sort work file space management method
JP2770798B2 (en) Product code search method
JP2901543B2 (en) Magnetic disk file relocation method
JPS63301358A (en) Input/output system for electronic filing system
JPS60142416A (en) Storing and retrieving device of picture information
JPH05324734A (en) Electronic filing device
JPH02178880A (en) Electronic file device
JPH05257610A (en) Device and method for reading file
JPH0291725A (en) Merging processing system
JPH05313963A (en) Deciding system for storing block to data file
JPH05204735A (en) Data management system
JPH01270127A (en) Data retrieval processing system
JPH06149635A (en) Method for additional processing of record
JPH0546666A (en) Information retrieving device
JPH0495164A (en) Document managing system for electronic filing device
JPH05298369A (en) Method and device for retrieving data
JPH01147720A (en) Classification processing system
JPH04116737A (en) Electronic filing device
JPH0668146A (en) Management method for document whose retrieval information is not added in electronic file device
JPH04359372A (en) Retrieving method for electronic filing device
JPH0498516A (en) Disk accessing system
JPS63253431A (en) Retrieving system for data base of inverted structure

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19990525

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080625

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090625

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100625

Year of fee payment: 11