JPH0727531B2 - File control method - Google Patents
File control methodInfo
- Publication number
- JPH0727531B2 JPH0727531B2 JP63015359A JP1535988A JPH0727531B2 JP H0727531 B2 JPH0727531 B2 JP H0727531B2 JP 63015359 A JP63015359 A JP 63015359A JP 1535988 A JP1535988 A JP 1535988A JP H0727531 B2 JPH0727531 B2 JP H0727531B2
- Authority
- JP
- Japan
- Prior art keywords
- storage unit
- address
- data
- storage
- search key
- 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 - Fee Related
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
【発明の詳細な説明】 〔産業上の利用分野〕 本発明はデータベースシステム等の如き電子計算機利用
システムで採用されるファイル制御方式に関し、特に、
データをデータレコードとしてデータファイルに格納す
る際に、後の検索処理を検索キー値に基づいて速やかに
行なえるよう、格納するデータをその検索キー値に応じ
たデータファイル内の格納単位に格納するようにしたフ
ァイル制御方式に関する。DETAILED DESCRIPTION OF THE INVENTION [Industrial field of use] The present invention relates to a file control system adopted in a computer system such as a database system, and in particular,
When storing data as a data record in a data file, store the stored data in the storage unit in the data file that corresponds to the search key value so that subsequent search processing can be performed quickly based on the search key value. File control method.
従来のこの種のファイル制御方式の構成を第8図に示
す。同図において、91はデータをデータレコードとして
記憶するための外部記憶媒体上のデータファイルであ
り、第9図に示すように複数の格納単位Dから構成さ
れ、それぞれの格納単位Dはデータファイル91内で一意
となるアドレスを持っている。A conventional file control system of this type is shown in FIG. In the figure, reference numeral 91 is a data file on an external storage medium for storing data as a data record, and is composed of a plurality of storage units D as shown in FIG. 9, and each storage unit D is a data file 91. Have an address that is unique within.
格納手段93は、格納すべきデータを受取ると、そのデー
タの全部または一部を検索キー値とし、これをアドレス
変換手段92に渡す。アドレス変換手段92はこれに応答し
て例えばその検索キー値をデータファイル91に構成する
格納単位Dの数で割った余りをハッシュ値として求め、
そのハッシュ値に対応する格納単位Dのアドレスを格納
手段93に通知する。When the storage means 93 receives the data to be stored, all or a part of the data is used as a search key value, and this is passed to the address conversion means 92. In response to this, the address conversion means 92 obtains, for example, the remainder obtained by dividing the search key value by the number of storage units D included in the data file 91 as a hash value,
The storage unit 93 is notified of the address of the storage unit D corresponding to the hash value.
格納手段93はアドレス変換手段92からアドレスを受取る
と、そのアドレスが指し示す格納単位Dに今回のデータ
をデータレコードとして格納する。通常、一つの格納単
位Dには複数のデータレコードを格納でき、それらは格
納単位毎にある制御レコードにデータポインタで結合さ
れて管理される。また、同一ハッシュ値となるデータの
個数が増大し、そのハッシュ値に対応する格納単位Dが
満杯になると、例えば別のハッシュ値に対応する空きの
格納単位Dをその格納用として一時的に使用し、オーバ
フローしたデータレコードをそれに格納した後、格納単
位D間でリンクを採る方法等により、対処している。When the storage means 93 receives the address from the address conversion means 92, it stores the present data as a data record in the storage unit D indicated by the address. Usually, a plurality of data records can be stored in one storage unit D, and they are managed by being linked to a control record for each storage unit by a data pointer. Further, when the number of data having the same hash value increases and the storage unit D corresponding to that hash value becomes full, for example, an empty storage unit D corresponding to another hash value is temporarily used for storage. Then, after the overflowed data record is stored in it, a method is taken to establish a link between the storage units D.
上述した従来の方式では、ハッシュ値毎に一つの格納単
位が割当てられる。このため、検索キー値の選定やハッ
シュ値の算出方法が良くないと、格納単位毎のデータレ
コードの量に偏りが発生し、以下のような問題が生じ
る。In the conventional method described above, one storage unit is assigned to each hash value. Therefore, if the search key value selection or the hash value calculation method is not good, the amount of data records for each storage unit becomes uneven, and the following problems occur.
ハッシュ値の採りうる値の数を多くすると、多くの格納
単位を必要とする上、格納するデータレコード数が少な
い場合には無駄な空き領域が増え、データファイル91の
有効利用が困難となる。即ち、第10図(a)図に示すよ
うにハッシュ値の数を多くして多くの格納単位Dを使用
すれば、各々の格納単位Dに格納されるデータレコード
数は同図のハッチングを施した部分に示すように少なく
なるが、各格納単位D内での空き領域が増大し、データ
ファイルの有効利用ができない。If the number of possible hash values is increased, a large storage unit is required, and if the number of data records to be stored is small, useless free space increases and it becomes difficult to effectively use the data file 91. That is, if the number of hash values is increased and a large number of storage units D are used as shown in FIG. 10 (a), the number of data records stored in each storage unit D is hatched in the same figure. However, as shown in the portion where the data file becomes smaller, the free area in each storage unit D increases and the data file cannot be effectively used.
反対に、データファイルの有効利用を図るため、ハッシ
ュ値の数を少なくすると、同一ハッシュ値に対応するデ
ータレコード数が増大してオーバフローする確率が高く
なり、検索時の処理が局所的に悪化する。即ち、第10図
(b)に示すようにハッシュ値の数の数を少なくして格
納単位Dを少なくすれば、各格納単位D内の空き領域は
減るが、同一ハッシュ値に対応するデータレコードSRが
オーバフローして複数の格納単位にまたがって格納され
る確率が増え、そのハッシュ値に対応するデータレコー
ドの検索処理の速度が低下する。Conversely, if the number of hash values is reduced in order to effectively use the data file, the number of data records corresponding to the same hash value increases and the probability of overflow increases, and the processing at the time of search locally deteriorates. . That is, as shown in FIG. 10B, if the number of hash values is reduced and the storage unit D is reduced, the free area in each storage unit D is reduced, but the data record corresponding to the same hash value is reduced. The probability that SR will overflow and be stored across multiple storage units will increase, and the speed of the search processing of the data record corresponding to that hash value will decrease.
本発明の目的は、データファイルの有効利用が可能で、
且つ、検索処理も比較的効率良く行なうことができるフ
ァイル制御方式を提供することにある。The purpose of the present invention is to enable effective use of data files,
Another object of the present invention is to provide a file control method that can perform search processing relatively efficiently.
本発明は上記目的を達成するために、 外部記憶媒体上にデータをデータレコードとして記憶す
るためのデータファイルを備え、該データファイルは、
各々データファイル内で一意となるアドレスを持ち且つ
使用中,未使用の二つの状態で管理される複数の格納単
位で構成されているシステムにおいて、 格納単位のアドレスを記憶するための複数のアドレス記
憶域から構成され、各アドレス記憶域はハッシュ値に対
応しているアドレス記憶手段と、 データの検索キー値からハッシュ値を求め、該求めたハ
ッシュ値に対応する前記アドレス記憶領域から前記検索
キー値に現在対応している格納単位のアドレスを取得す
るアドレス変換手段と、 未使用の格納単位を使用中の格納単位として組込み、同
じ格納単位のアドレスを記憶る複数のアドレス記憶域の
うちの一部のアドレス記憶域に設定されているアドレス
を、前記組込んだ格納単位のアドレスに変更すると共
に、該変更したアドレス記憶域に対応するデータレコー
ドを前記元の格納単位から前記組込んだ格納単位に移送
する格納単位分割手段と、 前記データファイルからのデータ検索時、データの検索
キー値を用いて前記アドレス変換手段により検索キー値
に対応する格納単位を求め、該求めた格納単位から検索
キー値が一致するデータレコードを求める検索手段と、 前記データファイルへのデータ格納時、データの検索キ
ー値を用いて前記アドレス変換手段により検索キー値に
対応する格納単位を求め、該求めた格納単位に前記デー
タをデータレコードとして格納できる空き領域がある場
合にはその格納単位に前記データをデータレコードとし
て格納し、空き領域が無い場合には前記格納単位分割手
段を起動して前記空き領域の無かった格納単位を分割し
て空き領域を確保した後、前記データの検索キー値に対
応する格納単位に前記データをデータレコードとして格
納する格納手段とを備えている。In order to achieve the above object, the present invention comprises a data file for storing data as a data record on an external storage medium, the data file comprising:
In a system composed of a plurality of storage units each having a unique address in the data file and being managed in two states, in use and unused, a plurality of address storages for storing the addresses of the storage units Address storage means, each address storage area corresponding to a hash value, and a hash value from the search key value of the data, and the search key value from the address storage area corresponding to the calculated hash value. Address conversion means that obtains the address of the storage unit that currently corresponds to, and a part of multiple address storage areas that store the address of the same storage unit by incorporating an unused storage unit as the storage unit that is in use The address set in the address storage area is changed to the address of the built-in storage unit, and the changed address storage area Storage unit dividing means for transferring the corresponding data record from the original storage unit to the built-in storage unit; and a search key by the address conversion means using a search key value of data when searching data from the data file. Searching means for finding a storage unit corresponding to a value and finding a data record having a matching search key value from the found storage unit; and the address converting means using the search key value of the data when storing data in the data file. The storage unit corresponding to the search key value is obtained by the above, and if the obtained storage unit has a free area in which the data can be stored as a data record, the data is stored as a data record in the storage unit and there is no free area. In this case, the storage unit dividing means is activated to divide the storage unit having no free space to secure a free space. After that, a storage unit for storing the data as a data record in a storage unit corresponding to the search key value of the data is provided.
本発明の作用を、理解を容易とする為に単純化した例を
示す図面を参照して説明する。The operation of the present invention will be described with reference to the drawings showing a simplified example for easy understanding.
今、第1図(a)に示すように、アドレス記憶装置中の
二つのアドレス記憶域(Ai,Aj(Aiはハッシュ値Hiに、A
jはハッシュ値Hjに対応している)に同一の格納単位Di
のアドレスdiが記憶されているとする。検索すべきデー
タの検索キー値によりアドレス変換手段で求められたハ
ッシュ値に対応するアドレス記憶域がAi,Ajとなるデー
タレコード郡RHi,RHjは、格納単位Diに空き領域がある
限り、第1図(a)に示すようにその格納単位Diに格納
される。Now, as shown in FIG. 1 (a), two address storage areas (Ai, Aj (Ai is a hash value Hi, A
j corresponds to the hash value Hj)
It is assumed that the address di of is stored. The data record group RHi, RHj whose address storage area corresponding to the hash value obtained by the address conversion means by the search key value of the data to be searched is Ai, Aj is the first as long as the storage unit Di has a free area. It is stored in the storage unit Di as shown in FIG.
新たに格納すべきデータが発生し、その検索キー値によ
りアドレス変換手段で求まったハッシュ値に対応するア
ドレス記憶域が例えばAiであり、格納単位Diに充分な空
き領域がなかった場合、格納単位分割手段が起動され
る。格納単位分割手段は起動されると、第1図(b)に
示すように、未使用の格納単位を一つ使用中の格納単位
Djとして組込み、アドレス記憶域Ai,Ajの一方たとえばA
jに設定されているアドレスdiを格納単位Djのアドレスd
jに変更し、この変更したアドレス記憶域Ajに対応する
データレコードつまりハッシュ値がHjとなるデータレコ
ード(データレコード郡RHjに含まれるデータレコー
ド)を、格納単位Djに移送する。これにより格納単位D
i,Djに空き領域が生成されたので、今回のデータのデー
タレコードRを該当する格納単位(今の場合はDi)に格
納する。If data to be stored newly is generated and the address storage area corresponding to the hash value obtained by the address conversion means by the search key value is, for example, Ai and there is not enough free area in the storage unit Di, the storage unit The dividing means is activated. When the storage unit dividing means is started, as shown in FIG. 1B, one unused storage unit is in use.
Built in as Dj, one of address storage areas Ai and Aj, eg A
The address di set in j is the address d of the storage unit Dj
The data record corresponding to the changed address storage area Aj, that is, the data record having the hash value Hj (the data record included in the data record group RHj) is transferred to the storage unit Dj. This allows storage unit D
Since the vacant areas are generated in i and Dj, the data record R of the current data is stored in the corresponding storage unit (Di in this case).
次に本発明の実施例について図面を参照して説明する。 Next, embodiments of the present invention will be described with reference to the drawings.
第2図を参照すると、本発明を適用したファイル制御方
式の実施例は、データファイル1と、アドレス記憶装置
2と、アドレス変換手段3と、格納単位分割手段4と、
格納手段5と、検索手段6とで構成される。Referring to FIG. 2, an embodiment of a file control system to which the present invention is applied is a data file 1, an address storage device 2, an address converting means 3, a storage unit dividing means 4,
The storage unit 5 and the search unit 6 are included.
データファイル1は、データをデータレコードとして記
憶するための外部記録媒体上のファイルであり、第3図
に示すように複数の格納単位D1,D2等で構成され、各格
納単位D1,D2等はデータファイル1内で一意となるアド
レスd1,d2等を持っている。各格納単位D1,D2等は使用中
と未使用の二つの状態で管理され、使用中の格納単位は
使用領域Uとして管理され、未使用の格納単位は未使用
領域NUとして管理されている。The data file 1 is a file on an external recording medium for storing data as a data record, and is composed of a plurality of storage units D1, D2, etc. as shown in FIG. 3, and each storage unit D1, D2, etc. It has unique addresses d1, d2, etc. in the data file 1. Each storage unit D1, D2, etc. is managed in two states, in use and unused, the storage unit in use is managed as a used area U, and the unused storage unit is managed as an unused area NU.
アドレス記憶装置2は、例えば第4図に示すように、格
納単位のアドレスを記憶するための複数のアドレス記憶
域A1〜Amから構成される。各アドレス記憶域A1〜Amの総
数mは採用するハッシュ値の数に応じて決定される。各
アドレス記憶域A1〜Amのアドレス記憶装置2の先頭から
の順番号は、そのアドレス記憶域に対応するハッシュ値
を示している。The address storage device 2 is composed of a plurality of address storage areas A1 to Am for storing addresses of storage units, as shown in FIG. 4, for example. The total number m of the address storage areas A1 to Am is determined according to the number of hash values to be adopted. The sequential number from the beginning of the address storage device 2 of each address storage area A1 to Am indicates the hash value corresponding to that address storage area.
アドレス変換手段3は、格納手段5または検索手段6か
ら検索キー値Kが通知されると、Kをアドレス記憶域の
数mで割算した余りQをハッシュ値とし、このハッシュ
値に対応するアドレス記憶域に記憶されたアドレスを要
求元の格納手段5または検索手段6に通知する手段であ
る。なお、ハッシュ値の計算方法は上記のものに限ら
ず、その他各種の方法が採用可能である。アドレス変換
手段3の処理例を第5図に示す。When the search key value K is notified from the storage unit 5 or the search unit 6, the address conversion unit 3 sets the remainder Q obtained by dividing K by the number m of the address storage areas as a hash value, and the address corresponding to this hash value. This is means for notifying the storage means 5 or the search means 6 of the request source of the address stored in the storage area. Note that the hash value calculation method is not limited to the above, and various other methods can be adopted. FIG. 5 shows an example of processing of the address conversion means 3.
格納単位分割手段4は、格納手段5から起動されると、
新たな使用中格納単位の獲得、アドレス記憶装置2の更
新,データファイル1内の該当する格納単位に格納され
たデータレコードの分割等を行なう手段であり、その処
理例を第6図に示す。When the storage unit dividing means 4 is activated from the storage means 5,
This is a means for acquiring a new storage unit in use, updating the address storage device 2, dividing the data record stored in the corresponding storage unit in the data file 1, and the like. An example of the processing is shown in FIG.
格納手段5は、格納すべきデータが外部から通知される
と、データの検索キー値をアドレス変換手段3に通知し
て格納単位のアドレスを返してもらい、そのアドレスが
指し示す格納単位に空き領域があれば格納すべきデータ
をデータレコードとしてその格納単位に格納し、空き領
域がなければ格納単位分割手段4を起動することにより
生成された格納単位の空き領域にデータレコードを格納
する手段であり、その処理の一例を第7図に示す。When the storage unit 5 is notified of the data to be stored from the outside, the storage unit 5 notifies the address conversion unit 3 of the search key value of the data and returns the address of the storage unit, and the storage unit indicated by the address has an empty area. If there is a free space, the data to be stored is stored in the storage unit, and if there is no free space, the data record is stored in the free space of the storage unit generated by activating the storage unit dividing means 4. An example of the processing is shown in FIG.
検索手段6は、外部から検索キー値を指定した参照,更
新の要求を受けると、その検索キー値をアドレス変換手
段3に通知して格納単位のアドレスを返してもらい、そ
のアドレスが指し示す格納単位内を検索することによ
り、その検索キー値を持つデータレコードを取得し、参
照要求時は取得したデータレコードのデータを要求元に
返却し、更新要求時は要求された値でそのデータレコー
ドを更新してデータファイル内の元の位置に再び格納す
る手段である。When the search unit 6 receives a reference or update request specifying a search key value from the outside, the search unit 6 notifies the address conversion unit 3 of the search key value and has the address of the storage unit returned, and the storage unit indicated by the address. By searching inside, the data record with the search key value is acquired, the data of the acquired data record is returned to the request source at the time of reference request, and the data record is updated with the requested value at the time of update request. Then, the data is stored again in the original position in the data file.
次に、このように構成された本実施例の動作を説明す
る。Next, the operation of this embodiment configured as described above will be described.
データファイル1に一つもデータレコードが格納されて
いない初期の状態において、アドレス記憶装置2の各ア
ドレス記憶域A1〜Amのどのようなアドレスを格納してお
くかについては、各種の方式が採用できる。例えば、極
端な場合、一つの使用中の格納単位D1だけを確保し、全
てのアドレス記憶域A1〜Amにその格納単位D1のアドレス
d1を格納しておくこともできるし、二つの使用中の格納
単位D1,D2を確保し、アドレス記憶域A1〜Amを2分割し
た一方の側の全てのアドレス記憶域に格納単位D1のアド
レスd1を、他方の側の全てのアドレス記憶域に格納単位
D2のアドレスd2をそれぞれ格納しておくこともできる。
更に、アドレス記憶域の個数mの半分の数の使用中格納
単位を確保し、二つずつのアドレス記憶域に同一のアド
レスを設定しておくこともできる。要するに、初期状態
においてどれだけの数の格納単位を使用中とするのか,
同じアドレス値を持つアドレス記憶域をどの程度当初か
ら用意するか等に依存して決定される。In the initial state where no data record is stored in the data file 1, various methods can be adopted as to which address of each address storage area A1 to Am of the address storage device 2 is stored. . For example, in an extreme case, only one storage unit D1 in use is reserved, and the address of that storage unit D1 is stored in all the address storage areas A1 to Am.
d1 can be stored, or two storage units D1 and D2 in use are reserved, and the address storage area A1 to Am is divided into two, and the address of the storage unit D1 is stored in all address storage areas on one side. Storage unit of d1 in all address storage areas on the other side
It is also possible to store the address d2 of D2 respectively.
Further, it is also possible to secure the number of storage units in use that is half the number m of the address storage areas and set the same address in two address storage areas. In short, how many storage units are in use in the initial state,
It is determined depending on how much an address storage area having the same address value is prepared from the beginning.
さて、アドレス記憶装置2に初期のアドレスが設定され
た状態で(従って、幾つかの格納単位も使用中の状態と
して確保された状態で)、外部より格納すべきデータが
格納手段5に通知されると、格納手段5は第7図に示す
ように、まず今回格納するデータの検索キー値を通知し
てアドレス変換手段3を起動する。(S21)。Now, with the initial address set in the address storage device 2 (hence, some storage units are secured as in use), the storage means 5 is notified of the data to be stored from the outside. Then, as shown in FIG. 7, the storage means 5 first notifies the search key value of the data to be stored this time and activates the address conversion means 3. (S21).
起動されたアドレス変換手段3は、第5図に示すよう
に、通知された検索キー値をアドレス記憶域A1〜Amの数
mで割り、その余りをその検索キー値に対応するハッシ
ュ値つまりアドレス記憶域の番号とし(S1)、そのアド
レス記憶域からアドレスを取出して格納手段5に通知す
る(S2)。As shown in FIG. 5, the activated address conversion means 3 divides the notified search key value by the number m of the address storage areas A1 to Am, and the remainder is the hash value corresponding to the search key value, that is, the address. The storage area number is set (S1), the address is taken out from the address storage area, and the storage means 5 is notified (S2).
アドレスの返却を受けた格納手段5は、そのアドレスが
指し示すデータファイル1内の格納単位に、今回のデー
タを格納するのに充分な空き領域が存在するか否かを調
べる(S22)。そして存在した場合(S23でYESの場
合)、今回のデータをデータレコードとしてその格納単
位に格納し(S25)、処理を終える。The storage means 5 that has received the return address checks whether or not there is a sufficient free area for storing the current data in the storage unit in the data file 1 pointed to by the address (S22). If it exists (YES in S23), the data of this time is stored as a data record in the storage unit (S25), and the process ends.
反対に、格納単位に空き領域がない場合(S23でNOの場
合)、その格納単位のアドレスを通知して格納単位分割
手段4を起動する(S24)。On the contrary, when there is no free area in the storage unit (NO in S23), the address of the storage unit is notified and the storage unit dividing means 4 is activated (S24).
起動された格納単位分割手段4は、第6図に示すよう
に、先ず未使用領域NUから格納単位を一つ使用領域Uに
組込み(S11)、格納手段5から通知されたアドレスと
同じアドレスが記憶されているアドレス記憶装置2の複
数のアドレス記憶域のうちの幾つかのアドレス記憶域
(幾つのアドレス記憶域とするかは任意である)に、ス
テップS11で使用領域Uに組込んだ格納単位が持つアド
レスを格納する(S12)。そして、アドレスを格納し直
したアドレス記憶域に対応する検索キー値(即ちハッシ
ュ値)を持つデータレコードを元の格納単位中から捜し
出し、それらを上記組込んだ格納単位に移送する(S1
3)。そして、制御を格納手段5に戻す。As shown in FIG. 6, the activated storage unit dividing means 4 first incorporates one storage unit from the unused area NU into the use area U (S11), and the same address as the address notified from the storage means 5 is set. The storage incorporated in the used area U in step S11 in some of the plurality of address storage areas of the stored address storage device 2 (how many address storage areas are arbitrary) The address of the unit is stored (S12). Then, the data record having the search key value (that is, the hash value) corresponding to the address storage area in which the address is re-stored is searched from the original storage unit, and they are transferred to the built-in storage unit (S1
3). Then, the control is returned to the storage means 5.
格納手段5は、制御が格納単位分割手段4から戻される
と、再びステップS21から処理を開始し、アドレス変換
手段3から今回の検索キー値に対応するアドレスを再度
通知してもらう(この通知アドレスは前回と同一場合と
異なる場合とがある)。そして、アドレスが返却される
と、このときは空き領域が存在するのでステップS22,S2
3を経てステップS25に進み、該当格納単位に今回のデー
タレコードを格納して処理を終える。When the storage unit 5 returns the control from the storage unit dividing unit 4, the storing unit 5 starts the process again from step S21, and the address converting unit 3 notifies the address corresponding to the current search key value again (this notification address). May be different from the same as the last time). Then, when the address is returned, there are free areas at this time, so steps S22, S2
After step 3, the process proceeds to step S25, the data record of this time is stored in the corresponding storage unit, and the process ends.
以上のような処理が繰返されることにより、データファ
イル1内に多数のデータレコードが格納される。なお、
格納手段5から通知されたアドレスを記憶するアドレス
記憶域が一つになった場合は、例えば格納単位分割手段
4は分割不可を格納手段5に通知し、格納手段5は従来
と同様にオーバフローに伴う処理を行なうが、本発明で
はアドレス記憶域の数mを適当に大きくしておくことに
より、そのような事態が発生する確率は充分に小さくな
る。A large number of data records are stored in the data file 1 by repeating the above processing. In addition,
When the number of address storage areas for storing the addresses notified from the storage means 5 becomes one, for example, the storage unit division means 4 notifies the storage means 5 that the division is not possible, and the storage means 5 overflows as in the conventional case. Although the accompanying processing is performed, in the present invention, by appropriately increasing the number m of address storage areas, the probability that such a situation will occur becomes sufficiently small.
また、外部より検索キー値を指定した検索要求を検索手
段6が受取ると、検索手段6は、その検索キー値をアド
レス変換手段3に通知する。アドレス変換手段3は第5
図に示した処理によりその検索キー値に対応する格納単
位のアドレスを返すので、検索手段6はそのアドレスが
指し示すデータファイル1内の格納単位中を検索するこ
とにより、今回の検索キー値を持つデータレコードを探
索する。そして、参照,更新に応じた処理を行なう。When the search means 6 receives a search request specifying a search key value from the outside, the search means 6 notifies the address conversion means 3 of the search key value. The address conversion means 3 is the fifth
Since the address of the storage unit corresponding to the search key value is returned by the process shown in the figure, the search means 6 has the search key value of this time by searching the storage unit in the data file 1 pointed to by the address. Search data records. Then, the processing corresponding to the reference and update is performed.
以上説明したように、本発明では、アドレス変換手段で
求まるハッシュ値はアドレス記憶装置内のアドレス記憶
域に対応するだけで、格納単位と一対一で対応しなくて
良い。従って、データレコード数が少ない場合、複数の
アドレス記憶域に同一の格納単位のアドレスを記憶する
ことができ即ち異なるハッシュ値になるデータレコード
を同一の格納単位に格納することができ、格納単位の使
用数を少なくすることができる。As described above, in the present invention, the hash value obtained by the address conversion means only corresponds to the address storage area in the address storage device, and does not have to correspond one-to-one with the storage unit. Therefore, when the number of data records is small, the addresses of the same storage unit can be stored in a plurality of address storage areas, that is, the data records having different hash values can be stored in the same storage unit. The number of uses can be reduced.
また、或る格納単位に空き領域がなくなって新たなデー
タレコードを格納することができなくなると、その格納
単位のアドレスが設定されている複数のアドレス記憶域
の一部のアドレス記憶域に新たに使用中に組込んだ格納
単位のアドレスが設定され、このアドレス変更したアド
レス記憶域に対応するデータレコードが上記新たに確保
された格納単位に移送されて、格納の為の空き領域が生
成される。つまり、使用中の格納単位の数は格納される
データレコードの増加に応じて動的に制御されるのでデ
ータファイルの有効的な利用が可能となり、然も予めア
ドレス記憶域の数すなわちハッシュ値の採りうる数を多
くしておくことにより、複数の格納単位間にまたがって
検索しなければならない事態を回避でき、検索処理の効
率を高めることができる。Also, when a certain storage unit runs out of free space and a new data record cannot be stored, a new address is added to a part of the address storage areas in which the addresses of the storage unit are set. The address of the storage unit installed during use is set, and the data record corresponding to the address storage area whose address has been changed is transferred to the newly secured storage unit, and an empty area for storage is created. . In other words, the number of storage units in use is dynamically controlled according to the increase in the number of data records to be stored, so that the data file can be effectively used, and the number of address storage areas, that is, the hash value By increasing the number that can be taken, it is possible to avoid the situation of having to search across a plurality of storage units and improve the efficiency of the search processing.
第1図は本発明の作用の説明図、 第2図は本発明の実施例の構成図、 第3図はデータファイル1の構成例を示す図、 第4図はアドレス記憶装置2の構成例を示す図、 第5図はアドレス変換手段3の処理例の流れ図、 第6図は格納単位分割手段4の処理例の流れ図、 第7図は格納手段5の処理例の流れ図、 第8図は従来方式の構成図、 第9図は従来方式のデータファイル91の構成図および、 第10図は従来方式の問題点の説明図である。 図において、 1…データファイル 2…アドレス記憶装置 3…アドレス変換手段 4…格納単位分割手段 5…格納手段 6…検索手段 Di,Dj…格納単位 di,di…格納単位Di,Djのアドレス Ai,Aj…アドレス記憶域 FIG. 1 is an explanatory diagram of the operation of the present invention, FIG. 2 is a configuration diagram of an embodiment of the present invention, FIG. 3 is a diagram showing a configuration example of a data file 1, and FIG. 4 is a configuration example of an address storage device 2. FIG. 5 is a flow chart of a processing example of the address conversion means 3, FIG. 6 is a flow chart of a processing example of the storage unit dividing means 4, FIG. 7 is a flow chart of a processing example of the storage means 5, and FIG. FIG. 9 is a block diagram of a conventional system, FIG. 9 is a block diagram of a data file 91 of the conventional system, and FIG. 10 is an explanatory diagram of problems of the conventional system. In the figure, 1 ... Data file 2 ... Address storage device 3 ... Address conversion means 4 ... Storage unit dividing means 5 ... Storage means 6 ... Search means Di, Dj ... Storage unit di, di ... Address Ai of storage unit Di, Dj Aj ... address storage area
Claims (1)
として記憶するためのデータファイルを備え、該データ
ファイルは、各々データファイル内で一意となるアドレ
スを持ち且つ使用中,未使用の二つの状態で管理される
複数の格納単位で構成されているシステムにおいて、 格納単位のアドレスを記憶するための複数のアドレス記
憶域から構成され、各アドレス記憶域はハッシュ値に対
応しているアドレス記憶装置と、 データの検索キー値からハッシュ値を求め、該求めたハ
ッシュ値に対応する前記アドレス記憶域から前記検索キ
ー値に現在対応している格納単位のアドレスを取得する
アドレス変換手段と、 未使用の格納単位を使用中の格納単位として組込み、同
じ格納単位のアドレスを記憶する複数のアドレス記憶域
のうちの一部のアドレス記憶域に設定されているアドレ
スを、前記組込んだ格納単位のアドレスに変更すると共
に、該変更したアドレス記憶域に対応するデータレコー
ドを前記元の格納単位から前記組込んだ格納単位に移送
する格納単位分割手段と、 前記データファイルからのデータ検索時、データの検索
キー値を用いて前記アドレス変換手段により検索キー値
に対応する格納単位を求め、該求めた格納単位から検索
キー値が一致するデータレコードを求める検索手段と、 前記データファイルへのデータ格納時、データの検索キ
ー値を用いて前記アドレス変換手段により検索キー値に
対応する格納単位を求め、該求めた格納単位に前記デー
タをデータレコードとして格納できる空き領域がある場
合にはその格納単位に前記データをデータレコードとし
て格納し、空き領域が無い場合には前記格納単位分割手
段を起動して前記空き領域の無かった格納単位を分割し
て空き領域を確保した後、前記データの検索キー値に対
応する格納単位に前記データをデータレコードとして格
納する格納手段とを備えることを特徴とするファイル制
御方式。1. A data file for storing data as a data record on an external storage medium, wherein the data file has two unique states each having an address unique within the data file. In a system composed of multiple storage units managed by, the storage unit is composed of multiple address storage areas for storing the addresses of the storage units, and each address storage area corresponds to the hash value. An address conversion unit that obtains a hash value from the search key value of the data and obtains the address of the storage unit currently corresponding to the search key value from the address storage area corresponding to the obtained hash value; Incorporate a storage unit as the storage unit in use, and store some addresses in multiple address storage areas that store the address of the same storage unit. Address stored in the storage unit is changed to the address of the built-in storage unit, and the data record corresponding to the changed address storage unit is transferred from the original storage unit to the built-in storage unit. And a storage unit dividing unit for performing a data search from the data file, the storage unit corresponding to the search key value is obtained by the address conversion unit using the search key value of the data, and the search key value is obtained from the obtained storage unit. Searching means for finding a matching data record, and when storing data in the data file, a storage unit corresponding to the search key value is obtained by the address converting means using the search key value of the data, and the storage unit thus obtained is If there is a free area that can store data as a data record, store the data as a data record in the storage unit. If there is no free area, the storage unit dividing means is activated to divide the storage unit having no free area to secure an empty area, and then the data is stored in the storage unit corresponding to the search key value of the data. And a storage means for storing as a data record.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP63015359A JPH0727531B2 (en) | 1988-01-26 | 1988-01-26 | File control method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP63015359A JPH0727531B2 (en) | 1988-01-26 | 1988-01-26 | File control method |
Publications (2)
Publication Number | Publication Date |
---|---|
JPH01191229A JPH01191229A (en) | 1989-08-01 |
JPH0727531B2 true JPH0727531B2 (en) | 1995-03-29 |
Family
ID=11886606
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP63015359A Expired - Fee Related JPH0727531B2 (en) | 1988-01-26 | 1988-01-26 | File control method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0727531B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07101885B2 (en) * | 1990-02-15 | 1995-11-01 | 日立電線株式会社 | Bridge circuit that interconnects networks |
JP6011618B2 (en) * | 2012-05-24 | 2016-10-19 | 富士通株式会社 | SEARCH PROGRAM, SEARCH METHOD, SEARCH DEVICE, STORAGE PROGRAM, STORAGE METHOD, AND STORAGE DEVICE |
-
1988
- 1988-01-26 JP JP63015359A patent/JPH0727531B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JPH01191229A (en) | 1989-08-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US4912629A (en) | Real-time garbage collection for list processing using restructured cells for increased reference counter size | |
US5542087A (en) | Linear hashing for distributed records | |
JP3510042B2 (en) | Database management method and system | |
CN110597912B (en) | Block storage method and device | |
CN109947787A (en) | A kind of storage of data hierarchy, hierarchical query method and device | |
JPH10269131A (en) | Computer system and method for sorting array element for optimization of alteration of array | |
CN108804571B (en) | Data storage method, device and equipment | |
JPH07244642A (en) | Parallel processing computers | |
JPH0727531B2 (en) | File control method | |
JP3378594B2 (en) | Processing unit that performs database relocation | |
US9063656B2 (en) | System and methods for digest-based storage | |
JPH04364549A (en) | File storing system and access system | |
JP2912221B2 (en) | Distributed networked striped file system | |
JP2704028B2 (en) | File area management method | |
JP2708012B2 (en) | Update buffer management device | |
EP1730641A2 (en) | Management of local client cache buffers in a clustered computer environment | |
JP2994917B2 (en) | Storage system | |
JP2641399B2 (en) | File management device | |
JPH0793192A (en) | File managing method | |
JP2817911B2 (en) | Access control method for keyed files | |
JP3050194B2 (en) | A system for dynamically adding a shared memory file between hosts, a method for dynamically adding a shared memory file between hosts, and a recording medium storing a program for dynamically adding a shared memory file between hosts | |
JPH06208502A (en) | Memory control method | |
JP2654230B2 (en) | File transfer method | |
JPS62145441A (en) | Key-ordered data set update processing method | |
JP3398672B2 (en) | Intermediate data storage device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
LAPS | Cancellation because of no payment of annual fees |