JP2613961B2 - Index division rate change processing method - Google Patents

Index division rate change processing method

Info

Publication number
JP2613961B2
JP2613961B2 JP2224961A JP22496190A JP2613961B2 JP 2613961 B2 JP2613961 B2 JP 2613961B2 JP 2224961 A JP2224961 A JP 2224961A JP 22496190 A JP22496190 A JP 22496190A JP 2613961 B2 JP2613961 B2 JP 2613961B2
Authority
JP
Japan
Prior art keywords
index
block
record
index block
added
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
JP2224961A
Other languages
Japanese (ja)
Other versions
JPH04106641A (en
Inventor
正明 関根
Original Assignee
日本電気ソフトウェア株式会社
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 日本電気ソフトウェア株式会社 filed Critical 日本電気ソフトウェア株式会社
Priority to JP2224961A priority Critical patent/JP2613961B2/en
Publication of JPH04106641A publication Critical patent/JPH04106641A/en
Application granted granted Critical
Publication of JP2613961B2 publication Critical patent/JP2613961B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はランダムアクセス可能な記憶装置にブロック
単位で階層的に構成された索引の更新処理に関し、特に
索引レコードの追加に伴う索引ブロックの分割処理を行
う場合の索引の分割率変更処理方式に関する。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to update processing of an index hierarchically constructed in block units in a randomly accessible storage device, and more particularly to division of an index block accompanying addition of an index record. The present invention relates to an index division ratio change processing method for performing processing.

〔従来の技術〕[Conventional technology]

従来、この種の索引の更新処理では、空き領域のない
索引ブロックに索引レコードを追加する場合、後でラン
ダムな索引値を持つ索引レコードの追加があることを考
慮して、追加対象の索引ブロックをそれぞれが空き領域
を50%ずつ持つような2つの索引ブロックに分割してか
ら、追加する索引レコードの索引値に従って索引レコー
ドをいずれか一方の索引ブロックに追加していた。
Conventionally, in this type of index update processing, when an index record is added to an index block having no free space, an index block to be added is added in consideration of an index record having a random index value being added later. Is divided into two index blocks each having 50% of free space, and then an index record is added to one of the index blocks according to the index value of the index record to be added.

上記索引ブロックの分割の方法としては、新たに索引
ブロックを作成し、新たに作成された索引ブロックに空
き領域がなかった索引ブロック内の索引レコードの50%
を移送し、それぞれの索引ブロックに50%の空き領域を
作るものである。例えば、第2図に示す索引ファイル20
の空き領域のない索引ブロックi−mに索引値107を持
つ索引レコードiR−107を追加しようとした場合、索引
ブロックi−mは、第4図に示すような50%ずつ空き領
域を有する索引ブロックi−mと索引ブロックi−m+
1とに分割され、索引レコードiR−107は索引値107に従
って索引ブロックi−m+1に追加される。
As a method for dividing the index block, a new index block is created, and 50% of the index records in the index block in which the newly created index block has no free space.
To create 50% free space in each index block. For example, the index file 20 shown in FIG.
When an attempt is made to add an index record iR-107 having an index value 107 to an index block im having no free area, the index block im has an index having an empty area by 50% as shown in FIG. Block im and index block im +
1 and the index record iR-107 is added to the index block i-m + 1 according to the index value 107.

〔発明が解決しようとする課題〕[Problems to be solved by the invention]

上述した従来の索引の更新処理では、各階層内で最大
の索引値より大きな索引値を持つ索引レコードを索引値
の昇順に追加する場合に、最大の索引値を持つ索引ブロ
ックに50%の空き領域を作りながら索引ブロックの分割
を繰り返していくので、特に存在する索引値より大きな
連続した索引値を持つ索引レコードの追加で作成された
索引ブロックは50%の空き領域をもつため、索引が必要
とする容量が大きくなるとともに、索引を使った検索処
理が遅くなるという欠点がある。
In the above-described conventional index update processing, when an index record having an index value larger than the maximum index value in each hierarchy is added in ascending order of the index value, 50% of the index block having the maximum index value has an empty space. Since the division of the index block is repeated while creating an area, an index is necessary because an index block created by adding an index record with a continuous index value larger than the existing index value has 50% free space. However, there is a disadvantage that the search capacity using the index becomes slow as well as the capacity to be used.

本発明の目的は、上述の点に鑑み、各階層内で最大の
索引値より大きな索引値を持つ索引レコードを索引値の
昇順に追加する場合に、最大の索引値を持つ索引ブロッ
クに50%の空き領域を作りながらの分割は行わずに、新
しく作成した索引ブロックに追加する索引レコードのみ
を格納していくようにして、索引ブロック内に空き領域
を作らずに効率よく索引レコードを格納できるようにし
た索引の分割率変更処理方式を提供することにある。
In view of the above, an object of the present invention is to add an index record having an index value larger than the largest index value in each hierarchy in ascending order of the index value, and add 50% to the index block having the largest index value. The index record to be added to the newly created index block is stored without dividing while creating an empty area, and the index record can be efficiently stored without creating an empty area in the index block. An object of the present invention is to provide an index division ratio change processing method.

〔課題を解決するための手段〕[Means for solving the problem]

本発明の索引の分割率変更処理方式は、ランダムアク
セス可能な記憶装置にブロック単位で階層的に構成され
た索引の更新処理において、索引値とその値を持つレコ
ード番号との組合せからなる索引レコードをm(正整
数)番の索引ブロックに追加する場合にm番の索引ブロ
ックに索引レコードを追加できる空き領域があるかどう
かを判定する索引ブロック空き領域判定手段と、この索
引ブロック空き領域判定手段によりm番の索引ブロック
に索引レコードを追加できる空き領域がないと判定され
た場合に新しくn(正整数)番の索引ブロックの領域を
確保する索引ブロック作成手段と、m番の索引ブロック
の階層内での次の索引ブロックを指す位置情報に基づい
てm番の索引ブロックが階層内での最終索引ブロックか
どうかを判定する最終索引ブロック判定手段と、この最
終索引ブロック判定手段によりm番の索引ブロックが階
層内での最終索引ブロックであると判定された場合に追
加する索引レコードの索引値とm番の索引ブロック内で
最大の索引値とを比較判定する索引レコード比較判定手
段と、前記最終索引ブロック判定手段によりm番の索引
ブロックが階層内での最終索引ブロックでないと判定さ
れた場合および前記索引レコード比較判定手段により追
加する索引レコードの索引値がm番の索引ブロック内で
最大の索引値より小さいと判定された場合にm番の索引
ブロックからn番の索引ブロックに索引レコードの50%
を移送する索引レコード移送手段と、m番の索引ブロッ
クおよびn番の索引ブロックの階層内での次の索引ブロ
ックを指す位置情報を更新するブロック位置情報更新手
段と、追加する索引レコードの索引値に従って追加する
索引レコードをm番の索引ブロックに追加するかn番の
索引ブロックに追加するかを決定する索引レコード追加
ブロック決定手段と、前記索引ブロック空き領域判定手
段によりm番の索引ブロックに索引レコードを追加でき
る空き領域があると判定された場合にはm番の索引ブロ
ックに、前記索引レコード追加ブロック決定手段により
索引レコードを追加する索引ブロックが決定された場合
には決定された索引ブロックに索引レコードを追加する
索引レコード追加手段と、m番の索引ブロックを指す上
位索引レコードを更新する上位索引レコード更新手段
と、上位索引ブロックの更新の必要性を前記索引ブロッ
ク作成手段によりn番の索引ブロックを作成したか否か
で判定する上位索引ブロック更新判定手段と、この上位
索引ブロック更新判定手段により上位索引ブロックの更
新が必要であると判定された場合にn番の索引ブロック
内で最小の索引値とn番の索引ブロックを指す位置情報
とからなる上位索引レコードを上位索引ブロックに追加
する上位索引レコード追加手段とを有する。
An index division ratio change processing method according to the present invention provides an index record comprising a combination of an index value and a record number having the value in an update process of an index hierarchically constructed in block units in a randomly accessible storage device. Index block free area determining means for determining whether or not there is a free area in which an index record can be added to the m-th index block when adding to the m-th (positive integer) index block, and this index block free area determining means Index block creation means for securing a new n (positive integer) index block area when it is determined that there is no free area to add an index record to the mth index block, and a hierarchy of the mth index block To determine whether the m-th index block is the last index block in the hierarchy based on the position information pointing to the next index block in the hierarchy Index block determining means, and when the last index block determining means determines that the mth index block is the last index block in the hierarchy, the index value of the index record to be added and the maximum value in the mth index block An index record comparison / judgment unit for comparing and judging the index value of the index record, and a case where the last index block judgment unit judges that the m-th index block is not the last index block in the hierarchy, and When it is determined that the index value of the index record to be executed is smaller than the maximum index value in the m-th index block, 50% of the index records from the m-th index block to the n-th index block
Index record transfer means for transferring the index information, block position information updating means for updating the position information indicating the next index block in the hierarchy of the m-th index block and the n-th index block, and the index value of the index record to be added Index record addition block determining means for determining whether to add an index record to be added to the m-th index block or the n-th index block according to the following formula: If it is determined that there is an empty area to which a record can be added, the index block of number m is added to the index block. If the index block to which an index record is added is determined by the index record additional block determining means, the index block is determined. An index record adding means for adding an index record, and an upper-level index record pointing to the m-th index block A new upper index record updating means, an upper index block update determining means for determining whether or not the upper index block needs to be updated based on whether or not the nth index block has been created by the index block creating means; When the update determining means determines that the upper index block needs to be updated, the upper index record including the minimum index value and the position information indicating the nth index block in the nth index block is stored in the upper index block. And a higher-order index record adding means for adding the upper index record.

〔作用〕[Action]

本発明の索引の分割率変更処理方式では、索引ブロッ
ク空き領域判定手段が索引値とその値を持つレコード番
号との組合せからなる索引レコードをm(正整数)番の
索引ブロックに追加する場合にm番の索引ブロックに索
引レコードを追加できる空き領域があるかどうかを判定
し、索引ブロック作成手段が索引ブロック空き領域判定
手段によりm番の索引ブロックに索引レコードを追加で
きる空き領域がないと判定された場合に新しくn(正整
数)番の索引ブロックの領域を確保し、最終索引ブロッ
ク判定手段がm番の索引ブロックの階層内での次の索引
ブロックを指す位置情報に基づいてm番の索引ブロック
が階層内での最終索引ブロックかどうかを判定し、索引
レコード比較判定手段が最終索引ブロック判定手段によ
りm番の索引ブロックが階層内での最終索引ブロックで
あると判定された場合に追加する索引レコードの索引値
とm番の索引ブロック内で最大の索引値とを比較判定
し、索引レコード移送手段が最終索引ブロック判定手段
によりm番の索引ブロックが階層内での最終索引ブロッ
クでないと判定された場合および索引レコード比較判定
手段により追加する索引レコードの索引値がm番の索引
ブロック内で最大の索引値より小さいと判定された場合
にm番の索引ブロックからn番の索引ブロックに索引レ
コードの50%を移送し、ブロック位置情報更新手段がm
番の索引ブロックおよびn番の索引ブロックの階層内で
の次の索引ブロックを指す位置情報を更新し、索引レコ
ード追加ブロック決定手段が追加する索引レコードの索
引値に従って追加する索引レコードをm番の索引ブロッ
クに追加するかn番の索引ブロックに追加するかを決定
し、索引レコード追加手段が索引ブロック空き領域判定
手段によりm番の索引ブロックに索引レコードを追加で
きる空き領域があると判定された場合にはm番の索引ブ
ロックに、索引レコード追加ブロック決定手段により索
引レコードを追加する索引ブロックが決定された場合に
は決定された索引ブロックに索引レコードを追加し、上
位索引レコード更新手段がm番の索引ブロックを指す上
位索引レコードを更新し、上位索引ブロック更新判定手
段が上位索引ブロックの更新の必要性を索引ブロック作
成手段によりn番の索引ブロックを作成したか否かで判
定し、上位索引レコード追加手段が上位索引ブロック更
新判定手段により上位索引ブロックの更新が必要である
と判定された場合にn番の索引ブロック内で最小の索引
値とn番の索引ブロックを指す位置情報とからなる上位
索引レコードを上位索引ブロックに追加する。
In the index division ratio change processing method according to the present invention, when the index block free area determining means adds an index record composed of a combination of an index value and a record number having that value to an m-th (positive integer) index block, The m-th index block determines whether there is a free area to which an index record can be added, and the index block creation means determines that there is no free area to add an index record to the m-th index block by the index block free area determination means. In this case, a new n-th (positive integer) index block area is reserved, and the last index block determining means determines the m-th index block based on the position information indicating the next index block in the hierarchy of the m-th index block. It is determined whether or not the index block is the last index block in the hierarchy. Is determined as the last index block in the hierarchy, the index value of the index record to be added is compared with the largest index value in the m-th index block, and the index record transport means determines the last index block. Means for judging that the m-th index block is not the last index block in the hierarchy, and that the index record of the index record added by the index record comparison judging means is smaller than the largest index value in the m-th index block. If it is determined, 50% of the index records are transferred from the m-th index block to the n-th index block, and
The position information indicating the next index block in the hierarchy of the index block of the number n and the index block of the number n is updated, and the index record to be added according to the index value of the index record added by the index record addition block determining means is changed to the number m It is determined whether to add to the index block or to the n-th index block, and the index record adding unit determines that the index block free area determining unit has a free area where the index record can be added to the m-th index block. In this case, if an index block to which an index record is to be added is determined by the index record addition block determining means in the m-th index block, the index record is added to the determined index block. The upper index record pointing to the numbered index block is updated, and the upper index block update determination means updates the upper index block. The necessity of updating the index is determined by whether or not the nth index block has been created by the index block creation means, and the upper index record adding means determines that the upper index block update determination means needs to update the upper index block. When it is determined, the upper index record including the minimum index value in the nth index block and the position information indicating the nth index block is added to the upper index block.

〔実施例〕〔Example〕

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

第1図は、本発明の一実施例に係る索引の分割率変更
処理方式の構成を示す流れ図である。本実施例の索引の
分割率変更処理方式は、索引ブロック空き領域判定手段
1と、索引ブロック作成手段2と、最終索引ブロック判
定手段3と、索引レコード比較判定手段4と、索引レコ
ード移送手段5と、ブロック位置情報更新手段6と、索
引レコード追加ブロック決定手段7と、索引レコード追
加手段8と、上位索引レコード更新手段9と、上位索引
ブロック更新判定手段10と、上位索引レコード追加手段
11とから構成されている。
FIG. 1 is a flowchart showing the configuration of an index division ratio change processing method according to an embodiment of the present invention. The index division ratio change processing method according to the present embodiment includes an index block free area determination unit 1, an index block creation unit 2, a final index block determination unit 3, an index record comparison determination unit 4, and an index record transfer unit 5. A block position information updating unit 6, an index record added block determining unit 7, an index record adding unit 8, an upper index record updating unit 9, an upper index block update determining unit 10, an upper index record adding unit
It consists of eleven.

第2図を参照すると、索引ファイル20は、索引ブロッ
クで階層的に構成されており、階層が最下位の索引ブロ
ックi−x(xは1〜m(正整数))と、最下位の索引
ブロックi−x(xは1〜m)を管理している上位索引
ブロックiu−1とからなる。
Referring to FIG. 2, the index file 20 is hierarchically composed of index blocks, and the index block ix (x is 1 to m (positive integer)) of the lowest hierarchy and the lowest index It consists of a higher index block iu-1 which manages block ix (x is 1 to m).

索引ブロックは、複数の索引レコードと、各階層内で
次の索引ブロックの位置を示すアドレス(以下、nextブ
ロックアドレスという)とで構成されている。なお、次
の索引ブロックが存在しない場合は、nextブロックアド
レスは、NULL値を持つ。
The index block is composed of a plurality of index records and an address indicating the position of the next index block in each hierarchy (hereinafter, referred to as a next block address). If the next index block does not exist, the next block address has a NULL value.

例えば、索引ブロックi−1は、索引レコードiR−00
1,iR−002,iR−003,iR−004,iR−005およびiR−006とne
xtブロックアドレスnB−1とを持ち、nextブロックアド
レスnB−1は値としてi−2を持つ。
For example, index block i-1 is index record iR-00
1, iR-002, iR-003, iR-004, iR-005 and iR-006 and ne
xt block address nB-1 and next block address nB-1 has value i-2.

また、索引ブロックi−mは、索引レコードiR−101,
iR−102,iR−103,iR−104,iR−105およびiR−106とnext
ブロックアドレスnB−mとを持ち、この索引ブロックi
−mは索引レコード6個で100%の格納率とする。next
ブロックアドレスnB−mは、NULL値を持つ。
In addition, the index block im includes index records iR-101,
iR-102, iR-103, iR-104, iR-105 and iR-106 and next
Having a block address nB-m and the index block i
-M is a storage rate of 100% for six index records. next
The block address nB-m has a NULL value.

索引レコードiR−001は索引値001およびレコード番号
R001を持ち、同様に索引レコードiR−002は索引値002お
よびレコード番号R002、索引レコードiR−003は索引値0
03およびレコード番号R003、…、索引レコードiR−106
は索引値106およびレコード番号R106を持つ。
Index record iR-001 is index value 001 and record number
Similarly, index record iR-002 has index value 002 and record number R002, and index record iR-003 has index value 0.
03 and record number R003, ..., index record iR-106
Has an index value 106 and a record number R106.

索引ブロックi−x(xは1〜m)の上位索引ブロッ
クiu−1は、上位索引レコードiRu−x(xは1〜m)
とnextブロックアドレスnBu−1とを持ち、上位索引レ
コードiRu−xは索引値および下位の索引ブロックアド
レスi−xからなる。また、nextブロックアドレスは、
NULL値を持つ。
The upper index block iu-1 of the index block ix (x is 1 to m) is the upper index record iRu-x (x is 1 to m).
And the next block address nBu-1, and the upper index record iRu-x includes an index value and a lower index block address ix. The next block address is
Has a NULL value.

上位索引レコードiRu−001は、下位の索引ブロックi
−1内の最小の索引値001および下位の索引ブロックア
ドレスi−1を持ち、上位索引レコードiRu−mは、下
位の索引ブロックi−m内の最小の索引値101および下
位の索引ブロックアドレスi−mを持つ。
The upper index record iRu-001 is stored in the lower index block i.
-1 and the lower index block address i-1, and the upper index record iRu-m has the minimum index value 101 and the lower index block address i in the lower index block im. -M.

次に、このように構成された本実施例の索引の分割率
変更処理方式の動作について説明する。なお、ここで
は、第2図に示す索引ファイル20に索引値107を持つ索
引レコードiR−107を追加して、第3図に示す索引ファ
イル20になる場合の具体的な動作例を第1図に従い
(1)〜(11)の順で説明する。
Next, the operation of the index division ratio change processing method according to the present embodiment configured as described above will be described. Here, a specific operation example in the case where an index record iR-107 having an index value 107 is added to the index file 20 shown in FIG. 2 to become the index file 20 shown in FIG. 3 is shown in FIG. Will be described in the order of (1) to (11).

(1) 索引ブロック空き領域判定手段 索引値とその値を持つレコード番号との組合せからな
る索引レコードを索引値に従ってある索引ブロックに追
加する場合に、索引ブロック空き領域判定手段1は、追
加対象の索引ブロックは索引レコードを追加できる空き
領域があるかどうかを判定する。ここでは、索引値107
およびレコード番号R107を持つ索引レコードiR−107を
索引ブロックi−mに追加するにあたり、索引ブロック
i−mが格納率100%となっているために索引ブロック
i−mに索引レコードiR−107を追加するだけの空き領
域がないと判定する。
(1) Index block free area determination means When adding an index record consisting of a combination of an index value and a record number having the value to a certain index block according to the index value, the index block free area determination means 1 The index block determines whether there is free space to add an index record. Here, the index value 107
When adding the index record iR-107 having the record number R107 to the index block im, since the storage rate of the index block im is 100%, the index record iR-107 is added to the index block im. It is determined that there is not enough free space to be added.

(2) 索引ブロック作成手段 索引ブロック空き領域判定手段1により追加対象の索
引ブロックに索引レコードを追加できる空き領域がない
と判定された場合に、索引ブロック作成手段2は、新し
く索引ブロックの領域を確保する。ここでは、索引ファ
イル20内に第3図中に示す階層が最下位の索引ブロック
i−m+1の領域を新しく確保する。
(2) Index block creation means When the index block free area determination means 1 determines that there is no free area in which an index record can be added to the index block to be added, the index block creation means 2 newly creates an index block area. Secure. Here, a new area for the index block i-m + 1 whose index is the lowest in the hierarchy shown in FIG.

(3) 最終索引ブロック判定手段 索引ブロック作成手段2による索引ブロックの領域の
確保の後、最終索引ブロック判定手段3は、追加対象の
索引ブロックのnextブロックアドレスを参照し、階層内
で最終索引ブロックを意味するNULL値を持つかどうかを
判定する。ここでは、索引ブロックi−mは、nextブロ
ックアドレスnB−mにNULL値を持つため、最終索引ブロ
ックであるとみなされる。
(3) Last index block determining means After securing the area of the index block by the index block creating means 2, the last index block determining means 3 refers to the next block address of the index block to be added, and determines the last index block in the hierarchy. It is determined whether or not it has a NULL value that means. Here, since the index block im has a NULL value at the next block address nB-m, it is regarded as the last index block.

(4) 索引レコード比較判定手段 最終索引ブロック判定手段3により追加対象の索引ブ
ロックが階層内で最終索引ブロックであると判定された
場合に、索引レコード比較判定手段4は、追加する索引
レコードの索引値と最終索引ブロック内で最大の索引値
を持つ索引レコードの索引値とを比較する。ここでは、
追加する索引レコードiR−107の索引値107と索引ブロッ
クi−m内で最大の索引値を持つ索引レコードiR−106
の索引値106とを比較し、追加する索引レコードiR−107
の索引値107の方が大きいと判定する。
(4) Index record comparison / determination means When the last index block determination means 3 determines that the index block to be added is the last index block in the hierarchy, the index record comparison / determination means 4 determines the index of the index record to be added. Compare the value with the index value of the index record with the highest index value in the last index block. here,
The index value 107 of the index record iR-107 to be added and the index record iR-106 having the largest index value in the index block im.
Is compared with the index value 106 of the index record iR-107 to be added.
It is determined that the index value 107 is larger.

(5) 索引レコード移送手段 最終索引ブロック判定手段3により追加対象の索引ブ
ロックi−mが最終索引ブロックでないと判定された場
合、または索引レコード比較判定手段4により追加する
索引レコードの索引値が小さいと判定された場合に、索
引レコード移送手段5は、追加対象の索引ブロックから
新たに作成された索引ブロックに索引レコードの50%を
移送する。ここでは、索引レコード移送手段5は、作動
されない。
(5) Index Record Transfer Unit When the last index block determining unit 3 determines that the index block im to be added is not the last index block, or the index record comparison determining unit 4 has a small index value of the index record to be added. When it is determined that the index record is transferred, 50% of the index records are transferred from the index block to be added to the newly created index block. Here, the index record transfer means 5 is not operated.

(6) 索引レコードブロック位置情報更新手段 索引レコード比較判定手段4により追加する索引レコ
ードの索引値の方が大きいと判定された場合、または索
引レコード移送手段5による索引レコードの移送後に、
索引レコードブロック位置情報更新手段6は、追加対象
の索引ブロックのnextブロックアドレスおよび新しく作
成された索引ブロックのnextブロックアドレスを更新す
る。ここでは、追加対象の索引ブロックi−mのnextブ
ロックアドレスnB−mの値をi−m+1に更新し、新し
く作成した索引ブロックi−m+1のnextブロックアド
レスnB−m+1の値をNULL値に更新する。
(6) Index record block position information updating means When the index record comparison / determination means 4 determines that the index value of the index record to be added is larger, or after the index record is transported by the index record transport means 5,
The index record block position information updating means 6 updates the next block address of the index block to be added and the next block address of the newly created index block. Here, the value of the next block address nB-m of the index block im to be added is updated to im + 1, and the value of the next block address nB-m + 1 of the newly created index block im-1 is updated to the null value. I do.

(7) 索引レコード追加ブロック決定手段 索引レコードブロック位置情報更新手段6によるnext
ブロックアドレスの更新の後、索引レコード追加ブロッ
ク決定手段7は、追加する索引レコードを追加対象の索
引ブロックに追加するか新しく作成された索引ブロック
に追加するかを索引値に従って決定する。ここでは、索
引レコードiR−107の索引値107に従って追加先を索引ブ
ロックi−m+1に決定する。
(7) Index record added block determining means Next by index record block position information updating means 6
After updating the block address, the index record added block determining means 7 determines whether to add the index record to be added to the index block to be added or to the newly created index block according to the index value. Here, the addition destination is determined to the index block i-m + 1 according to the index value 107 of the index record iR-107.

(8) 索引レコード追加手段 索引ブロック空き領域判定手段1により追加対象の索
引ブロックに索引レコードを追加できる空き領域がある
と判定された場合、または索引レコード追加ブロック決
定手段7による追加する索引レコードの追加先の索引ブ
ロックの決定の後、索引レコード追加手段8は、追加対
象の索引ブロックまたは索引レコード追加ブロック決定
手段7により決定された索引ブロックに索引レコードを
追加する。ここでは、追加する索引レコードiR−107を
新たに作成された索引ブロックi−m+1に追加する。
(8) Index record adding means When the index block free area determining means 1 determines that there is a free area in which the index record can be added to the index block to be added, or when the index record adding block determining means 7 determines After determining the index block to be added, the index record adding means 8 adds an index record to the index block to be added or the index block determined by the index record additional block determining means 7. Here, the index record iR-107 to be added is added to the newly created index block i-m + 1.

(9) 上位索引レコード更新手段 索引レコード追加手段8による索引レコードの追加の
後、上位索引レコード更新手段9は、追加対象であった
索引ブロックを指す上位索引レコードを更新する。ここ
では、追加対象であった索引ブロックi−mを指す上位
索引レコードiRu−mの索引値101を索引ブロックi−m
内で最小の索引値101に更新する(ただし、この場合
は、実質的な変化はない)。
(9) Upper Index Record Updating Unit After the addition of the index record by the index record adding unit 8, the upper index record updating unit 9 updates the upper index record indicating the index block to be added. Here, the index value 101 of the upper index record iRu-m indicating the index block im to be added is stored in the index block im.
Is updated to the smallest index value 101 in (in this case, there is no substantial change).

(10) 上位索引ブロック更新判定手段 上位索引レコード更新手段9による上位索引レコード
の更新の後、上位索引ブロック更新判定手段10は、上位
索引ブロックの更新の必要性を索引ブロック作成手段2
により新しく索引ブロックを作成したか否かで判定す
る。ここでは、新しく索引ブロックi−m+1を作成し
たことにより、上位索引ブロックiu−1の更新が必要で
あると判定する。
(10) Upper index block update determining means After updating the upper index record by the upper index record updating means 9, the upper index block update determining means 10 determines the necessity of updating the upper index block by the index block creating means 2.
Is determined based on whether or not a new index block is created. Here, it is determined that the upper index block iu-1 needs to be updated because the index block im-1 is newly created.

(11) 上位索引レコード追加手段 上位索引ブロック更新判定手段10により上位索引ブロ
ックiu−1の更新が必要であると判定された場合に、上
位索引レコード追加手段11は、新しく作成された索引ブ
ロック内で最小の索引値と新しく作成された索引ブロッ
クアドレスとを持つ上位索引レコードを上位索引ブロッ
クに追加する。ここでは、新しく作成した索引ブロック
i−m+1内で最小の索引値107と新しく作成した索引
ブロックアドレスi−m+1とを持つ上位索引レコード
iRu−m+1を上位索引ブロックiu−1に追加する。
(11) Upper Index Record Adder If the upper index block update determiner 10 determines that the upper index block iu-1 needs to be updated, the upper index record adder 11 reads the newly created index block. Add the upper index record with the lowest index value and the newly created index block address to the upper index block. Here, the upper index record having the smallest index value 107 and the newly created index block address im-1 in the newly created index block i-m + 1
Add iRu-m + 1 to the upper index block iu-1.

このように、本実施例の索引の分割率変更処理方式
は、従来の索引の更新処理に各階層内で最終索引ブロッ
クを考慮した索引レコードの追加処理を加えたものであ
る。この処理は、各階層内で最大の索引値より大きい索
引値を持つ索引レコードを追加する場合に、最大の索引
値を持つ索引ブロックに50%の空き領域を作らずに、新
しく作成した索引ブロックに追加する索引レコードのみ
を格納していくもので、階層内で最大の索引値より大き
い索引値を持つ索引レコードを昇順に連続して追加して
いくときには、索引ブロック内に空き領域が作られずに
効率よく索引レコードを格納していくことができる。
As described above, the index division ratio change processing method according to the present embodiment is obtained by adding index record addition processing in consideration of the last index block in each hierarchy to the conventional index update processing. This process uses the newly created index block without adding 50% free space to the index block with the largest index value when adding an index record with an index value greater than the largest index value in each hierarchy. Only the index records to be added to the index are stored. When the index records having index values larger than the largest index value in the hierarchy are successively added in ascending order, no free space is created in the index block. Index records can be stored efficiently.

なお、上記実施例では、階層が最下位の索引ブロック
およびその上位索引ブロックの場合を例にとって説明し
たが、上位索引ブロックとさらに上位の索引ブロックと
の間等においても本発明が同様に適用できることはいう
までもない。
In the above embodiment, the case where the hierarchy is the lowest index block and its higher index block has been described as an example. However, the present invention can be similarly applied between an upper index block and a further higher index block. Needless to say.

〔発明の効果〕〔The invention's effect〕

以上説明したように本発明は、各階層内で最大の索引
値より大きい索引値を持つ索引レコードを追加する場合
に、最大の索引値を持つ索引ブロックに50%の空き領域
を作りながらの分割は行わずに、新しく作成した索引ブ
ロックに追加する索引レコードのみを格納していくこと
により、階層内で最大の索引値より大きい索引値を持つ
索引レコードを昇順に連続して追加していくときには、
索引ブロック内に空き領域が作られずに効率よく索引レ
コードを格納していくことができ、無駄な空き領域を持
つ索引ブロックが少なくなって索引が必要とする容量が
小さくなるとともに索引を使った検索処理が速くなると
いう効果がある。
As described above, according to the present invention, when adding an index record having an index value larger than the maximum index value in each hierarchy, the division is performed while creating 50% free space in the index block having the maximum index value. , And store only the index records to be added to the newly created index block, so that index records with index values larger than the largest index value in the hierarchy are successively added in ascending order. ,
Index records can be stored efficiently without creating free space in the index block, and the number of index blocks with useless free space is reduced, reducing the capacity required by the index and searching using the index. This has the effect of speeding up processing.

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

第1図は本発明の一実施例に係る索引の分割率変更処理
方式の構成を示す流れ図、 第2図は本実施例の索引の分割率変更処理方式の動作を
説明するための索引ファイルの一例を示す図、 第3図は本実施例の索引の分割率変更処理方式により第
2図の索引ファイルに索引レコードを追加した後の索引
ファイルを示す図、 第4図は従来の索引の更新処理により第2図の索引ファ
イルに索引レコードを追加した後の索引ファイルを示す
図である。 図において、 1……索引ブロック空き領域判定手段、 2……索引ブロック作成手段、 3……最終索引ブロック判定手段、 4……索引レコード比較判定手段、 5……索引レコード移送手段、 6……ブロック位置情報更新手段、 7……索引レコード追加ブロック決定手段、 8……索引レコード追加手段、 9……上位索引レコード更新手段、 10……上位索引ブロック更新判定手段、 11……上位索引レコード追加手段、 20……索引ブロックである。
FIG. 1 is a flow chart showing the configuration of an index division ratio change processing method according to an embodiment of the present invention, and FIG. 2 is a diagram of an index file for explaining the operation of the index division ratio change processing method of this embodiment. FIG. 3 is a diagram showing an example, FIG. 3 is a diagram showing an index file after an index record is added to the index file of FIG. 2 by the index division ratio change processing method of this embodiment, and FIG. FIG. 3 is a diagram showing an index file after an index record has been added to the index file of FIG. 2 by processing. In the figure, 1 ... index block empty area determination means, 2 ... index block creation means, 3 ... last index block determination means, 4 ... index record comparison determination means, 5 ... index record transfer means, 6 ... Block position information updating means 7 Index record added block determining means 8 Index record adding means 9 Upper index record updating means 10 Upper index block update determining means 11 Upper index record adding Means, 20 ... Index block.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】ランダムアクセス可能な記憶装置にブロッ
ク単位で階層的に構成された索引の更新処理において、 索引値とその値を持つレコード番号との組合せからなる
索引レコードをm(正整数)番の索引ブロックに追加す
る場合にm番の索引ブロックに索引レコードを追加でき
る空き領域があるかどうかを判定する索引ブロック空き
領域判定手段と、 この索引ブロック空き領域判定手段によりm番の索引ブ
ロックに索引レコードを追加できる空き領域がないと判
定された場合に新しくn(正整数)番の索引ブロックの
領域を確保する索引ブロック作成手段と、 m番の索引ブロックの階層内での次の索引ブロックを指
す位置情報に基づいてm番の索引ブロックが階層内での
最終索引ブロックかどうかを判定する最終索引ブロック
判定手段と、 この最終索引ブロック判定手段によりm番の索引ブロッ
クが階層内での最終索引ブロックであると判定された場
合に追加する索引レコードの索引値とm番の索引ブロッ
ク内で最大の索引値とを比較判定する索引レコード比較
判定手段と、 前記最終索引ブロック判定手段によりm番の索引ブロッ
クが階層内での最終索引ブロックでないと判定された場
合および前記索引レコード比較判定手段により追加する
索引レコードの索引値がm番の索引ブロック内で最大の
索引値より小さいと判定された場合にm番の索引ブロッ
クからn番の索引ブロックに索引レコードの50%を移送
する索引レコード移送手段と、 m番の索引ブロックおよびn番の索引ブロックの階層内
での次の索引ブロックを指す位置情報を更新するブロッ
ク位置情報更新手段と、 追加する索引レコードの索引値に従って追加する索引レ
コードをm番の索引ブロックに追加するかn番の索引ブ
ロックに追加するかを決定する索引レコード追加ブロッ
ク決定手段と、 前記索引ブロック空き領域判定手段によりm番の索引ブ
ロックに索引レコードを追加できる空き領域があると判
定された場合にはm番の索引ブロックに、前記索引レコ
ード追加ブロック決定手段により索引レコードを追加す
る索引ブロックが決定された場合には決定された索引ブ
ロックに索引レコードを追加する索引レコード追加手段
と、 m番の索引ブロックを指す上位索引レコードを更新する
上位索引レコード更新手段と、 上位索引ブロックの更新の必要性を前記索引ブロック作
成手段によりn番の索引ブロックを作成したか否かで判
定する上位索引ブロック更新判定手段と、 この上位索引ブロック更新判定手段により上位索引ブロ
ックの更新が必要であると判定された場合にn番の索引
ブロック内で最小の索引値とn番の索引ブロックを指す
位置情報とからなる上位索引レコードを上位索引ブロッ
クに追加する上位索引レコード追加手段と を有することを特徴とする索引の分割率変更処理方式。
In an update process of an index hierarchically constructed in a block unit on a randomly accessible storage device, an index record composed of a combination of an index value and a record number having the value is assigned an m (positive integer) number. Index block free area determining means for determining whether or not there is a free area in which an index record can be added to the m-th index block when adding to the m-th index block; An index block creating means for securing a new n (positive integer) index block area when it is determined that there is no free area to which an index record can be added; and a next index block in the hierarchy of the mth index block Last index block determining means for determining whether the m-th index block is the last index block in the hierarchy based on the position information indicating When the last index block determining means determines that the mth index block is the last index block in the hierarchy, the index value of the index record to be added is compared with the largest index value in the mth index block. An index record comparison / judgment means to be judged; and an index value of an index record added by the index record comparison / judgment means when the last index block judgment means judges that the m-th index block is not the last index block in the hierarchy. Index record transfer means for transferring 50% of the index records from the mth index block to the nth index block when it is determined that is smaller than the largest index value in the mth index block; Block position information updating means for updating position information indicating the next index block in the hierarchy of the block and the n-th index block; Index record additional block determining means for determining whether to add an index record to be added to the m-th index block or the n-th index block in accordance with the index value of the index record to be added; If it is determined that there is a free space in the m-th index block where an index record can be added, the index record adding block determining means determines the index block to which an index record is to be added in the m-th index block. Means for adding an index record to the determined index block, means for updating an upper index record pointing to the m-th index block, means for updating an upper index record, and means for updating the upper index block. A higher-order index block that is determined based on whether or not the n-th index block has been created by the creating means. And a position information indicating the smallest index value and the n-th index block in the n-th index block when the upper-index block update determining unit determines that the upper-index block needs to be updated. And a higher-order index record adding means for adding a higher-order index record consisting of the following to a higher-order index block.
JP2224961A 1990-08-27 1990-08-27 Index division rate change processing method Expired - Lifetime JP2613961B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2224961A JP2613961B2 (en) 1990-08-27 1990-08-27 Index division rate change processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2224961A JP2613961B2 (en) 1990-08-27 1990-08-27 Index division rate change processing method

Publications (2)

Publication Number Publication Date
JPH04106641A JPH04106641A (en) 1992-04-08
JP2613961B2 true JP2613961B2 (en) 1997-05-28

Family

ID=16821918

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2224961A Expired - Lifetime JP2613961B2 (en) 1990-08-27 1990-08-27 Index division rate change processing method

Country Status (1)

Country Link
JP (1) JP2613961B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0567668A1 (en) * 1992-04-27 1993-11-03 International Business Machines Corporation A computer system for retrieval of information
JP5372131B2 (en) * 2011-12-27 2013-12-18 株式会社日立製作所 Index processing method and computer system
JP6073567B2 (en) * 2012-04-18 2017-02-01 東芝メディカルシステムズ株式会社 Medical information recording apparatus and medical information recording method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
「bit 別冊コンピュータ・サイエンス」(1980−11)共立出版、P.21〜39
山谷正己著「図解コンピュータシリーズ ファイル編成入門」(昭和55年7月)オーム社

Also Published As

Publication number Publication date
JPH04106641A (en) 1992-04-08

Similar Documents

Publication Publication Date Title
JP3510042B2 (en) Database management method and system
JP2000112814A (en) Method and device for allocating memory
CN107180031B (en) Distributed storage method and device, and data processing method and device
CN103765381A (en) Parallel operation on B+ trees
CN107783988A (en) The locking method and equipment of a kind of directory tree
US6745198B1 (en) Parallel spatial join index
CN111209106B (en) Flow chart dividing method and system based on caching mechanism
JP2009512950A (en) Architecture and method for efficiently bulk loading Patricia Tri
KR100806115B1 (en) Design method of query classification component in multi-level dbms
CN106383826A (en) Database checking method and apparatus
JP5790755B2 (en) Database management apparatus and database management method
JP2613961B2 (en) Index division rate change processing method
US20170091244A1 (en) Searching a Data Structure
US20070022269A1 (en) Storage space management methods and systems
WO2015129109A1 (en) Index management device
US7577673B2 (en) Organising data in a database
CN115599541A (en) Sorting device and method
JP2008065716A (en) Device, method and program for data management
CN110659286A (en) Dynamic space index method based on weak balance space tree and storage medium and device thereof
CN109582744A (en) A kind of user satisfaction methods of marking and device
CN106777131A (en) A kind of querying method of High dimensional space data, device and computer-readable medium
JPH10134084A (en) Data processor
JPS61253530A (en) Control system for idle area of external memory
JPH0573381A (en) Update processing system for index
CN112965665A (en) GP database data storage method based on SAS and SSD

Legal Events

Date Code Title Description
R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20080227

Year of fee payment: 11

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

Free format text: PAYMENT UNTIL: 20090227

Year of fee payment: 12

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

Free format text: PAYMENT UNTIL: 20100227

Year of fee payment: 13

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

Free format text: PAYMENT UNTIL: 20100227

Year of fee payment: 13

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

Free format text: PAYMENT UNTIL: 20110227

Year of fee payment: 14

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110227

Year of fee payment: 14