JPH0467660B2 - - Google Patents

Info

Publication number
JPH0467660B2
JPH0467660B2 JP60139978A JP13997885A JPH0467660B2 JP H0467660 B2 JPH0467660 B2 JP H0467660B2 JP 60139978 A JP60139978 A JP 60139978A JP 13997885 A JP13997885 A JP 13997885A JP H0467660 B2 JPH0467660 B2 JP H0467660B2
Authority
JP
Japan
Prior art keywords
file
record
chain
records
field
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
JP60139978A
Other languages
Japanese (ja)
Other versions
JPS621029A (en
Inventor
Koichi Nakajima
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 JP60139978A priority Critical patent/JPS621029A/en
Publication of JPS621029A publication Critical patent/JPS621029A/en
Publication of JPH0467660B2 publication Critical patent/JPH0467660B2/ja
Granted legal-status Critical Current

Links

Landscapes

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

Description

【発明の詳細な説明】 技術分野 本発明はチエイン探索方法に関し、特に電子計
算機システムにおいて補助記憶装置に格納された
チエイン構造をもつフアイル内のレコード順序性
を認識するためのチエイン探索方式に関する。
TECHNICAL FIELD The present invention relates to a chain search method, and more particularly to a chain search method for recognizing the order of records in a file having a chain structure stored in an auxiliary storage device in an electronic computer system.

従来技術 磁気デイスクなど補助記憶装置に記録されるレ
コードの順序性を表現する方式として、始点レコ
ードから論理的に番目のレコード内に+1番
目のレコードアドレスをポインタとして記録する
方式がある。以下、この記録方式によつて記録さ
れたレコードの格納されている補助記憶装置内の
領域をチエインフアイル、1つの始点レコードか
らポインタによつて連結されているレコードの集
まりをチエインと夫々呼ぶ。
Prior Art As a method for expressing the order of records recorded in an auxiliary storage device such as a magnetic disk, there is a method in which the +1-th record address is recorded as a pointer in the logically-th record from the starting point record. Hereinafter, an area in an auxiliary storage device in which records recorded using this recording method are stored will be referred to as a chain file, and a collection of records linked by pointers from one starting point record will be referred to as a chain.

各レコードが始点レコードから何番目のレコー
ドであるかを認識するための従来方式としては、
何らかの手段によつて始点レコードを補助記憶装
置から主記憶装置に読込んだ後、各レコードに記
録されたポインタから次のレコードのアドレスを
得て、該レコードの属するページを直アクセス手
段により主記憶装置に読込む操作を繰返して、終
点レコードまでたどる方式がある。
The conventional method for recognizing the number of each record from the starting point record is as follows:
After reading the starting point record from the auxiliary storage to the main memory by some means, the address of the next record is obtained from the pointer recorded in each record, and the page to which the record belongs is transferred to the main memory by direct access means. There is a method of repeating the operation of reading data into the device and tracing it to the end point record.

ここにページとは補助記憶装置と主記憶装置と
の間の物理入出力単位であり、以下補助記憶装置
と主記憶装置との間でページを入出力するための
操作をページIOと呼ぶ。
Here, a page is a physical input/output unit between an auxiliary storage device and a main storage device, and hereinafter, an operation for inputting/outputting a page between an auxiliary storage device and a main storage device will be referred to as page IO.

第2図は4個のページからなるチエインフアイ
ルの例であり、チエインフアイル内には1個のチ
エインを構成する7個のレコードが格納されてい
る。aiは各レコードのアドレスを示し、a4は始
点レコード、a5は終点レコード、その他はすべ
て中間レコードである。
FIG. 2 shows an example of a chain file consisting of four pages, and seven records constituting one chain are stored in the chain file. ai indicates the address of each record, a4 is a start point record, a5 is an end point record, and all others are intermediate records.

従来方式においては、ある始点レコードに対応
するチエイン全体が1つのページ内に閉じて格納
されている場合は、主記憶に読込んだページ内を
探索できるため、1個のページIOで終点レコー
ドまでたどることができる。
In the conventional method, if the entire chain corresponding to a certain start point record is closed and stored in one page, the page read into main memory can be searched, so one page IO can be used to reach the end point record. can be traced.

しかし、この第2図のようにチエインが複数個
のページに跨つて記録されている場合は、読込ん
だページをすべて記憶しない限り、各レコード毎
にページIOを必要とする。第2図においては始
点レコードはチエインフアイル内で1個のみであ
るが、チエインフアイル内に多数の始点レコード
とそれらレコードから始まるチエインが存在し、
各チエインがページに跨つているような場合は、
すべてのチエインをたどるためにはフアイル当り
のレコード件数に等しい回数のページIOが必要
である。
However, if a chain is recorded across multiple pages as shown in Figure 2, page IO is required for each record unless all read pages are stored. In Figure 2, there is only one start point record in the chain file, but there are many start point records in the chain file and chains starting from those records.
If each chain spans pages,
Tracing the entire chain requires a number of page IOs equal to the number of records per file.

さらに、第3図に示すように、順序性を規定す
るポインタが複数種類あるときは、フアイル当り
のレコード件数とレコード当りのポインタ数の積
に相当するページIOが必要になる場合がある。
Furthermore, as shown in FIG. 3, when there are multiple types of pointers that define ordering, page IOs corresponding to the product of the number of records per file and the number of pointers per record may be required.

発明の目的 本発明は以上述べてきた従来技術の問題点を解
決すべくなされたものであり、その目的とすると
ころは、ページIOの削減を図つたチエイン探索
方法を提供することである。
OBJECTS OF THE INVENTION The present invention has been made to solve the problems of the prior art described above, and its purpose is to provide a chain search method that reduces page IO.

発明の構成 本発明によれば、チエインフアイル内の各レコ
ードの順序性を認識するチエイン探索方法であつ
て、前記チエインフアイルのページをチエインフ
アイルの先頭から順次主記憶内に読込む第1のス
テツプと、チエインフアイル内の各レコードにつ
いて、そのレコードの格納アドレスと前記レコー
ド内のポインタとの組から、(A,B,C,N)
の4つのフイールド(A及びCは始点、終点、中
間の各レコードに応じてそのアドレス及びポイン
タを記録するフイールド、Bは始点、終点、中間
の各レコードに応じて0,1または2を記録する
フイールド、Nはレコードの順序を示すフイール
ド)からなるフイールドレコードを生成して分類
用作業フアイルに格納する第2のステツプと、前
記分類用作業フアイルの前記フイールドレコード
について前記フイールドをキーとして昇順に並べ
換えを行う第3のステツプと、この並べ換え後の
分類用作業フアイルの互いに隣接するフイールド
レコードの各々に関して所定の規則に従つて互い
に突合せ処理を行いその突合せが一定の関係にあ
るフイールドレコードを結果フアイルに格納し、
それ以外のフイールドレコードの突合せ結果を突
合せ用作業フアイルに格納する第4のステツプ
と、前記第4のステツプの終了に応答して前記突
合せ用作業フアイルの内容を前記分類用作業フア
イルへ複写して前記第3のステツプから前記第4
のステツプを繰返し行う第4のステツプとを含
み、前記突合せ用作業フアイルにフイールドレコ
ードが一件も出力されなくなつたときの前記結果
フアイルのフイールドレコードの前記Nフイール
ドにより、チエインフアイル内の任意のレコード
がチエインフアイル内の最初のレコードから幾つ
チエインをたどれば到達できるかを示す情報を得
るようにしたことを特徴とするチエイン探索方法
が得られる。
Structure of the Invention According to the present invention, there is provided a chain search method that recognizes the order of each record in a chain file, in which a first step of sequentially reading pages of the chain file into main memory from the beginning of the chain file. And for each record in the chain file, (A, B, C, N) from the set of the storage address of the record and the pointer in the record.
4 fields (A and C are fields that record the address and pointer according to each record at the start point, end point, and intermediate point; B records 0, 1, or 2 according to each record at the start point, end point, and intermediate point. field, N is a field indicating the order of records) and storing it in a classification work file, and sorting the field records in the classification work file in ascending order using the field as a key. The third step is to compare each adjacent field record in the classification work file after this sorting with each other according to a predetermined rule, and the field records that have a certain relationship as a result of the comparison are created as a result file. store,
a fourth step of storing the matching results of other field records in the matching work file; and, in response to the completion of the fourth step, copying the contents of the matching work file to the classification work file. From the third step to the fourth step
and a fourth step of repeating the above steps, and when no field record is output to the matching work file, the N field of the field record of the result file is used to output any field record in the chain file. A chain search method is obtained which is characterized in that information indicating how many chains it takes to reach a record from the first record in a chain file is obtained.

実施例 以下、本発明の実施例を図面を用いて説明す
る。
Embodiments Hereinafter, embodiments of the present invention will be described with reference to the drawings.

本発明の実施例のブロツク図を第1図に示す。
第1図において、補助記憶装置11〜41は必ず
しも異なる装置である必要はなく、チエインフア
イル11、結果フアイル21、突合せ用作業フア
イル31、分類用作業フアイル41の全部または
これらの任意の組合せを同一の補助記憶装置に配
置してもよいが、第1図ではこれらフアイルは全
て異なる補助記憶装置に配置されているものとし
て示している。
A block diagram of an embodiment of the invention is shown in FIG.
In FIG. 1, the auxiliary storage devices 11 to 41 do not necessarily have to be different devices, but may all or any combination of the chain file 11, result file 21, matching work file 31, and classification work file 41 be the same. However, in FIG. 1, these files are all shown as being located in different auxiliary storage devices.

制御手段5は順アクセス手段1を用いてチエイ
ンフアイルを読み順序性を認識するために必要な
レコードを順アクセス手段4を用いて分類用作業
フアイル41に出力し、その後分類手段6と順ア
クセス手段3、順アクセス手段4を繰返し用いて
分類用作業フアイル41と突合せ用作業フアイル
31との間でレコードを複数回移し変えながら、
順序性の決定したレコードを順アクセス手段2を
用いて結果フアイル21へ出力する。
The control means 5 uses the sequential access means 1 to read the chain file and outputs the records necessary for recognizing the orderliness to the classification work file 41 using the sequential access means 4, and then outputs the records to the classification work file 41 using the sequential access means 6 and the sequential access means. 3. While repeatedly using the sequential access means 4 to transfer records between the classification work file 41 and the matching work file 31 multiple times,
The records whose order has been determined are output to the result file 21 using the sequential access means 2.

本発明の前提となるチエインフアイル11の条
件を第2図によつて説明する。
The conditions of the chain file 11, which are the premise of the present invention, will be explained with reference to FIG.

(1) aiはレコードアドレスを示し、各レコードを
チエインフアイル11内で一意に識別するもの
であれば、その表現形式は任意である。ただ
し、ページを読込んだときにai値が判別できる
ことが必要である。
(1) ai indicates a record address, and can be expressed in any format as long as it uniquely identifies each record within the chain file 11. However, it is necessary to be able to determine the AI value when the page is loaded.

(2) レコードの第1フイールドはポインタを示
し、第2フイールドはレコードがチエインの始
点であるか(第2図では“S”)、終点であるか
(第2図では“E”)、中間であるか(第2図で
は空白)を示すフラグである。ポインタおよび
フラグの位置、フラグの値は該レコード自身ま
たは外部からの指示により判別できる限り任意
である。
(2) The first field of a record indicates a pointer, and the second field indicates whether the record is the start point of a chain (“S” in Figure 2), the end point (“E” in Figure 2), or an intermediate point. (blank in FIG. 2). The positions of the pointers and flags, and the values of the flags are arbitrary as long as they can be determined from the record itself or from external instructions.

分類用作業フアイル41、突合せ用作業フアイ
ル31及び結果フアイル21には、夫々4個のフ
イールドで構成される新たなフイールドレコード
(A,B,C,N)が格納される。第1及び第3
フイールドA,Cには、始点、終点、中間の各レ
コードに応じてそのアドレスやポインタが記録さ
れ、第2フイールドBには、同じく始点、終点、
中間の各レコードに応じて0,1または2の各値
が記録され、第4フイールドNにはレコードの順
序性を示す整数値が記録されるもので、具体的に
は以下のとおりである。
New field records (A, B, C, N) each consisting of four fields are stored in the classification work file 41, the matching work file 31, and the result file 21. 1st and 3rd
In fields A and C, addresses and pointers are recorded according to the start point, end point, and intermediate records, and in the second field B, the start point, end point, and
Each value of 0, 1, or 2 is recorded according to each intermediate record, and an integer value indicating the order of the records is recorded in the fourth field N. Specifically, it is as follows.

(1) B=0かつN=0ならば、チエインフアイル
内のレコードはチエインフアイル内のレコード
Aからチエインをたどつて2のG乗番目(2G
あり、ここにGは整数値レジスタの値であつて
後述する突合せ用作業フアイル31へ突合せ処
理結果を何回繰返し格納したかの回数を表わ
す)に当ることを示す。
(1) If B = 0 and N = 0, the record in the chain file is 2 to the G power (2 G , where G is the integer value register) following the chain from record A in the chain file. This is a value that represents the number of times the matching processing results have been repeatedly stored in the matching work file 31, which will be described later.

(2) B=0かつN≠0ならば、チエインフアイル
内のレコードAは始点レコードからチエインを
たどつてN番目にあたることを示す。
(2) If B=0 and N≠0, this indicates that record A in the chain file is the Nth record in the chain from the starting point record.

(3) B=1かつN=0ならば、チエインフアイル
内のレコードAはレコードNからチエインをた
どつて2のG乗番目にあたることを示す。
(3) If B=1 and N=0, this indicates that record A in the chain file is the 2<G>th record in the chain from record N.

(4) B=2のときはチエインフアイル内のレコー
ドAは終点レコードであることを示し、この場
合はC=0,N=0である。
(4) When B=2, it indicates that record A in the chain file is the end point record, and in this case, C=0 and N=0.

以下の説明では、分類用作業フアイル41、突
合せ用作業フアイル31及び結果フアイル21の
各フイールドレコードの内容を上述した(A,
B,C,N)の形式で示し、例えば、第4図Aの
最初のレコードは(a6,0,a1,0)で表わさ
れる。
In the following explanation, the contents of each field record of the classification work file 41, the matching work file 31, and the result file 21 are described above (A,
For example, the first record in FIG. 4A is represented by (a6, 0, a1, 0).

本発明は第3図のように順序性を規定するポイ
ンタが複数種類ある場合、またフアイル内に複数
の始点レコードがある場合にも容易に応用できる
ので、第2図のチエインフアイル11について、
第1図にもとづき手順の詳細を説明する。
The present invention can be easily applied to cases where there are multiple types of pointers that define order as shown in FIG. 3, or where there are multiple start point records in a file, so for the chain file 11 shown in FIG.
The details of the procedure will be explained based on FIG.

(1) 訟御手段5は順序アクセス手段1を用いてチ
エインフアイル11の先頭からページを順次的
に主記憶装置に読込み、チエインフアイル11
のすべてのレコードにつき、以下の(1−1),
(1−2),(1−3)のいずれかの操作を行う。
(1) The litigation control means 5 uses the sequential access means 1 to sequentially read pages from the beginning of the chain file 11 into the main memory, and
For all records, the following (1-1),
Perform either operation (1-2) or (1-3).

(1‐1) レコードaiが始点レコードならば、
[ai,0,ai,0]なるフイールドレコード
を生成して結果フアイルに出力し[aiのポイ
ンタ、0,ai,1]なるフイールドレコード
を生成して分類用作業フアイル41に出力す
る。
(1-1) If record ai is the starting record,
A field record [ai, 0, ai, 0] is generated and output to the result file, and a field record [ai pointer, 0, ai, 1] is generated and output to the classification work file 41.

(1‐2) レコードaiが終点レコードならば、
[ai,2,0,0]なるフイールドレコード
を生成して分類用作業フアイル41に出力す
る。
(1-2) If record ai is the end record,
A field record [ai, 2, 0, 0] is generated and output to the classification work file 41.

(1‐3) レコードaiが中間レコードならば、[ai
のポインタ、0,ai,0]なるフイールドレ
コードと、[ai,1,aiのポインタ、0]な
るフイールドレコードを生成し、分類用作業
フアイル41に出力する。
(1-3) If record ai is an intermediate record, [ai
A field record of [ai, 1, pointer of ai, 0] and a field record of [ai, 1, pointer of ai, 0] are generated and output to the classification work file 41.

チエインフアイル11内のレコードが全て始点
レコードであれば処理を終了し、そうでなければ
レジスタGの値を0にして分類手段6に制御を渡
し、(2)へ行く。
If all the records in the chain file 11 are start records, the process ends; if not, the value of the register G is set to 0, control is passed to the classification means 6, and the process goes to (2).

(2) 分類手段6は分類用主記憶装置7を使用しつ
つ、分類用作業フアイル41のレコードをその
第1フイールド、第2フイールド、第3フイー
ルドをキーとして昇順に並び換えて、制御手段
5に制御を返す。
(2) The classification means 6 uses the classification main storage device 7 and sorts the records in the classification work file 41 in ascending order using the first field, second field, and third field as keys, and the control means 5 Return control to.

(3) 制御手段5は分類用作業フアイル41の先頭
からレコードを読込み前後のレコードを比較し
ながら(31)〜(36)のいずれかの処理を分類
用作業フアイル41の終端に達するまで繰り返
す。(31)〜(36)において、Ap,Bp,Cp,
Npは分類用作業フアイル41の先頭からp番
目のレコードの第1、第2、第3、第4フイー
ルドの値を示す。
(3) The control means 5 reads records from the beginning of the classification work file 41 and repeats any one of the processes (31) to (36) while comparing the records before and after the classification work file 41 until the end of the classification work file 41 is reached. In (31) to (36), Ap, Bp, Cp,
Np indicates the values of the first, second, third, and fourth fields of the p-th record from the beginning of the classification work file 41.

(31) Ap=Ap+1,Bp+1=1,Np=0な
らば、[Cp+1,0,Cp,0]及び[Cp,1,
Cp+1,0]なるフイールドレコードを突合
せ用作業フアイル31に出力し、p=p+2と
する。すなわち、チエインフアイル内のレコー
ドApがチエインフアイル内のレコードCpから
2のG乗番目にあたり、チエインフアイル内の
レコードCp+1がAp(=Ap+1)から2のG
乗番目にあたるため、Cp+1がCpから2のG
+1乗番目にあたり、チエインの先頭から何番
目にあたるかは未確定であることを示す情報を
次のG+1回目の処理のために保存する。
(31) If Ap=Ap+1, Bp+1=1, Np=0, then [Cp+1,0,Cp,0] and [Cp,1,
Cp+1,0] is output to the matching work file 31, and p=p+2. In other words, record Ap in the chain file is 2 G from record Cp in the chain file, and record Cp+1 in the chain file is 2 G from Ap (=Ap+1).
Since it corresponds to the multiplicity, Cp+1 is G of 2 from Cp
This is the +1st power, and information indicating that the number from the beginning of the chain is undetermined is stored for the next G+1st processing.

(32) Ap=Ap+1,Bp+1,Np≠0であれ
ば、[Ap,0,Cp,Np]及び[Cp+1,0,
Cp,Np+2のG乗]なるフイールドレコード
を突合せ用作業フアイル31に出力し、p=p
+2とする。すなわち、Apは始点フイールド
からチエインをたどつてNp番目であり、かつ
Cp+1はApから2のG乗番目にあたり、Cp+
1はCpからNp+2のG乗番目にあたるため、
Apは始点レコードCpからNp番目であり、Cp
+1はCpからNp+2のG乗番目にあたること
を示す情報を次のG+1回目の処理のために保
存する。
(32) If Ap=Ap+1, Bp+1, Np≠0, then [Ap, 0, Cp, Np] and [Cp+1, 0,
Cp, Np + 2 to the G power] is output to the matching work file 31, and p=p
+2. That is, Ap is the Npth point along the chain from the starting point field, and
Cp+1 is 2 to the G power from Ap, and Cp+
Since 1 corresponds to the Gth power of Np + 2 from Cp,
Ap is the Npth record from the starting point record Cp, and Cp
+1 stores information indicating that it corresponds to the G-th power of Np+2 from Cp for the next G+1-th processing.

(33) Ap=Ap+1,Bp+1=2,Np=0な
らば、p+1番目のレコードを突合せ用作業フ
アイル31に出力し、p=p+2とする。
(33) If Ap=Ap+1, Bp+1=2, and Np=0, output the p+1st record to the matching work file 31 and set p=p+2.

(34) Ap=Ap+1,Bp+1=2,Np≠0な
らば、p番目のレコードを突合せ用作業フアイ
ル31に出力し、p=p+2とする。
(34) If Ap=Ap+1, Bp+1=2, Np≠0, output the pth record to the matching work file 31 and set p=p+2.

(35) Ap≠Ap+1,Bp=Bp+1=0,Np=
0ならば、p=p+1とする。
(35) Ap≠Ap+1, Bp=Bp+1=0, Np=
If it is 0, p=p+1.

(36) Ap≠Ap+1,Bp=Bp+1=0,Np≠
0ならばp番目のレコードを結果フアイル21
に出力し、p=p+1とする。
(36) Ap≠Ap+1, Bp=Bp+1=0, Np≠
If it is 0, the pth record is saved in the result file 21.
, and p=p+1.

制御手段5は分類用作業フアイル41の終端に
達すると、下記の操作を行う。
When the control means 5 reaches the end of the classification work file 41, it performs the following operations.

(37) 最終レコードの第4フイールドが0のと
きは(38)へ行き、0でなければ最終レコード
を結果フアイル21へ出力して(38)へ行く。
(37) If the fourth field of the final record is 0, go to (38); otherwise, output the final record to the result file 21 and go to (38).

(38) 前記繰返し処理中に突合せフアイル31
へ1件もレコードが出力されなければ処理を終
了し、そうでなければ(4)へ行く。
(38) During the iterative process, the matching file 31
If no records are output to , the process ends, otherwise go to (4).

(4) 制御手段5はレジスタGに1を加算し、突合
せ用作業フアイル31の内容を分類用フアイル
41に複写して分類手段6に制御を渡し、(2)へ
行く。
(4) The control means 5 adds 1 to the register G, copies the contents of the matching work file 31 to the classification file 41, passes control to the classification means 6, and goes to (2).

以上のように、分類処理を繰返す過程におい
て、結果フアイル21には、[自アドレス、0、
始点レコードアドレス、始点レコードからの相対
番号]なる形式のレコードが蓄積され、チエイン
フアイル11内の全てのレコードの順序性が認識
できる。
As described above, in the process of repeating the classification process, the result file 21 contains [own address, 0,
Records in the format [start point record address, relative number from the start point record] are accumulated, and the order of all records in the chain file 11 can be recognized.

第4図を用いて手順の詳細を補足説明する。第
2図のチエインフアイル11を入力して前記手順
(1)を実行すると、分類用作業フアイル41の内容
は第4図Aのようになり、結果フアイル21には
第4図のCで示すレコードが出力される。
The details of the procedure will be supplementarily explained using FIG. Enter the chain file 11 in Figure 2 and perform the above steps.
When (1) is executed, the contents of the classification work file 41 become as shown in FIG. 4A, and the record shown by C in FIG. 4 is output to the result file 21.

手順(2)により第4図Aを分類すると分類用作業
フアイル41は第4図Bで示す状態になる。G=
0のとき、手順(3)を実行すると第4図Dで示す突
合せ用作業フアイル31が作成され、手順(4)でG
=1として手順(2)により分類すると分類用作業フ
アイル41は第4図Eで示す状態になる。
When the file A in FIG. 4 is classified according to step (2), the classification work file 41 becomes in the state shown in FIG. 4B. G =
0, when step (3) is executed, a matching work file 31 shown in FIG. 4D is created, and in step (4)
When classification is performed according to step (2) with =1, the classification work file 41 is in the state shown in FIG. 4E.

G=1のとき、手順(3)を実行すると第4図Fで
示す突合せ用作業フアイル31が作成され、手順
(4)でG=2として手順(2)による分類すると分類用
作業フアイル41は第4図Gで示す状態になる。
When G=1, when step (3) is executed, a matching work file 31 shown in FIG. 4F is created, and step
When classifying according to step (2) with G=2 in (4), the classification work file 41 becomes in the state shown in FIG. 4G.

G=2のとき、手順(3)を実行すると第4図Hで
示す突合せ用作業フアイル31が作成され、第4
図Jで示すレコードが結果フアイル21に追加さ
れ、手順(4)でG=3として手順(2)により分類する
と分類用作業フアイル41は第4図Iで示す状態
になる。
When G=2, executing step (3) creates the matching work file 31 shown in FIG.
When the record shown in FIG. J is added to the result file 21 and classified according to step (2) with G=3 in step (4), the classification work file 41 becomes in the state shown in FIG. 4I.

G=3のとき、手順(3)を実行すると第4図Kで
示すレコードが結果フアイル21に追加される
が、突合せ用作業フアイル31にはレコードが出
力されないので、処理を終了する。
When G=3, when step (3) is executed, a record shown in FIG. 4K is added to the result file 21, but since no record is output to the matching work file 31, the process is terminated.

前記のように手順を繰返すことにより、結果フ
アイル21へは第4図C、第4図J及び第4図K
で示すレコードが蓄積される。よつて、この結果
フアイルの内容により各レコードの順序性が認識
可能となる。
By repeating the procedure as described above, the result file 21 contains Figure 4C, Figure 4J, and Figure 4K.
The records indicated by are accumulated. Therefore, the order of each record can be recognized based on the contents of the resulting file.

以上要約すれば、順アクセス手段1を用いてチ
エインフアイル11内のページをすべて読込み、
各レコードの順序性を認識するために必要なレコ
ードからなる作業フアイルを作成し、これ等をレ
コードに対して[log2N]++1回の分類処理を繰
返すことにより、チエインフアイル内のすべての
チエインについて、各レコードのチエイン内での
順序性を認識するようにしているのである。
To summarize the above, all pages in the chain file 11 are read using the sequential access means 1,
By creating a work file consisting of the records necessary to recognize the order of each record, and repeating the classification process [log 2 N] + +1 times for these records, all the records in the chain file are Regarding the chain, the order of each record within the chain is recognized.

ここに、Nはチエインフアイルに含まれている
すべてのチエインについて、チエインを構成する
レコードから1引いた値の最大値をとつた値であ
り、[ ]+は小数点以下を切下げた整数値を示す
ものとする。
Here, N is the maximum value obtained by subtracting 1 from the records that make up the chain for all chains included in the chain file, and [ ] + indicates the integer value rounded down to the decimal point. shall be taken as a thing.

このように、チエインフアイル当りのページ数
に等しいページIO回数と作業フアイルに対する
ページIO回数との和でもつて、チエインフアイ
ル内のすべてのチエインの順序性が認識できるこ
とになり、[log2N]++1回の分類操作の過程で
作業フアイルのレコード数は急激に減少する。
In this way, even if the number of page IOs equal to the number of pages per chain file is the sum of the number of page IOs for the work file, the ordering of all chains in the chain file can be recognized, and [log 2 N] + In the process of +1 classification operation, the number of records in the work file decreases rapidly.

また、作業フアイルのページ当りのレコード数
を補助記憶装置の特性が許す限り最大化して作業
フアイルのページIOを削減できること、分類用
主記憶容量を大きくして分類作業フアイルのペー
ジIOを削減できるなど最適化が容易であるとい
う利点を有する。特に、ページに跨がるチエイン
の多いチエインフアイルに対しては、従来方式に
比し全体のページIOを削減できることになるの
である。
In addition, the number of records per page of the work file can be maximized to the extent that the characteristics of the auxiliary storage device allow, reducing the page IO of the work file, and the main memory capacity for classification can be increased to reduce the page IO of the classification work file. It has the advantage of being easy to optimize. In particular, for chain files with many chains spanning pages, the overall page IO can be reduced compared to the conventional method.

発明の効果 以上述べたように、本発明はチエインフアイル
に大量のレコードが格納されているとき、すべて
のレコードのチエイン内での順序性を一度に認識
する場合に効果がある。特に、チエインフアイル
内に異なる順序性を規定するポインタが何種類も
存在する場合に効果が著しい。
Effects of the Invention As described above, the present invention is effective when recognizing the order of all records within the chain at once when a large number of records are stored in a chain file. This is particularly effective when there are many types of pointers that define different ordering within a chain file.

本発明はデータ間の論理的な関係をチエインで
表現してするデータベースの再編成処理やチエイ
ンの連結状態を検査する場合に応用できる。
The present invention can be applied to database reorganization processing in which logical relationships between data are expressed in chains, and to inspection of chain connection states.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の実施例のブロツク図、第2図
及び第3図はチエインフアイルの例を示す図、第
4図A〜Kは第2図のチエインフアイルについて
本発明を適用して順序性を認識する過程を示す図
である。 主要部分の符号の説明、1…順アクセス手段
1、2…順アクセス手段2、3…順アクセス手段
3、4…順アクセス手段4、5…制御手段、6…
分類手段、7…分類用主記憶、11…チエインフ
アイル、21…結果フアイル、31…突合せ用作
業フアイル、41…分類用作業フアイル。
FIG. 1 is a block diagram of an embodiment of the present invention, FIGS. 2 and 3 are diagrams showing an example of a chain file, and FIGS. FIG. 2 is a diagram showing the process of recognizing gender. Explanation of symbols of main parts: 1... sequential access means 1, 2... sequential access means 2, 3... sequential access means 3, 4... sequential access means 4, 5... control means, 6...
Classification means, 7...Main memory for classification, 11...Chain file, 21...Result file, 31...Work file for comparison, 41...Work file for classification.

Claims (1)

【特許請求の範囲】[Claims] 1 チエインフアイル内の各レコードの順序性を
認識するチエイン探索方法であつて、前記チエイ
ンフアイルのページをチエインフアイルの先頭か
ら順次主記憶内に読込む第1のステツプと、チエ
インフアイル内の各レコードについて、そのレコ
ードの格納アドレスと前記レコード内のポインタ
との組から、(A,B,C,N)の4つのフイー
ルド(A及びCは始点、終点、中間の各レコード
に応じてそのアドレス及びポインタを記録するフ
イールド、Bは始点、終点、中間の各レコードに
応じて0,1または2を記録するフイールド、N
はレコードの順序を示すフイールド)からなるフ
イールドレコードを生成して分類用作業フアイル
に格納する第2のステツプと、前記分類用作業フ
アイルの前記フイールドレコードについて前記各
フイールドをキーとして昇順に並べ換えを行う第
3のステツプと、この並べ換え後の分類用作業フ
アイルの互いに隣接するフイールドレコードの
各々に関して所定の規則に従つて互いに突合せ処
理を行いその突合せ結果が一定の関係にあるフイ
ールドレコードを結果フアイルに格納し、それ以
外のフイールドレコードの突合せ結果を突合せ用
作業フアイルに格納する第4のステツプと、前記
第4のステツプの終了に応答して前記突合せ用作
業フアイルの内容を前記分類用作業フアイルへ複
写して前記第3のステツプから前記第4のステツ
プを繰返し行う第5のステツプとを含み、前記突
合せ用作業フアイルにフイールドレコードが一件
も出力されなくなつたときの前記結果フアイルの
フイールドレコードの前記Nフイールドにより、
チエインフアイル内の任意のレコードがチエイン
フアイル内の最初のレコードから幾つチエインを
たどれば到達できるかを示す情報を得るようにし
たことを特徴とするチエイン探索方法。
1 A chain search method that recognizes the order of each record in a chain file, which includes a first step of sequentially reading pages of the chain file into main memory from the beginning of the chain file, and , from the set of the storage address of the record and the pointer in the record, four fields (A, B, C, N) (A and C are the addresses and A field that records a pointer. B is a field that records 0, 1, or 2 depending on the start point, end point, and intermediate record. N
is a field indicating the order of records) and stores it in the classification work file, and the field records in the classification work file are rearranged in ascending order using each field as a key. In the third step, each of the adjacent field records in the classification work file after sorting is compared with each other according to a predetermined rule, and the field records that have a certain relationship as a result of the matching are stored in the result file. and a fourth step of storing the matching results of other field records in the matching work file, and in response to the completion of the fourth step, copying the contents of the matching work file to the classification work file. and a fifth step of repeating the third step to the fourth step, and a fifth step of repeating the third step to the fourth step; With the N field,
A chain search method characterized in that information indicating how many chains from the first record in a chain file can be reached to reach an arbitrary record in a chain file.
JP60139978A 1985-06-26 1985-06-26 Chain searching system Granted JPS621029A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60139978A JPS621029A (en) 1985-06-26 1985-06-26 Chain searching system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60139978A JPS621029A (en) 1985-06-26 1985-06-26 Chain searching system

Publications (2)

Publication Number Publication Date
JPS621029A JPS621029A (en) 1987-01-07
JPH0467660B2 true JPH0467660B2 (en) 1992-10-29

Family

ID=15258094

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60139978A Granted JPS621029A (en) 1985-06-26 1985-06-26 Chain searching system

Country Status (1)

Country Link
JP (1) JPS621029A (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2538906B2 (en) * 1987-03-13 1996-10-02 株式会社東芝 IC card

Also Published As

Publication number Publication date
JPS621029A (en) 1987-01-07

Similar Documents

Publication Publication Date Title
US4053871A (en) Method and system for the iterative and simultaneous comparison of data with a group of reference data items
US7849039B2 (en) Method for using one-dimensional dynamics in assessing the similarity of sets of data using kinetic energy
CN100357952C (en) Binary data access method
JP2693914B2 (en) Search system
AU707738B2 (en) Method and system for performing a boolean operation on bit strings using a maximal bit slice
JPH0467660B2 (en)
Blobel The BOS system
GB1265006A (en)
JPS6132695B2 (en)
JP2596332B2 (en) Data combination extraction method and apparatus
JP2943693B2 (en) Sort work file space management method
JP3549251B2 (en) Sort processing apparatus and sort processing method
JPS62121532A (en) Data retrieving method
JPH0475551B2 (en)
JPS63253431A (en) Retrieving system for data base of inverted structure
JPH0577098B2 (en)
JPH01277932A (en) Data base rearrangement method
JPH02206829A (en) Method for sorting record group
JPS61166624A (en) Sorting system for logging record
JPH01175651A (en) Address converting system
JPH0196728A (en) Alteration of data base table
JPS5824822B2 (en) How to access data memory block
JPS63225824A (en) Set operation system
JPS6286428A (en) Holding system of record set
JPS5850044A (en) Retrieval processing system for index record