JPH09293008A - System for controlling sort work file space - Google Patents

System for controlling sort work file space

Info

Publication number
JPH09293008A
JPH09293008A JP8130751A JP13075196A JPH09293008A JP H09293008 A JPH09293008 A JP H09293008A JP 8130751 A JP8130751 A JP 8130751A JP 13075196 A JP13075196 A JP 13075196A JP H09293008 A JPH09293008 A JP H09293008A
Authority
JP
Japan
Prior art keywords
work file
output
cylinder position
input
magnetic disk
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.)
Granted
Application number
JP8130751A
Other languages
Japanese (ja)
Other versions
JP2943693B2 (en
Inventor
Eiji Kitamura
英司 北村
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
NEC Corp
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 NEC Corp filed Critical NEC Corp
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

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PROBLEM TO BE SOLVED: To improve performance by permitting the movement distance of a head in a magnetic disk device to be min. at the time of sorting a large quantity of data through the use of a work file. SOLUTION: In a sort work file space controlling method, the cylindar position of an available sector in the work file 31 which can be re-used is obtained by a cylindar position obtaining means 14 whenever a sorted record string is read from the work file 31 to a main storage device 2 in the latter half (collation phase) of a sort processing and the cylindar position of the obtained available sector is registered in an available sector control table 21 together with position information required for executing an input/output. When the sorted record string read in the main storage device 2 is merged and outputted to the work file 31, the present cylindar position of the head in the magnetic disk device 3 is compared with the cylindar positions of the respective areas which are registered in the available sector control table 21 so as to select the available sector being in the nearest cylindar position.

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 that does not fit in a main storage device using a work file, and particularly to sort work file space management for performing high speed sort processing. Regarding the scheme.

【0002】[0002]

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

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

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

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

【0006】[0006]

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

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

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

【0009】[0009]

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

【0010】前述した構成のもとで、本発明によれば、
アベイラブルセクタ選択手段が磁気ディスク装置のヘッ
ドの移動距離が最小となるアベイラブルセクタを出力先
として選択するため、連続してアベイラブルセクタに出
力する場合や、他のプロセスによって磁気ディスク装置
のヘッドが移動してしまっている場合でも、磁気ディス
ク装置のヘッドの移動に要する時間を最小にすることが
できる。
Based on the above-mentioned structure, according to the present invention,
Since the available sector selection means selects the available sector having the smallest moving distance of the head of the magnetic disk device as the output destination, the head of the magnetic disk device is moved by continuously outputting to the available sector or by another process. Even when the head is out of the way, the time required to move the head of the magnetic disk device 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 comprises a sort processing means 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 has an available sector selection means 11, a work file output means 12, a work file input means 13, a cylinder position acquisition means 14, and
have. Further, 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からの入力処理を行
う。
In the collation phase of the sort processing, the sort processing means 1 performs the output processing to the work file 31 on the magnetic disk device 3 by the work file output means 12, and the work file input means 13 on the magnetic disk device 3. The input processing from the work file 31 is performed.

【0015】図2は、図1に示したアベイラブルセクタ
管理テーブル21の構成を示す図である。
FIG. 2 is a diagram showing the structure 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 position information necessary to access a specific area in a file on the magnetic disk device 3, and an offset address in the file. 212 and 212 as a component, the physical cylinder position 213 in the magnetic disk device 3 is included as a component.

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

【0018】なお、アベイラブルセクタの選択方法とし
ては、例えば以下のような手順に従う方法がある。すな
わち、まず作業ファイル31からの入力処理時に、その
際に発行された磁気ディスク装置3への入力要求でのシ
リンダ位置をアベイラブルセクタ管理テーブル21に格
納しておく。そして、作業ファイル31への出力処理の
要求時に、最初に磁気ディスク装置3のヘッドの現在の
シリンダ位置を取得し、アベイラブルセクタ管理テーブ
ル21内の1番目と2番目のエントリのそれぞれのアベ
イラブルセクタのシリンダ位置と、ヘッドの現在のシリ
ンダ位置と、の差を比較して、その差がより小さいもの
を選ぶ。その後、選ばれたエントリのシリンダ位置と、
アベイラブルセクタ管理テーブル21内の3番目のエン
トリのアベイラブルセクタのシリンダ位置、4番目のエ
ントリのアベイラブルセクタのシリンダ位置、…との比
較を順に繰り返し、差がより小さいエントリを選んでゆ
き、最終的に磁気ディスク装置3のヘッドのシリンダ位
置と、アベイラブルセクタのシリンダ位置と、の差が最
も小さくなるエントリのアベイラブルセクタを選択す
る。なお、検索中にシリンダ位置の差が“0”となるエ
ントリを発見した場合、すなわち同一シリンダにあるア
ベイラブルセクタを発見した場合には、その時点で検索
を中止し、そのエントリのアベイラブルセクタを選択す
る。
As a method of selecting an available sector, there is a method that follows the following procedure, for example. 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. Then, when the output process to the work file 31 is requested, the current cylinder position of the head of the magnetic disk device 3 is first obtained, and the available sector of each of the first and second entries in the available sector management table 21 is acquired. 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. After that, 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 to select an entry having a smaller difference, and finally. The available sector of the entry having the smallest difference between the cylinder position of the head of the magnetic disk device 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 point and the available sector of that entry is selected. To do.

【0019】図3は、本発明の実施の形態におけるソー
ト処理を説明するためのフローチャートである。
FIG. 3 is a flow chart for explaining the sorting process 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 process, the presort process (step 310), and the sort end process 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
The processing of 23, 325 and 326 is executed by the work file input means 13, and steps 333, 334 and 33 are executed.
The processes 7 and 338 are executed by the work file output means 12, the process of step 336 is executed by the available sector selection means 11, and the processes of steps 324 and 335 are executed by the cylinder position acquisition means 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 process (step 310) is completed and the collation process (step 3) is performed.
After the start of step 20), when a record input request is made (step 321), a 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 into the work file buffer (step 323), and the cylinder position acquisition means 14 acquires the cylinder position of the area 32 on the work file in which this one block was input (step 323). 324), the available sector management table 21 using the acquired cylinder position, file descriptor, and offset address in the file as available sector position information.
(Step 325), the record is retrieved 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 the work file buffer on the main memory (step 338). ). However, if the work file buffer is full when trying 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 means 12 requests an available sector to the available sector selection means 11 (step 334), and the available sector selection means 11 causes the cylinder position acquisition means 14 to acquire the current cylinder position of the head of the magnetic disk device 3. (Step 335), referring to the cylinder position registered in the available sector management table 21, the available sector is selected so that the cylinder position is the closest and the head movement distance of the magnetic disk device 3 is minimized (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 record output processing are repeated until the merging of all the records is completed (step 341). It should be noted that the record input process and the record output process are not performed alternately, and particularly in the final merge stage of the collation process (step 320) (step 331), there is no output process to the work file and only the input process. Is repeated, and the available sector is not registered in the input processing during this period.

【0025】図4は、本発明の実施の形態におけるシリ
ンダ位置取得処理を説明するためのフローチャートであ
る。図1に示したシリンダ位置取得手段14によりシリ
ンダ位置情報を取得するための具体的な方法は、オペレ
ーティングシステム等に依存するため特定はできない
が、その一方法について図4を参照して説明する。
FIG. 4 is a flow chart for explaining the cylinder position acquisition processing in the embodiment of the present invention. A specific method for acquiring the cylinder position information by the cylinder position acquisition means 14 shown in FIG. 1 cannot be specified because it depends on the operating system or the like, but 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 (input / output unit area of the magnetic disk device, which is determined independently of the data file management method) of the last input / output sector is the operating system. It shall be recorded in the system management area of. Under such a premise, the cylinder position acquisition unit 14 first acquires the sector number m at which the last input / output was performed (step 401), and also acquires the sector number n per cylinder of the magnetic disk device 3. (Step 402), m / n
The cylinder position of the head is calculated according to the expression (rounding down after the decimal point) (step 403).

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

【0028】[0028]

【実施例】次に、前述した本発明の実施の形態をより具
体的に説明するために、本発明の実施の形態を適用して
実際にソート処理を行う場合の一実施例について図面を
参照して詳細に説明する。なお、本実施例においては、
ソート処理の後半のコレーションフェーズにおける1回
分のマージについて説明する。
EXAMPLES Next, in order to more specifically describe the above-described embodiment of the present invention, an example of applying the embodiment of the present invention to actually perform a sorting process will be described with reference to the drawings. And will be described in detail. In this embodiment,
One merge in the collation phase in the latter half of the sorting 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 is composed of 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 structure as the sort processing means 1 shown in FIG. 1, its explanation 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 each consist of three blocks, and are output to the cylinder (# 1) 511 of the magnetic disk device 51. The string (# 3) 523 consists of 4 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 the present embodiment, each block has a size of one sector, and 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 the string (# 2) 522 and the string (# 3) 5
The same applies to 23.

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

【0035】主記憶装置53は、ソートメモリ531
と、アベイラブルセクタ管理テーブル532と、を有し
ている。なお、ソートメモリ531は、ストリング数
分、すなわち3個の入力バッファ5311、5312お
よび5313と、出力バッファ5314と、を有し、各
ストリングから1ブロックずつ入力バッファへ読み込ん
でいく。
The main storage device 53 is a sort memory 531.
And an available sector management table 532. The sort memory 531 has the same 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つの入力バッファ内の全レコードを出力バ
ッファに転送して入力バッファが空になった時点で次の
ブロックを読み込む。
In the merge process, the record in the input buffer is targeted, and when the output record is determined, it is buffered in the output buffer 5314 and output. Further, all records in one input buffer are transferred to the output buffer, and when the input buffer becomes empty, the next block is read.

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

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

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

【0040】まず、図6を参照して、各ストリングの先
頭のブロックを読み込むまでの動作を説明する。
First, with reference to FIG. 6, the operation until the leading block of each string is read 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 uses the head 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, the operation of merging the data read as shown in FIG. 6 and outputting the data and reading the second block from each string will be described with reference to FIG.

【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 divided into three blocks AA, AB and CD of two records each and output.

【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 and the second block AB has no available sectors in the same cylinder # 2. Is output to.

【0045】2番目のブロックABを出力した時点で、
ストリング#3の入力バッファ5313が空になり、次
のブロックdfを位置2−2から読み込む。
At the time 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, after which the input buffer 5312 of string # 2 becomes empty, and the next block dg is moved to positions 1-5. Read from.

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

【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 of two records DD, DE and FG 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 string # 1 becomes empty and the next block hj is read from positions 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 positions 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 is emptied, and the next block hk is moved to positions 1-6. Read from.

【0054】最後に、図9を参照して、マージが終了す
るまでの動作を説明する。
Finally, the operation up to the end of the merge 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 in as shown in FIG. 8 are merged and divided into three blocks HH, HI, and JK of two records each, which are output at the end. The fourth block ZZ of 3 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 the available sectors 1-3 in the same cylinder # 1.

【0057】2番目のブロックHIを出力した時点で、
ストリング#3の入力バッファ5313が空になり、次
のブロックZZを位置2−4から読み込む。
At the time when the second block HI is output,
The input buffer 5313 of string # 3 becomes empty and the next block ZZ is read from 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に示した構成と
同一のものについては同一の符号を付している。
For comparison with this embodiment, FIGS. 10 and 11 sort the same data as the data used in this embodiment by the conventional method described in the above-mentioned JP-A-5-165604. FIG. 10 is a diagram for explaining an operation when processing 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 the above-mentioned Japanese Patent Laid-Open No. 5-165604, the available sectors are registered in the form of a stack, and at the time of output processing, the newest available sector is available regardless of the current cylinder position. 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 that shown in FIGS. 6 and 7, and the description thereof is omitted here.

【0062】図10は、図7のようにして読み込まれた
データをマージして出力し、さらに各ストリングから3
番目のブロックを読み込むまでの動作を説明するための
図であり、図8に対応している。
FIG. 10 merges the data read as shown in FIG. 7 and outputs the merged data.
It is a figure for demonstrating operation | movement until the 2nd block is read, and corresponds to FIG.

【0063】図10を参照すると、図8と同様にブロッ
クDD、DEおよびFGの順に出力されるが、2番目の
ブロックDEが同一シリンダ1内のアベイラブルセクタ
1−1でなくアベイラブルセクタ内の最新の入力位置2
−2に出力される点で図8と相違する。
Referring to FIG. 10, the 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 in the available sector. Input position 2
2 is different from FIG.

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

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

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

【0067】以上、本発明の実施の形態および実施例に
ついて説明してきたが、本発明はこのような実施の形態
および実施例に限定されるものではない。
Although 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, as for the method of obtaining the cylinder position information, in addition to the method of calculating the cylinder position from the sector number of the last input / output 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 or cylinder position as a numerical value can also be adopted.

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

【0070】[0070]

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

【図面の簡単な説明】[Brief description of 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 for explaining sort processing according to the embodiment of the present invention.

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

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

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

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

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

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

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

【図11】本発明の一実施例で用いたデータと同一のデ
ータについて従来の方式によりソート処理を行った場合
の動作を説明するための図である(第4段階)。
FIG. 11 is a diagram for explaining the operation in the case where the same data as that used in the embodiment of the present invention is subjected to the sort processing by the 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 ソート処理手段
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 memory 21 available sector management table 211 file descriptor 212 file offset address 213 magnetic disk device cylinder position 3 Magnetic disk device 31 Work file 32 Area on work file 51 Magnetic disk device 511, 512 Cylinder position in magnetic disk device 52 Work file area 521, 522, 523 String in work file 5211, 5212, 5213 Blocks 5221, 5222, 5223 forming string # 1 Blocks 5231, 5232, 5233, 5234 forming 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

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】主記憶装置に入り切らないような大量のデ
ータを作業ファイルを用いてソートするソート処理方式
において、 ソート処理の中間結果を一時的に保存するための作業フ
ァイルと、 ソート処理の中間結果であるソート済みレコード列を主
記憶装置から前記作業ファイル上に出力する作業ファイ
ル出力手段と、 前記作業ファイル上に出力されたソート済みレコード列
をマージするためにソート済みレコード列を再度主記憶
装置に読み込むための作業ファイル入力手段と、 前記作業ファイル上に出力されたソート済みレコード列
が主記憶装置に入力されたことで再利用可能になった前
記作業ファイル上の領域を管理するテーブルであって、
前記作業ファイル入力手段により前記ソート済みレコー
ド列を主記憶装置に読み込む度に該読み込まれた領域の
位置を登録するアベイラブルセクタ管理テーブルと、 前記作業ファイル上に出力されたソート済みレコード列
をマージしてマージ結果を再度前記作業ファイルに出力
する際に、前記作業ファイル出力手段により呼び出さ
れ、次に出力すべき前記作業ファイル上の領域を前記ア
ベイラブルセクタ管理テーブルから選択して前記作業フ
ァイル出力手段に通知するアベイラブルセクタ選択手段
と、 磁気ディスク装置のヘッドの現在のシリンダ位置を取得
するためのシリンダ位置取得手段と、 を備え、 前記作業ファイル入力手段は、前記ソート済みレコード
列を主記憶装置に読み込む度に、入出力を行うために必
要な位置情報とともに、入力処理が行われた後に前記シ
リンダ位置取得手段により取得した磁気ディスク装置の
ヘッドのシリンダ位置を前記アベイラブルセクタ管理テ
ーブルに登録し、 前記アベイラブルセクタ選択手段は、次に出力すべき前
記作業ファイル上の領域を選択する際に、前記シリンダ
位置取得手段により磁気ディスク装置のヘッドの現在の
シリンダ位置を取得し、該取得された現在のシリンダ位
置と、前記アベイラブルセクタ管理テーブルに登録され
ている各領域のシリンダ位置と、を比較し、最も近いシ
リンダ位置にある領域を選択することを特徴とするソー
ト作業ファイルスペース管理方式。
1. A sort processing method for sorting a large amount of data that does not fit into a main storage device using a work file, wherein a work file for temporarily storing an intermediate result of the sort processing and a sort processing A work file output means for outputting a sorted record string as an intermediate result from the main storage device to the work file, and a sorted record string to be re-maintained in order to merge the sorted record string output to the work file. Work file input means for reading into a storage device, and a table for managing an area on the work file that can be reused by inputting the sorted record sequence output on the work file into the main storage device And
An available sector management table for registering the position of the read area each time the work file input means reads the sorted record string into the main storage device, and the sorted record string output on the work file are merged. When the merge result is output to the work file again, the area on the work file to be output next is called by the work file output means and is selected from the available sector management table to the work file output means. An available sector selection means for notifying and a cylinder position acquisition means for acquiring the current cylinder position of the head of the magnetic disk device are provided, and the work file input means reads the sorted record string into the main storage device. Every time, along with the position information necessary for input and output, After the input processing is performed, the cylinder position of the head of the magnetic disk device obtained by the cylinder position obtaining means is registered in the available sector management table, and the available sector selecting means is to output the work file on the work file to be output next. When selecting an area, the current cylinder position of the head of the magnetic disk device is acquired by the cylinder position acquisition means, and the acquired current cylinder position and each area registered in the available sector management table are acquired. A sort work file space management method characterized by comparing the cylinder position and the area at the closest cylinder position.
【請求項2】前記シリンダ位置取得手段が、最後に入出
力処理が行われたセクタ番号からシリンダ位置を算出す
ることを特徴とする請求項1記載のソート作業ファイル
スペース管理方式。
2. The sort work file space management system according to claim 1, wherein the cylinder position acquisition means calculates the cylinder position from the sector number of the last input / output process.
【請求項3】前記シリンダ位置取得手段が、磁気ディス
ク装置のヘッドの状態を検出してシリンダ位置を取得す
ることを特徴とする請求項1記載のソート作業ファイル
スペース管理方式。
3. The sort work file space management method according to claim 1, wherein said cylinder position acquisition means acquires the cylinder position by detecting the state of the head of the magnetic disk device.
【請求項4】主記憶装置に入り切らないような大量のデ
ータを作業ファイルを用いてソートするソート処理方式
において、 ソート処理の中間結果であるソート済みレコード列を前
記作業ファイルから主記憶装置に読み込む度に、入出力
を行うために必要な位置情報とともに、入力処理が行わ
れた領域についての磁気ディスク装置のヘッドのシリン
ダ位置を登録しておき、 前記主記憶装置に読み込まれたソート済みレコード列を
マージしてマージ結果を再度前記作業ファイルに出力す
る際に、前記磁気ディスク装置のヘッドの現在のシリン
ダ位置と、前記登録されている各領域のシリンダ位置
と、を比較し、最も近いシリンダ位置にある領域を選択
するようにしたことを特徴とするソート作業ファイルス
ペース管理方式。
4. A sort processing method for sorting a large amount of data that does not fit in a main storage device using a work file, wherein a sorted record string which is an intermediate result of the sort process is transferred from the work file to the main storage device. Each time it is read, the cylinder position of the head of the magnetic disk device for the area where the input process is performed is registered together with the position information necessary for input / output, and the sorted records read in the main storage device. When the columns are merged and the merged result is output again to the work file, the current cylinder position of the head of the magnetic disk device is compared with the cylinder position of each registered area, and the closest cylinder is compared. A sort work file space management method characterized by selecting an area at a 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 true JPH09293008A (en) 1997-11-11
JP2943693B2 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)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014182835A (en) * 2013-03-15 2014-09-29 Seagate Technology Llc Data storage system, data storage method, and processor readable storage medium
US9384793B2 (en) 2013-03-15 2016-07-05 Seagate Technology Llc Dynamic granule-based intermediate storage

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014182835A (en) * 2013-03-15 2014-09-29 Seagate Technology Llc Data storage system, data storage method, and processor readable storage medium
US9384793B2 (en) 2013-03-15 2016-07-05 Seagate Technology Llc Dynamic granule-based intermediate storage
US9588887B2 (en) 2013-03-15 2017-03-07 Seagate Technology Llc Staging sorted data in intermediate storage
US9588886B2 (en) 2013-03-15 2017-03-07 Seagate Technology Llc Staging sorted data in intermediate storage
US9740406B2 (en) 2013-03-15 2017-08-22 Seagate Technology Llc Dynamic granule-based intermediate storage

Also Published As

Publication number Publication date
JP2943693B2 (en) 1999-08-30

Similar Documents

Publication Publication Date Title
JPH08129551A (en) Hash system
JP3515810B2 (en) Sort processing method and apparatus
JPH09293008A (en) System for controlling sort work file space
JP4540556B2 (en) Data access method and program thereof
JPH05257610A (en) Device and method for reading file
JP3929269B2 (en) Data processing method and apparatus
JP3398672B2 (en) Intermediate data storage device
JPH0291725A (en) Merging processing system
JPS63301358A (en) Input/output system for electronic filing system
JPH09330322A (en) Data retrieval device
JPH103412A (en) Magnetic disk file relocation system
JPH05313963A (en) Deciding system for storing block to data file
JPS63253431A (en) Retrieving system for data base of inverted structure
JPH03265949A (en) Buffer control system
JPS6319052A (en) High speed label accessing system
JPH05298369A (en) Method and device for retrieving data
JPH06348688A (en) Kana (japanese syllabary)/kanji (chinese character) conversion system
JPH05204735A (en) Data management system
JPH03244068A (en) Simulation system
JPS60142416A (en) Storing and retrieving device of picture information
JPH01147720A (en) Classification processing system
JPH06149635A (en) Method for additional processing of record
JPH07282073A (en) Data retrieving device and its method
JPH0495164A (en) Document managing system for electronic filing device
JPH06119221A (en) Electronic filing device

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