Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPH0518148B2 - - Google Patents
[go: Go Back, main page]

JPH0518148B2 - - Google Patents

Info

Publication number
JPH0518148B2
JPH0518148B2 JP60257611A JP25761185A JPH0518148B2 JP H0518148 B2 JPH0518148 B2 JP H0518148B2 JP 60257611 A JP60257611 A JP 60257611A JP 25761185 A JP25761185 A JP 25761185A JP H0518148 B2 JPH0518148 B2 JP H0518148B2
Authority
JP
Japan
Prior art keywords
field
index
record
sorting
sort
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
JP60257611A
Other languages
Japanese (ja)
Other versions
JPS62118435A (en
Inventor
Kenichi Nanri
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 JP60257611A priority Critical patent/JPS62118435A/en
Publication of JPS62118435A publication Critical patent/JPS62118435A/en
Publication of JPH0518148B2 publication Critical patent/JPH0518148B2/ja
Granted legal-status Critical Current

Links

Landscapes

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

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、データレコードの複数個のフイール
ドに対して、それぞれのフイールドの値をキーと
するインデツクスを同時に生成する方式に関す
る。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a system for simultaneously generating indexes using the values of the respective fields as keys for a plurality of fields of a data record.

〔従来の技術〕[Conventional technology]

従来、1つのフイールドに対するインデツクス
を生成するために、データフアイル上の全てのデ
ータレコードを1回読み込みインデツクスのキー
となるフイールドの値の順に並び換えてインデツ
クスの生成処理を行つており、複数個のフイール
ドに対してインデツクスを同時に生成する場合に
おいても前記処理を複数回繰り返していた。
Conventionally, in order to generate an index for one field, the index generation process was performed by reading all data records on a data file once and sorting them in the order of the values of the field that is the key of the index. Even when creating indexes for fields at the same time, the above process is repeated multiple times.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

上記の従来のインデツクス生成方式では、同時
に生成するインデツクスの個数だけデータフアイ
ルからデータレコードを繰り返し読み込まなけれ
ばならず、同時に生成するインデツクスの個数が
多いときには非常に大量のデータレコードの読み
込みが必要となる。
In the conventional index generation method described above, it is necessary to repeatedly read data records from a data file for the number of indexes to be generated at the same time, and when a large number of indexes are to be generated at the same time, it is necessary to read a very large amount of data records. .

インデツクス生成に於いてデータレコードの読
み込みに要する時間はインデツクス生成の中で大
きなウエイトを占めており、同じデータレコード
を同時に生成するインデツクスの個数回繰り返し
読み込むことはインデツクス生成の効率に大きく
影響を与え、高速性という点で問題がある。
The time required to read data records plays a large role in index generation, and repeatedly reading the same data record several times to generate indexes at the same time greatly affects the efficiency of index generation. There is a problem with high speed.

そこで本発明は同一データフアイルに対して複
数個のインデツクスを同時に生成する場合に於い
てデータフアイルを一度しか読まないことにより
高速にインデツクスを生成することを目的とした
複数インデツクス生成方式を提供するものであ
る。
Therefore, the present invention provides a multiple index generation method for the purpose of generating indexes at high speed by reading the data file only once when multiple indexes are generated for the same data file at the same time. It is.

〔問題点を解決するための手段〕[Means for solving problems]

本発明の複数インデツクス生成方式は、データ
フアイルからデータレコードを1件ずつ読み込む
手段と、前記データレコードからインデツクスを
生成する複数個のフイールドを抽出し、それぞれ
のフイールドの値にフイールド識別子とデータフ
アイル上のアドレスとを付加してソートレコード
を生成する手段と、前記ソートレコードを記憶す
る第1の記憶手段と、インデツクスを生成する複
数個のフイールドに対するフイールド属性情報を
生成する手段と、前記フイールド属性情報を記憶
する第2の記憶手段と、前記第1の記憶手段に格
納されているソートレコードを前記第2の記憶手
段に格納されているフイールド属性情報に従つて
フイールド識別子を第1キーとしフイールドの値
を第2キーとして並び換えるソート手段と、前記
第1の記憶手段からソート後のソートレコードを
読み込みインデツクスを生成する手段とを含んで
構成される。
The multiple index generation method of the present invention includes means for reading data records one by one from a data file, extracting a plurality of fields for generating indexes from the data records, and adding a field identifier and a field identifier to the value of each field on the data file. means for generating a sort record by adding an address to the field; a first storage means for storing the sort record; a means for generating field attribute information for a plurality of fields for which an index is to be generated; and a second storage means for storing the sort record stored in the first storage means, the field identifier being the first key, and the sort record stored in the first storage means being the field identifier as the first key. It is constructed to include a sorting means for sorting values using a second key, and a means for reading a sorted record from the first storage means and generating an index.

〔実施例〕〔Example〕

次に、本発明の一実施例について図面を参照し
て説明する。
Next, an embodiment of the present invention will be described with reference to the drawings.

第1図は本発明の一実施例の構成図であり、デ
ータフアイル1からデータレコードを読み込むデ
ータレコード読み込み手段2と、インデツクスの
キーとなるフイールドの値にフイールド識別子と
データフアイル上のアドレスとを付加してソート
レコードを生成するソートレコード生成手段3
と、インデツクスのキーとなるフイールドの属性
情報を生成するフイールド属性情報生成手段4
と、フイールド属性情報に従つてフイールド識別
子を第1キーとしフイールドの値を第2キーとし
て並び換えるソート手段6と、ソート後のソート
レコード読み込みインデツクスを生成するインデ
ツクス生成手段8と、フイールド属性情報記憶手
段5と、ソートレコード記憶手段7と、生成され
たインデツクスフアイル9とから構成されてい
る。
FIG. 1 is a block diagram of an embodiment of the present invention, in which a data record reading means 2 reads a data record from a data file 1, and a field identifier and an address on the data file are assigned to the value of the field that is the key of the index. Sort record generation means 3 that generates sort records by adding
and field attribute information generation means 4 that generates attribute information of a field that is a key of the index.
, a sorting means 6 for sorting according to the field attribute information with the field identifier as the first key and the field value as the second key, an index generating means 8 for generating an index for reading sorted records after sorting, and a field attribute information storage. It is composed of means 5, sort record storage means 7, and a generated index file 9.

ソートレコード記憶手段7はデータレコードか
ら生成したソートレコードを並び換えるための作
業用であり、フイールド属性情報記憶手段5に格
納されている情報はソートレコードを並び換える
ために必要である。またインデツクスフアイル9
はデータレコードから生成されたインデツクスを
格納するフアイルである。
The sort record storage means 7 is used for sorting sort records generated from data records, and the information stored in the field attribute information storage means 5 is necessary for sorting the sort records. Also index file 9
is a file that stores an index generated from data records.

本実施例のデータレコード形式は第2図に示す
とおり、A10,B11,C12,D13の4つ
のフイールドから成り、フイールドA10,C1
2,D13の3つのフイールドに対して同時にイ
ンデツクスを生成しようとしている。
As shown in FIG. 2, the data record format of this embodiment consists of four fields, A10, B11, C12, and D13.
An attempt is made to simultaneously generate indexes for three fields: 2 and D13.

本実施例のデータレコードを第3図に示す。デ
ータレコードは10件から成る。各フイールドのサ
フイツクスは並びの順番を示している。
The data record of this example is shown in FIG. The data records consist of 10 items. The suffix for each field indicates the order of the list.

ソートレコード形式は第4図に示すとおり、そ
れぞれのフイールドに対応したフイールド識別子
14と、フイールド値15と、データレコードの
データフアイル1上の位置を示すアドレス16と
から成る。
As shown in FIG. 4, the sort record format consists of a field identifier 14 corresponding to each field, a field value 15, and an address 16 indicating the position of the data record on the data file 1.

各フイールドの属性情報として第5図のように
フイールド識別子17とフイールド属性18との
対で対応表を作成する。
As attribute information for each field, a correspondence table is created using pairs of field identifiers 17 and field attributes 18 as shown in FIG.

本方式によるインデツクスの生成手順は以下の
とおりである。
The procedure for generating an index using this method is as follows.

(1) 第3図のデータレコード群からデータレコー
ド読み込み手段2によりデータレコードを1件
ずつ読み込み、ソートレコード生成手段3によ
りインデツクス生成の対象となるフイールドに
対してインデツクスを生成する順に番号(本実
施例の場合、フイールドA:01、C:02、D:
03)を割り付け、その番号をフイールド識別子
14として、インデツクス生成の対象となるフ
イールドのフイールド値15と、データレコー
ドのデータフアイル1上の位置を示すアドレス
16とから第4図のソートレコード形式のソー
トレコードを生成し、ソートレコード記憶手段
7に格納する、全てのデータレコードに対して
この処理を施すことによつて第7図に示すソー
トレコード群がソートレコード記憶手段7上に
できる。
(1) The data record reading means 2 reads data records one by one from the data record group shown in FIG. In the example, fields A:01, C:02, D:
03), and using that number as the field identifier 14, perform sorting using the sort record format shown in Figure 4 from the field value 15 of the field to be indexed and the address 16 indicating the position of the data record on the data file 1. By performing this processing on all data records to be generated and stored in the sort record storage means 7, a sort record group shown in FIG. 7 is created on the sort record storage means 7.

(2) 第5図のフイールド識別子17とフイールド
属性18との対応表は、フイールド属性情報生
成手段4により、それぞれのフイールドに割り
付けたフイールド識別子とフイールド属性とか
ら(本実施例の場合、フイールドA:“C”(文
字)、C:“U”(数値)、D:“N”(日本語)を
第6図のように)フイールド属性情報記憶手段
5上に作成する。
(2) The correspondence table between the field identifier 17 and the field attribute 18 in FIG. : "C" (letter), C: "U" (numeric value), D: "N" (Japanese) (as shown in FIG. 6) are created on the field attribute information storage means 5.

(3) ソートレコード生成手段3により生成された
ソートレコード記憶手段7上のソートレコード
群に対してソート手段6が、フイールド識別子
14を第1キー、フイールド値15を第2キー
としてフイールド属性情報記憶手段5上のフイ
ールド属性18に従つて並び換える。フイール
ド識別子14をキーとして並び換えたのが第8
図、さらにフイールド値15をフイールド属性
18に従つて並び換えたのが第9図である。
(3) For the sort record group on the sort record storage means 7 generated by the sort record generation means 3, the sort means 6 stores field attribute information with the field identifier 14 as the first key and the field value 15 as the second key. Sort according to field attributes 18 on means 5. The 8th one is sorted using field identifier 14 as a key.
In addition, FIG. 9 shows the field values 15 rearranged according to the field attributes 18.

(4) ソート手段6によつて並び換えられたソート
レコード記憶手段7上のソートレコード群を順
次読み込み、インデツクス生成手段8によつて
インデツクスフアイル9上にインデツクスを生
成する。インデツクスはソートレコードを読み
込みフイールド識別子14が同じ間、同一イン
デツクスフアイル9上に生成する。
(4) The sorted records on the sorted record storage means 7 that have been rearranged by the sorting means 6 are read in sequence, and the index generating means 8 generates an index on the index file 9. The index is generated on the same index file 9 while the field identifier 14 is the same by reading the sort record.

フイールド識別子:01のインデツクスは第1
0図のように、フイールド識別子:02のインデ
ツクスは第11図のとおり、又フイールド識別
子:03のインデツクスは第12図のとおり生成
される。
Field identifier: 01 index is the first
0, the index for field identifier: 02 is generated as shown in FIG. 11, and the index for field identifier: 03 is generated as shown in FIG. 12.

〔発明の効果〕〔Effect of the invention〕

本発明は、キーの並び換える処理において並び
換えるソートレコードにフイールドに対応したフ
イールド識別子を付加することと、フイールド識
別子とフイールド属性との対応表を作成すること
によつてデータフアイル内のデータレコードを読
む込み回数を1回にすることが可能となり、複数
個のインデツクスを同時に生成する場合に性能を
向上出来る効果がある。
The present invention enables data records in a data file to be sorted by adding field identifiers corresponding to fields to the sort records to be sorted in the process of sorting keys, and by creating a correspondence table between field identifiers and field attributes. The number of reads can be reduced to one, which has the effect of improving performance when multiple indexes are generated simultaneously.

データレコードの件数をn件、同時に生成する
インデツクスの個数をm個、全データレコードを
1回読み込む時間をt1としたときのデータレコー
ド読み込みに要する時間を第13図に示す。
FIG. 13 shows the time required to read a data record when the number of data records is n, the number of indexes to be generated at the same time is m, and the time to read all data records once is t1.

従来のインデツクス生成方式における所要読み
込み時間は直線19に示されるとおりであつて、
同時に生成するインデツクスの個数だけ全データ
レコードを繰り返し読み込むためデータレコード
読み込みに要する時間はmt1となる。
The required reading time in the conventional index generation method is as shown by the straight line 19,
Since all data records are read repeatedly for the number of indexes to be generated at the same time, the time required to read the data records is mt1.

本方式においては直線20に示すとおりであつ
て、同時に生成するインデツクスの個数には関係
なく全データレコードを読み込む回数は1回であ
り、データレコード読み込みに要する時間はt1と
なる。
In this method, as shown by the straight line 20, all data records are read once regardless of the number of indexes generated at the same time, and the time required to read the data records is t1.

次にn件のソートレコードを並び換えるのに要
する時間をt2としたときのソートレコードを並び
換えに要する時間を第14図に示す。
Next, FIG. 14 shows the time required to rearrange the sorted records, where t2 is the time required to rearrange the n sorted records.

従来の方式における所要並び換え時間は直線2
1に示すとおりであつて、同時に生成するインデ
ツクスの個数回n件のソートレコードを並び換え
る為にmt2の時間を要する。
The required sorting time in the conventional method is a straight line 2
As shown in 1, it takes mt2 time to sort n sorted records the number of times the indexes are generated at the same time.

本方式は直線22に示すとおりであつて、mn
件のソートレコードを2つのキーで並び換えるこ
とになる。つまり、第2キーであるフイールド値
による並び換えは従来の方式と要する時間はほぼ
等しくmt2となり、第1キーであるフイールド識
別子による並び換えに要する時間が従来の方式に
比べて増す。この増分をt3とする。
This method is as shown in the straight line 22, mn
The sorted records will be sorted using two keys. In other words, the time required for sorting by the field value, which is the second key, is approximately the same as the conventional method, mt2, and the time required for sorting by the field identifier, which is the first key, is longer than in the conventional method. Let this increment be t3.

以上からインデツクス生成に要する時間は 従来方式:mt1+mt2 本方式:t1+mt2+t3 となる。 From the above, the time required to generate an index is Conventional method: mt1+mt2 This method: t1+mt2+t3 becomes.

一般に、並び換えに要する時間に比べてデータ
レコードの読み込みに要する時間の方がインデツ
クス生成時に占める割合が大きく、t1>>t3とな
る。従つて、同時に生成するインデツクスの個数
が多い程、本方式による効率の向上が期待でき
る。
Generally, the time required to read data records occupies a larger proportion of the time required for index generation than the time required for sorting, and t1>>t3. Therefore, the efficiency of this method can be expected to improve as the number of indexes that are generated simultaneously increases.

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

第1図は本発明の複数インデツクス生成方式の
一実施例の構成図であり、第2図から第14図は
実施例を説明するための図面であつて、それらの
うち第2図は実施例におけるデータレコード形
式、第3図はデータレコード群、第4図はソート
レコード形式、第5図は識別子と属性の対応表、
第6図は実施例における識別子と属性の対応表、
第7図は実施例におけるソートレコード群、第8
図は第1キーによる並び換え後のソートレコード
群、第9図は第2キーによる並び換え後のソート
レコード群、第10図はフイールドAに対するイ
ンデツクス、第11図はフイールドCに対するイ
ンデツクス、第12図はフイールドDに対するイ
ンデツクス、第13図は読み込み時間の比較、第
14図は並び換え時間の比較をそれぞれ説明する
図である。 記号の説明:1はデータフアイル、2はデータ
レコード読み込み手段、3はソートレコード生成
手段、4はフイールド属性情報生成手段、5はフ
イールド属性情報記憶手段、6はソート手段、7
はソートレコード記憶手段、8はインデツクス生
成手段、9はインデツクスフアイルをそれぞれあ
らわし、又19と20は所要読み込み時間、21
と22は所要並び換え時間をそれぞれあらわして
いる。
FIG. 1 is a block diagram of an embodiment of the multiple index generation method of the present invention, and FIGS. 2 to 14 are diagrams for explaining the embodiment, of which FIG. Figure 3 shows the data record format, Figure 4 shows the sort record format, Figure 5 shows the correspondence table between identifiers and attributes,
FIG. 6 is a correspondence table of identifiers and attributes in the embodiment,
FIG. 7 shows a group of sort records in the embodiment;
The figure shows a sorted record group after sorting by the first key, Fig. 9 shows a sorted record group after sorting by the second key, Fig. 10 shows the index for field A, Fig. 11 shows the index for field C, and Fig. 12 shows the sorted record group after sorting by the second key. The figure shows an index for field D, FIG. 13 shows a comparison of reading times, and FIG. 14 shows a comparison of sorting times. Explanation of symbols: 1 is a data file, 2 is a data record reading means, 3 is a sort record generation means, 4 is a field attribute information generation means, 5 is a field attribute information storage means, 6 is a sorting means, 7
8 represents a sort record storage means, 8 represents an index generation means, 9 represents an index file, 19 and 20 represent the required reading time, and 21
and 22 represent the required sorting time, respectively.

Claims (1)

【特許請求の範囲】 1 データフアイルからデータレコードを1件ず
つ読み込む手段と、 前記データレコードからインデツクスを生成す
る複数個のフイールドを抽出し、それぞれのフイ
ールドの値にフイールド識別子とデータフアイル
上のアドレスとを付加してソートレコードを生成
する手段と、 前記ソートレコードを記憶する第1の記憶手段
と、 インデツクスを生成する複数個のフイールドに
対するフイールド属性情報を生成する手段と、 前記フイールド属性情報を記憶する第2の記憶
手段と、 前記第1の記憶手段に格納されているソートレ
コードを前記第2の記憶手段に格納されているフ
イールド属性情報に従つてフイールド識別子を第
1キーとしフイールドの値を第2キーとして並び
換えるソート手段と、 前記第1の記憶手段からソート後のソートレコ
ードを読み込みインデツクスを生成する手段とを
含むことを特徴とする複数インデツクス生成方
式。
[Scope of Claims] 1. Means for reading data records one by one from a data file, extracting a plurality of fields for generating an index from the data record, and assigning a field identifier and an address on the data file to the value of each field. a first storage means for storing the sort record; a means for generating field attribute information for a plurality of fields for which an index is to be generated; and a means for storing the field attribute information. a second storage means for storing the sort records stored in the first storage means, and storing field values using field identifiers as first keys according to field attribute information stored in the second storage means; A method for generating multiple indexes, comprising a sorting means for sorting as a second key, and a means for reading a sorted record after sorting from the first storage means and generating an index.
JP60257611A 1985-11-19 1985-11-19 Plural indexes generating system Granted JPS62118435A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60257611A JPS62118435A (en) 1985-11-19 1985-11-19 Plural indexes generating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60257611A JPS62118435A (en) 1985-11-19 1985-11-19 Plural indexes generating system

Publications (2)

Publication Number Publication Date
JPS62118435A JPS62118435A (en) 1987-05-29
JPH0518148B2 true JPH0518148B2 (en) 1993-03-11

Family

ID=17308669

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60257611A Granted JPS62118435A (en) 1985-11-19 1985-11-19 Plural indexes generating system

Country Status (1)

Country Link
JP (1) JPS62118435A (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02157934A (en) * 1988-12-09 1990-06-18 Casio Comput Co Ltd variable length data processing device
JPH03219327A (en) * 1990-01-25 1991-09-26 Mitsubishi Electric Corp Index forming processor
JP2687887B2 (en) * 1994-07-22 1997-12-08 日本電気株式会社 Relational database management method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5957340A (en) * 1982-09-27 1984-04-02 Fujitsu Ltd Multi-item table search system
JPS59121436A (en) * 1982-12-27 1984-07-13 Fujitsu Ltd Sorting method of data group
US4606002A (en) * 1983-05-02 1986-08-12 Wang Laboratories, Inc. B-tree structured data base using sparse array bit maps to store inverted lists

Also Published As

Publication number Publication date
JPS62118435A (en) 1987-05-29

Similar Documents

Publication Publication Date Title
US5276868A (en) Method and apparatus for pointer compression in structured databases
Cole The preparation of examination time-tables using a small-store computer
CA2278444A1 (en) Method and apparatus for locating a desired record in a telephone directory
EP0304302A2 (en) Data retrieval system
Hagerup Towards optimal parallel bucket sorting
JPH0518148B2 (en)
JPH01297723A (en) Control data regenerating device for sort processor
JPS59121436A (en) Sorting method of data group
JPS6172333A (en) How to merge multiple files
Zeh An external-memory data structure for shortest path queries
US6901396B1 (en) Packed radix search tree implementation
JPH10240741A (en) How to manage tree structured data
JP3549251B2 (en) Sort processing apparatus and sort processing method
JPH06215044A (en) Information retrieval processor
JP2923952B2 (en) Merge processing method
JP2943694B2 (en) Data registration method and data search method
JPH04155521A (en) Sorting processing system
JPS63149728A (en) Index forming device
JPS628226A (en) File key search method
JPH0452967A (en) And operation processing system for set file
JPH0793129A (en) Sort system
JPS6266326A (en) Array processing system for japanese data
JPH03216729A (en) Elctronic computer
JPH01258125A (en) Key sequential retrieving system for record
JPH04137176A (en) Circuit diagram conversion device