JP3622443B2 - T-tree index construction method and apparatus, and storage medium storing T-tree index construction program - Google Patents

T-tree index construction method and apparatus, and storage medium storing T-tree index construction program Download PDF

Info

Publication number
JP3622443B2
JP3622443B2 JP25723997A JP25723997A JP3622443B2 JP 3622443 B2 JP3622443 B2 JP 3622443B2 JP 25723997 A JP25723997 A JP 25723997A JP 25723997 A JP25723997 A JP 25723997A JP 3622443 B2 JP3622443 B2 JP 3622443B2
Authority
JP
Japan
Prior art keywords
key
tree
tree index
storage area
key value
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
Application number
JP25723997A
Other languages
Japanese (ja)
Other versions
JPH1196058A (en
Inventor
敏 岡田
淳一 黒岩
昌義 梅田
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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP25723997A priority Critical patent/JP3622443B2/en
Publication of JPH1196058A publication Critical patent/JPH1196058A/en
Application granted granted Critical
Publication of JP3622443B2 publication Critical patent/JP3622443B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、T木インッデックス構築方法及び装置及びT木インデックス構築プログラムを格納した記憶媒体に係り、特に、データベースをメモリ上に常駐させることで高速なデータアクセスを実現する、メモリ常駐データベース管理システム等におけるT木インデックスの構築方法及び装置及びT木インデックス構築プログラムを格納した記憶媒体に関する。
【0002】
【従来の技術】
図8は、従来のT木インデックスの構成を示す。同図に示すように、従来のT木インデックス10は、T木インデックスの構成要素であるノード111と当該ノード111の間をつなぐノード間ポインタ113から成り立っている。各ノード111は、キー値121と当該キー値121に対応するテーブル20内のレコード202の位置を指すポインタ116を1組とするノード内要素112を含んでいる。ノード内要素112の数は、インデックス作成時に決定する同定値である。
【0003】
レコード202検索時には、ノード間ポインタ113を使用し、各ノード111間を移動することにより、アプリケーションの指定した検索条件に合致するキー値121を検索する。
次に、キー値121と組になっているレコード202間のポインタ116を参照し、ポインタ116の指している目的のレコード202へアクセスする。
【0004】
図9は、従来のT木インデックスにおけるノード構成を示す。
インデックスサイズの観点から見た場合、同図に示すように、CLM1とCLM2の2カラムでキー値121を構成する場合と、CLM1のみでキー値121を構成する場合とでは、ノード111のサイズが異なっている。これは、各ノード111の内部にキー値121を直接埋め込んでいるためであり、キー値121を構成するカラム201の数、長さによりノード111のサイズが変化し、ノード111のサイズは、T木インデックス10毎に決まる。全てのノード内要素112にキー値121が挿入されていない場合には、その領域は空き115として管理される。
【0005】
図10は、従来のT木インデックスにおける重複キーの増加を示す。同図はT木インデックス10における重複キー133の扱いについて示している。重複キー133であるKEY3は、直接ノード111の内部に埋め込まれている。このとき、KEY3が更に挿入され、KEY3の数が2から3に増加することによって、Tインデックス10で扱うキー値121の数及び段数が増加する。このように、1つのキー値に対応するレコード数を表す重複度により検索時に参照対象となるキー121の数が変化し、場合によっては、T木インデックス10の段数が変化する可能性がある。
【0006】
図11は、従来のT木インデックスにおけるキー値の挿入を示す。同図は、T木インデックス10へのキー値121の挿入例を示している。T木インデックス10にKEY6が挿入されたとき、KEY5,KEY6,KEY7の順序性を保持するものであれば、KEY4,KEY5が移動し、KEY6を挿入する領域を確保した後、KEY6の挿入が行われる。このように、T木インデックス10にキー値121が挿入された場合には、キー値121の移動が生じる可能性がある。
【0007】
図12は、従来のT木インデックスにおけるキー値の削除を示す。同図は、挿入時と同様に、従来のT木インデックス10からのキー値121の削除を示している。T木インデックス10からKEY6が削除されたとき、KEY5,KEY7,KEY8の順序性を保持するのであれば、KEY7,KEY8の移動が行われる。このように、T木インデックス10からキー値121を削除する場合にもキー値121の移動が生じる可能性がある。
【0008】
図13は、従来のT木インデックスのバックアップを示す。同図は、T木インデックス10のバックアップ30を取得している状態を示している。メモリ上に展開されたT木インデックス10のバックアップ30は、ディスク上に取得される。その内容は、T木インデックス10のノード間の階層構造の情報、キー値121等のT木インデックス10を構成する全ての情報である。
【0009】
【発明が解決しようとする課題】
しかしながら、上記従来は、T木の各ノードの内部にキー値(重複キーを含む)を埋め込んでいたため、以下のような問題がある。
1.キーを構成するカラムの数、長さによって、ノードのサイズが変化するため、T木インデックスの構築がキー構成に影響され、T木インデックスの構築が複雑となり、構築に時間がかかる。
【0010】
2.ノード内要素数は固定であるため、キー値のサイズが大きく、空きとして管理される領域が多い場合には、T木インデックスとして使用するメモリ量が増加する。
3.キーの挿入/削除時にキー値の移動が生じるため、レコードの挿入/削除の処理速度が遅い。
【0011】
4.重複キーの重複度が増加するにつれて検索対象となるキーの数が増加し、多くのキー値との比較を行わなくてはならないため検索時の処理速度が悪化する。
5.インデックスに含まれる全ての情報についてバックアップを取得しているため、バックアップに要する時間が長い。
【0012】
本発明は、上記の点に鑑みなされたもので、T木インデックス構築時間短縮、メモリ使用量削減、キー挿入/削除時の処理速度の向上、キーの重複時の検索速度の向上及びバックアップ時間の短縮を可能とするT木インッデックス構築方法及び装置及びT木インデックス構築プログラムを格納した記憶媒体を提供することを目的とする。
【0013】
【課題を解決するための手段】
本発明は、データベースをメモリ上に常駐させ、高速なデータアクセスを実現するデータベース管理システムで使用するT木インデックスを構築するT木インデックス構築方法において、
T木インデックスを該T木インデックスの階層構造の情報を有するノードからなるT木本体、検索時に条件比較を行うキー値情報、一つキーに対して複数のレコードが対応する重複キー情報の3つの領域に分けて管理し、
T木インデックスのノード情報をキーを構成するカラム数、長さ及びキーの重複とは独立に構築し、
分割した3つの領域の中でT木本体を構成するノードのみを、ディスク上にバックアップを取得する。
【0014】
図1は、本発明の原理構成図である。
本発明は、データベースをメモリ上に常駐させ、高速なデータアクセスを実現するデータベース管理システムで使用するT木インデックスを構築するT木インデックス構築装置において、
T木インデックスを該T木インデックスの階層構造の情報を有するノードからなるT木本体を格納するT木本体格納領域100と、
検索時に条件比較を行うキー値情報を格納するキー値格納領域200と、
一つキーに対して複数のレコードが対応する重複キー情報を格納する重複キー格納領域300と、
T木本体格納領域100、キー値格納領域200及び重複キー格納領域300の3つの領域を管理する管理手段400とを有する。
【0015】
上記のT木本体格納領域100は、T木インデックスのノード情報をキーを構成するカラム数、長さ及びキーの重複とは独立に構築する。
上記の管理手段400は、分割したT木本体格納領域100、キー値格納領域200及び重複キー格納領域300の3つの領域の中でT木本体を構成するノードのみを、ディスク上にバックアップを取得するバックアップ取得手段410を含む。
【0016】
上記のT木本体格納領域100に格納されるノードは、ノード内要素にキー値格納領域内に格納されているキー値の位置を指すポインタを含む。
上記のキー値格納領域200に格納されるキー値は、1つのキーに対して1つのレコードが対応している場合には、各キー値に対応するレコードの位置を指すポインタを保持し、
1つのキーに対して複数のレコードが対応している場合には、重複キー格納領域のポインタの集合内の一つの要素を指すポインタを保持する。
【0017】
上記の重複キー格納領域300に格納される重複キー情報は、重複キーに対応するレコードの位置を指すポインタを有する。
上記の管理手段400は、T木本体格納領域、キー値格納領域及び重複キー格納領域内の要素をポインタで結合する手段を含む。
本発明は、データベースをメモリ上に常駐させ、高速なデータアクセスを実現するデータベース管理システムで使用するT木インデックスを構築するT木インデックス構築プログラムを格納した記憶媒体であって、
T木インデックスを該T木インデックスの階層構造の情報を有するノードからなるT木本体、検索時に条件比較を行うキー値情報、一つキーに対して複数のレコードが対応する重複キー情報の3つの領域に分けて管理する管理プロセスを有し、
管理プロセスは、
T木インデックスのノード情報をキーを構成するカラム数、長さ及びキーの重複とは独立に構築し、分割した3つの領域の中でT木本体を構成するノードのみを、ディスク上にバックアップを取得するプロセスを有する。
【0018】
上記のように、本発明は、T木インデックスを以下の3領域に分割して格納する各領域内の要素をポインタで結合することにより、データへのアクセスを可能とする。
T木本体については、T木インデックスの各ノードを格納し、ノード間の階層構造の情報を保持する。
【0019】
また、キー値格納領域については、キー値のみを格納し、管理する。
さらに、重複キー格納領域については、重複キーのみを管理する。
バックアップについては、T木本体のみを取得する。
これにより、従来の方式に比較して以下が可能となる。
1.キーを構成するカラムの数、長さとは独立にT木インデックスのノードの作成、ノード間の階層構造が構築できるため、インデックス構築の処理速度が向上する。
【0020】
2.ノード内にキー値を埋め込まず、キー値を格納する領域は必要最小限に抑えることができるため、T木インデックス全体のメモリの使用量を少なくできる。
3.キー値の挿入/削除における、T木インデックスの成長/衰退がノード間のキー値の移動を伴わないで実施でき、キー値の挿入/削除時の処理速度が向上する。
【0021】
4.重複キーを扱う場合に重複キーの重複度とは独立にT木インデックスの階層構造が構築でき、T木インデックスの検索時の処理速度が向上する。
5.バックアップのデータ量を削減でき、バックアップ取得に要する時間を短縮できる。
【0022】
【発明の実施の形態】
図2は、本発明のT木インデックスの構成を示す。
同図は、本発明の構築方式を使用したT木インデックス10における各領域の相関関係を示している。分割している各領域の内容は、以下の通りである。
1.T木本体領域11:
T木インデックス10構築のために必要なノード111を格納する領域である。各ノード111のノード内要素112は、キー値格納領域12内に格納されているキー値の121の位置を指すポインタ114を保持している。
【0023】
2.キー値格納領域12:
検索時に使用するキー値121を格納する領域である。1つのキーに対して1レコードのみが対応している場合には、各キー値121は、キー値121に対応するレコード202の位置を指すポインタ122を保持している。1つのキーに対して複数のレコード202が対応する重複キーを扱う場合には、各キー値121は、重複キー格納領域13内のポインタ132の集合131内の一つの要素を指すポインタ123を保持している。格納しているキー値121の並びには制限はない。
【0024】
3.重複キー格納領域13:
この領域は、重複キーを扱う場合にのみ作成される。重複キーに対応するレコード202の位置を指すポインタ132を管理している領域である。
図3は、本発明のT木インデックスのノードとキー値の構成を示す。
同図は、キー値121を構成するカラム201とT木インデックス10の関係を例示している。CLM1とCLM2の2つカラムでキー値121を構成する場合と、CLM1のみでキー値121を構成する場合のT本本体11の各ノード111のサイズはどちらも同一となる。そのため、新しいノードの作成時、1つのテーブルに複数のインデックスを張る場合等に、インデックスを構築する全てのノードが同じサイズとなり、T木インデックス10の設計及び構築が簡易になる。
【0025】
また、各ノード111の要素112内でキー値121へのポインタ114を格納していない空き115が生じてもこの空き115に対応するキー値121の領域は、キー値格納領域12内に確保しないため、T木インデックス10としてのメモリの使用量を少なく抑えることができる。
【0026】
【実施例】
以下、図面と共に、本発明の実施例を説明する。
前述の図2、図3の構成に基づいて以下の実施例を説明する。
図4は、本発明の一実施例の重複キーの増加を示す。同図は、重複キー133の重複度とT木本体11の関係を例示している。テーブルへのレコードの追加によりKEY3の重複度が2から3に増加した場合には、KEY3のポインタ123が指している重複キー格納領域13内のポインタの集合131に挿入されたレコードの位置を指すポインタ132を追加する。
【0027】
T木本体11、キー値格納領域12は重要度が増加しても構成は変わらない。そのため、重複キーによるキー値121検索の処理速度の低下を防ぐことができ、重複のないキー値121に対する検索の処理速度が向上する。
図5は、本発明の一実施例のキー値の挿入を示す。同図は、T木インデックス10にキー値121を挿入する方法を例示している。T木インデックス10にKEY6を挿入する例を以下に示す。
【0028】
1.KEY6をキー値格納領域12に挿入する。
2.T木本体11のノード111内でKEY6を指すポインタ114を挿入する位置を見つける。キーの順序性より、KEY5,KEY6,KEY7の順序となるように挿入するため、ポインタPt5とポインタPt7の間にKEY6を指すポインタPt6を挿入する。このとき、ポインタPt6を挿入するための領域がないため、ポインタPt4,ポインタPt5についてポインタの張り替えを行い、ポインタPt6を挿入する領域を確保する。
【0029】
3.KEY6を指すポインタPt6を挿入する。
図6は、本発明の一実施例のキー値の削除を示す。同図は、T木インデックス10からキー値121を削除する方法を例示している。T木インデックス10からKEY6を削除する例を以下に示す。
1.KEY6を指すポインタ114Pt6を検索する。
【0030】
2.キー値格納領域12からKEY6を削除する。
3.ポインタPt6をノード111から削除する。
4.ポインタPt6を削除した領域が空き115となり、順序性が保てなくなるため、ポインタPt7、ポインタPt8についてポインタ114の張り替えを行う。
【0031】
図7は、本発明の一実施例のバックアップを示す。同図は、バックアップ30を例示している。T木インデックス10を構成するT木本体11、キー値格納領域12、重複キー格納領域13の3領域のうち、バックアップ30をディスク上に取得するのは、T木本体11のみとする。バックアップ30をT木本体11のみとすることで、バックアップ30のデータ量を削減でき、通常運用の処理速度に影響を与えるバックアップ取得時のディスクへの書込み時間を短縮することができる。
【0032】
障害からのリカバリ時には、T木本体11のバックアップ30をディスクからメモリ上にロードする。次に、データベース内のテーブル20のバックアップを参照して、キー値121を取り出し、T木本体11の各ノード111の各要素112とポインタ114で結合することで、キー値格納領域12、重複キー格納領域13を作成し、レコード202へのアクセスが可能な状態とする。
【0033】
また、本発明は、上記において、T木インデックスを該T木インデックスの階層構造の情報を有するノードからなるT木本体、検索時に条件比較を行うキー値情報、一つキーに対して複数のレコードが対応する重複キー情報の3つの領域に分けて管理し、T木インデックスのノード情報をキーを構成するカラム数、長さ及びキーの重複とは独立に構築し、分割した3つの領域の中でT木本体を構成するノードのみを、ディスク上にバックアップを取得する処理をプログラムとして構築し、ディスク装置や、フロッピーディスク、CD−ROM等の可搬記憶媒体に格納し、データベースをメモリ上に常駐させる場合に利用することにより汎用的に利用することが可能である。
【0034】
なお、本発明は、上記の実施例に限定されることなく、特許請求の範囲内で種々変更・応用が可能である。
【0035】
【発明の効果】
上述のように、本発明によれば、メモリ常駐データベース管理システムのT木インデックスにおいて、キー値を構成するカラムの数、長さとは独立にT木本体を構成でき、T木の成長、衰退時に、ノード間でキー値を移動することなく、ポインタの張り替えのみで対応できるため、T木の構築が高速化される。
【0036】
また、キー値を格納する領域を最小限に抑えることができるため、メモリ使用量が削減できる。重複キーを扱う場合にもキー値は一つであるため、重複度が高いデータでも効率良く検索できる。
さらに、バックアップについては、T木本体のみであるため、バックアップに要する時間が削減できる。
【図面の簡単な説明】
【図1】本発明の原理を説明するための図である。
【図2】本発明のT木インデックスの構成図である。
【図3】本発明のT木インデックスのノードとキー値の構成図である。
【図4】本発明の一実施例の重複キーの増加を示す図である。
【図5】本発明の一実施例のキー値の挿入を示す図である。
【図6】本発明の一実施例のキー値の削除を示す図である。
【図7】本発明の一実施例のバックアップを示す図である。
【図8】従来のT木インデックスの構成図である。
【図9】従来のT木インデックスにおけるノード構成図である。
【図10】従来のT木インデックスにおける重複キーの増加を示す図である。
【図11】従来のT木インデックスにおけるキー値の挿入を示す図である。
【図12】従来のT木インデックスにおけるキー値の削除を示す図である。
【図13】従来のT木インデックスのバックアップを示す図である。
【符号の説明】
10 T木インデックス
11 T木本体
12 キー値格納領域
13 重複キー格納領域
20 テーブル
100 T木本体格納領域
111 ノード
112 ノード内要素
113 ノード間ポインタ
114 ノード内要素とキー値間ポインタ
115 空き
116 ノード内要素とレコード間ポインタ
121 キー値
122 キー値とレコード間ポインタ
123 キー値と重複キーポインタ集合間ポインタ
131 重複キーポインタ集合内要素とレコード間ポインタ
132 重複キーポインタ集合内要素とレコード間ポインタ
133 重複キー
200 キー値格納領域
300 重複キー格納領域
400 管理手段
410 バックアップ取得手段
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a T-tree index construction method and apparatus and a storage medium storing a T-tree index construction program, and in particular, a memory resident database management system that realizes high-speed data access by making a database resident in a memory. The present invention relates to a T-tree index construction method and apparatus and a storage medium storing a T-tree index construction program.
[0002]
[Prior art]
FIG. 8 shows the structure of a conventional T-tree index. As shown in the figure, the conventional T-tree index 10 includes a node 111 that is a component of the T-tree index and an inter-node pointer 113 that connects between the nodes 111. Each node 111 includes an in-node element 112 that includes a key value 121 and a pointer 116 that points to the position of the record 202 in the table 20 corresponding to the key value 121. The number of in-node elements 112 is an identification value determined at the time of index creation.
[0003]
When searching for the record 202, the key value 121 that matches the search condition designated by the application is searched by using the inter-node pointer 113 and moving between the nodes 111.
Next, the pointer 116 between the records 202 paired with the key value 121 is referred to, and the target record 202 pointed to by the pointer 116 is accessed.
[0004]
FIG. 9 shows a node configuration in a conventional T-tree index.
From the viewpoint of index size, as shown in the figure, when the key value 121 is composed of two columns CLM1 and CLM2, and when the key value 121 is composed only of CLM1, the size of the node 111 is Is different. This is because the key value 121 is directly embedded in each node 111. The size of the node 111 changes depending on the number and length of the columns 201 constituting the key value 121. The size of the node 111 is T Determined for each tree index 10. When the key value 121 is not inserted in all the in-node elements 112, the area is managed as a vacant 115.
[0005]
FIG. 10 shows an increase in duplicate keys in a conventional T-tree index. This figure shows the handling of the duplicate key 133 in the T-tree index 10. KEY3 which is the duplicate key 133 is directly embedded in the node 111. At this time, KEY3 is further inserted, and the number of KEY3 is increased from 2 to 3, whereby the number of key values 121 handled by the T index 10 and the number of stages are increased. As described above, the number of keys 121 to be referred to at the time of search changes depending on the degree of duplication representing the number of records corresponding to one key value, and in some cases, the number of stages of the T-tree index 10 may change.
[0006]
FIG. 11 shows the insertion of key values in a conventional T-tree index. The figure shows an example of inserting the key value 121 into the T-tree index 10. If KEY6 is inserted into T-tree index 10 and the order of KEY5, KEY6, and KEY7 is maintained, KEY4 and KEY5 move, and after KEY6 is inserted, KEY6 is inserted. Is called. Thus, when the key value 121 is inserted into the T-tree index 10, the key value 121 may move.
[0007]
FIG. 12 shows the deletion of the key value in the conventional T-tree index. This figure shows the deletion of the key value 121 from the conventional T-tree index 10 as in the case of insertion. When KEY6 is deleted from the T-tree index 10, if the order of KEY5, KEY7, and KEY8 is maintained, KEY7 and KEY8 are moved. As described above, even when the key value 121 is deleted from the T-tree index 10, the key value 121 may move.
[0008]
FIG. 13 shows a conventional T-tree index backup. The figure shows a state in which a backup 30 of the T-tree index 10 is acquired. A backup 30 of the T-tree index 10 expanded on the memory is acquired on the disk. The contents are information on the hierarchical structure between the nodes of the T-tree index 10 and all information constituting the T-tree index 10 such as the key value 121.
[0009]
[Problems to be solved by the invention]
However, since the above conventional technique embeds key values (including duplicate keys) inside each node of the T-tree, there are the following problems.
1. Since the size of the node changes depending on the number and length of columns constituting the key, the construction of the T-tree index is affected by the key construction, and the construction of the T-tree index becomes complicated, which takes time.
[0010]
2. Since the number of elements in the node is fixed, the amount of memory used as the T-tree index increases when the size of the key value is large and there are many areas managed as empty.
3. Since the key value is moved during key insertion / deletion, the processing speed of record insertion / deletion is slow.
[0011]
4). As the degree of duplication of duplicate keys increases, the number of keys to be searched increases, and comparison with many key values must be performed, so that the processing speed at the time of search deteriorates.
5. Since the backup is acquired for all information included in the index, the time required for the backup is long.
[0012]
The present invention has been made in view of the above points. The T-tree index construction time is shortened, the memory usage is reduced, the processing speed at the time of key insertion / deletion is improved, the search speed at the time of key duplication is improved, and the backup time is reduced. It is an object of the present invention to provide a T-tree index construction method and apparatus capable of shortening and a storage medium storing a T-tree index construction program.
[0013]
[Means for Solving the Problems]
The present invention relates to a T-tree index construction method for constructing a T-tree index used in a database management system that makes a database resident in a memory and realizes high-speed data access.
The T-tree index is a T-tree body consisting of nodes having information on the hierarchical structure of the T-tree index, key value information for comparing conditions at the time of search, and duplicate key information corresponding to a plurality of records for one key. Divided into areas,
The node information of the T-tree index is constructed independently of the number of columns constituting the key, the length, and the key duplication,
Only the nodes constituting the T-tree body in the three divided areas are backed up on the disk.
[0014]
FIG. 1 is a principle configuration diagram of the present invention.
The present invention relates to a T-tree index construction apparatus for constructing a T-tree index used in a database management system that makes a database resident in a memory and realizes high-speed data access.
A T-tree main body storage area 100 for storing a T-tree main body composed of nodes having information on the hierarchical structure of the T-tree index.
A key value storage area 200 for storing key value information for performing condition comparison at the time of retrieval;
A duplicate key storage area 300 for storing duplicate key information corresponding to a plurality of records for one key;
And a management unit 400 that manages three areas: a T-tree main body storage area 100, a key value storage area 200, and a duplicate key storage area 300.
[0015]
In the T-tree main body storage area 100, the node information of the T-tree index is constructed independently of the number of columns constituting the key, the length, and key duplication.
The management unit 400 obtains a backup on the disk of only the nodes constituting the T-tree body among the three areas of the divided T-tree body storage area 100, the key value storage area 200, and the duplicate key storage area 300. Backup acquisition means 410 to be included.
[0016]
The node stored in the T-tree main body storage area 100 includes a pointer indicating the position of the key value stored in the key value storage area in the node element.
When one record corresponds to one key, the key value stored in the key value storage area 200 holds a pointer indicating the position of the record corresponding to each key value,
When a plurality of records correspond to one key, a pointer pointing to one element in the set of pointers in the duplicate key storage area is held.
[0017]
The duplicate key information stored in the duplicate key storage area 300 has a pointer that points to the position of the record corresponding to the duplicate key.
The management means 400 includes means for combining elements in the T-tree main body storage area, the key value storage area, and the duplicate key storage area with a pointer.
The present invention is a storage medium storing a T-tree index construction program for constructing a T-tree index used in a database management system that makes a database resident in a memory and realizes high-speed data access.
The T-tree index is a T-tree body consisting of nodes having information on the hierarchical structure of the T-tree index, key value information for comparing conditions at the time of search, and duplicate key information corresponding to a plurality of records for one key. It has a management process to manage by dividing into areas,
The management process is
The node information of the T-tree index is constructed independently of the number of columns that make up the key, the length, and the key duplication, and only the nodes that make up the T-tree itself are backed up on the disk in the three divided areas. Have a process to get.
[0018]
As described above, the present invention makes it possible to access data by combining, with a pointer, elements in each area where the T-tree index is divided into the following three areas and stored.
For the T-tree body, each node of the T-tree index is stored and information on the hierarchical structure between the nodes is held.
[0019]
The key value storage area stores and manages only the key value.
Further, only the duplicate key is managed for the duplicate key storage area.
For backup, only the T-tree itself is acquired.
Thereby, the following becomes possible compared with the conventional system.
1. Since the creation of a T-tree index node and the construction of a hierarchical structure between nodes can be established independently of the number and length of columns constituting the key, the processing speed of index construction is improved.
[0020]
2. Since the key value is not embedded in the node and the area for storing the key value can be minimized, the memory usage of the entire T-tree index can be reduced.
3. In the insertion / deletion of key values, the growth / decay of the T-tree index can be performed without moving the key values between nodes, and the processing speed at the time of insertion / deletion of key values is improved.
[0021]
4). When handling duplicate keys, the hierarchical structure of the T-tree index can be constructed independently of the degree of duplication of the duplicate keys, and the processing speed when searching for the T-tree index is improved.
5. The amount of backup data can be reduced, and the time required for backup acquisition can be reduced.
[0022]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 2 shows the structure of the T-tree index of the present invention.
This figure shows the correlation of each region in the T-tree index 10 using the construction method of the present invention. The contents of each divided area are as follows.
1. T-tree body area 11:
This is an area for storing the nodes 111 necessary for constructing the T-tree index 10. The in-node element 112 of each node 111 holds a pointer 114 indicating the position of the key value 121 stored in the key value storage area 12.
[0023]
2. Key value storage area 12:
This is an area for storing a key value 121 used at the time of retrieval. When only one record corresponds to one key, each key value 121 holds a pointer 122 that points to the position of the record 202 corresponding to the key value 121. When a duplicate key corresponding to a plurality of records 202 for one key is handled, each key value 121 holds a pointer 123 that points to one element in a set 131 of pointers 132 in the duplicate key storage area 13. doing. The arrangement of the stored key values 121 is not limited.
[0024]
3. Duplicate key storage area 13:
This area is created only when dealing with duplicate keys. This is an area for managing a pointer 132 that points to the position of the record 202 corresponding to the duplicate key.
FIG. 3 shows the structure of the nodes and key values of the T-tree index of the present invention.
The figure illustrates the relationship between the column 201 constituting the key value 121 and the T-tree index 10. When the key value 121 is composed of two columns CLM1 and CLM2, and when the key value 121 is composed of only CLM1, the size of each node 111 of the T main body 11 is the same. Therefore, when a new node is created, when a plurality of indexes are set on one table, all the nodes that construct the index have the same size, and the design and construction of the T-tree index 10 is simplified.
[0025]
In addition, even if an empty space 115 in which the pointer 114 to the key value 121 is not stored in the element 112 of each node 111, the area of the key value 121 corresponding to the empty space 115 is not secured in the key value storage area 12. Therefore, the amount of memory used as the T-tree index 10 can be reduced.
[0026]
【Example】
Embodiments of the present invention will be described below with reference to the drawings.
The following embodiment will be described based on the configuration shown in FIGS.
FIG. 4 illustrates the increase of duplicate keys in one embodiment of the present invention. The figure illustrates the relationship between the duplication degree of the duplication key 133 and the T-tree main body 11. If the KEY3 duplication degree is increased from 2 to 3 by adding a record to the table, it indicates the position of the record inserted in the pointer set 131 in the duplicate key storage area 13 pointed to by the pointer 123 of the KEY3. A pointer 132 is added.
[0027]
The structure of the T-tree main body 11 and the key value storage area 12 does not change even when the importance increases. Therefore, it is possible to prevent a decrease in the processing speed of the key value 121 search due to the duplicate key, and the search processing speed for the key value 121 having no duplication is improved.
FIG. 5 illustrates the insertion of key values in one embodiment of the present invention. This figure illustrates a method for inserting a key value 121 into the T-tree index 10. An example in which KEY6 is inserted into the T-tree index 10 is shown below.
[0028]
1. KEY 6 is inserted into the key value storage area 12.
2. The position where the pointer 114 pointing to KEY 6 is inserted is found in the node 111 of the T-tree body 11. Since the keys are inserted in order of KEY5, KEY6, and KEY7, a pointer Pt6 indicating KEY6 is inserted between the pointers Pt5 and Pt7. At this time, since there is no area for inserting the pointer Pt6, the pointers are replaced for the pointers Pt4 and Pt5, and an area for inserting the pointer Pt6 is secured.
[0029]
3. A pointer Pt6 pointing to KEY6 is inserted.
FIG. 6 illustrates the deletion of the key value according to one embodiment of the present invention. The figure illustrates a method for deleting the key value 121 from the T-tree index 10. An example of deleting KEY6 from the T-tree index 10 is shown below.
1. A pointer 114Pt6 pointing to KEY6 is searched.
[0030]
2. KEY 6 is deleted from the key value storage area 12.
3. The pointer Pt6 is deleted from the node 111.
4). Since the area from which the pointer Pt6 has been deleted becomes empty 115 and the order cannot be maintained, the pointer 114 is replaced with respect to the pointer Pt7 and the pointer Pt8.
[0031]
FIG. 7 shows a backup of one embodiment of the present invention. The figure illustrates the backup 30. Of the three areas of the T-tree main body 11, the key value storage area 12, and the duplicate key storage area 13 constituting the T-tree index 10, only the T-tree main body 11 acquires the backup 30 on the disk. By using only the T-tree body 11 as the backup 30, the data amount of the backup 30 can be reduced, and the write time to the disk at the time of backup acquisition that affects the processing speed of normal operation can be shortened.
[0032]
When recovering from a failure, the backup 30 of the T-tree main body 11 is loaded from the disk onto the memory. Next, the key value 121 is retrieved with reference to the backup of the table 20 in the database, and is combined with each element 112 of each node 111 of the T-tree main body 11 by the pointer 114, whereby the key value storage area 12, duplicate key The storage area 13 is created and the record 202 can be accessed.
[0033]
In the above, the present invention provides a T-tree index, a T-tree body composed of nodes having information on the hierarchical structure of the T-tree index, key value information for performing condition comparison at the time of search, a plurality of records for one key Is divided into three areas of the corresponding duplicate key information, and the node information of the T-tree index is constructed independently of the number of columns constituting the key, the length, and the duplication of the key. Only the nodes that make up the T-tree itself are built as a program to obtain a backup on the disk and stored in a portable storage medium such as a disk device, floppy disk, or CD-ROM, and the database is stored in the memory. It can be used for general purposes by making it resident.
[0034]
The present invention is not limited to the above-described embodiments, and various modifications and applications can be made within the scope of the claims.
[0035]
【The invention's effect】
As described above, according to the present invention, in the T-tree index of the memory resident database management system, the T-tree body can be configured independently of the number and length of columns constituting the key value. The T-tree can be constructed at high speed because it can be handled only by changing the pointer without moving the key value between nodes.
[0036]
In addition, since the area for storing the key value can be minimized, the memory usage can be reduced. Even when a duplicate key is handled, since the key value is one, even data with a high degree of duplicate can be searched efficiently.
Furthermore, since only the T-tree body is used for backup, the time required for backup can be reduced.
[Brief description of the drawings]
FIG. 1 is a diagram for explaining the principle of the present invention.
FIG. 2 is a configuration diagram of a T-tree index according to the present invention.
FIG. 3 is a configuration diagram of nodes and key values of a T-tree index according to the present invention.
FIG. 4 is a diagram illustrating an increase in duplicate keys according to an embodiment of the present invention.
FIG. 5 is a diagram illustrating insertion of a key value according to an embodiment of the present invention.
FIG. 6 is a diagram illustrating deletion of a key value according to an embodiment of the present invention.
FIG. 7 is a diagram showing backup according to an embodiment of the present invention.
FIG. 8 is a configuration diagram of a conventional T-tree index.
FIG. 9 is a node configuration diagram in a conventional T-tree index.
FIG. 10 is a diagram showing an increase in duplicate keys in a conventional T-tree index.
FIG. 11 is a diagram illustrating insertion of a key value in a conventional T-tree index.
FIG. 12 is a diagram showing deletion of a key value in a conventional T-tree index.
FIG. 13 is a diagram showing backup of a conventional T-tree index.
[Explanation of symbols]
10 T-tree index 11 T-tree body 12 Key value storage area 13 Duplicate key storage area 20 Table 100 T-tree body storage area 111 Node 112 Intra-node element 113 Inter-node pointer 114 Intra-node element and inter-key value pointer 115 Free 116 In-node Element and inter-record pointer 121 Key value 122 Key value and inter-record pointer 123 Key value and duplicate key pointer inter-set pointer 131 Duplicate key pointer set element and inter-record pointer 132 Duplicate key pointer set inter-element and inter-record pointer 133 Duplicate key 200 Key value storage area 300 Duplicate key storage area 400 Management means 410 Backup acquisition means

Claims (9)

データベースをメモリ上に常駐させ、高速なデータアクセスを実現するデータベース管理システムで使用するT木インデックスを構築するT木インデックス構築方法において、
T木インデックスを該T木インデックスの階層構造の情報を有するノードからなるT木本体、検索時に条件比較を行うキー値情報、一つキーに対して複数のレコードが対応する重複キー情報の3つの領域に分けて管理し、
前記T木インデックスのノード情報をキーを構成するカラム数、長さ及びキーの重複とは独立に構築し、
分割した前記3つの領域の中でT木本体を構成するノードのみを、ディスク上にバックアップを取得することを特徴とするT木インデックス構築方法。
In a T-tree index construction method for constructing a T-tree index used in a database management system that makes a database resident in a memory and realizes high-speed data access,
The T-tree index is a T-tree body consisting of nodes having information on the hierarchical structure of the T-tree index, key value information for comparing conditions at the time of search, and duplicate key information corresponding to a plurality of records for one key. Divided into areas,
The node information of the T-tree index is constructed independently of the number of columns constituting the key, the length, and the key duplication,
A T-tree index construction method characterized in that a backup is acquired on a disk for only the nodes constituting the T-tree main body in the divided three areas.
データベースをメモリ上に常駐させ、高速なデータアクセスを実現するデータベース管理システムで使用するT木インデックスを構築するT木インデックス構築装置において、
T木インデックスを該T木インデックスの階層構造の情報を有するノードからなるT木本体を格納するT木本体格納領域と、
検索時に条件比較を行うキー値情報を格納するキー値格納領域と、
一つキーに対して複数のレコードが対応する重複キー情報を格納する重複キー格納領域と、
前記T木本体格納領域、前記キー値格納領域及び前記重複キー格納領域の3つの領域を管理する管理手段とを有することを特徴とするT木インデックス構築装置。
In a T-tree index construction apparatus for constructing a T-tree index used in a database management system that makes a database resident in a memory and realizes high-speed data access,
A T-tree main body storage area for storing a T-tree main body composed of nodes having information on the hierarchical structure of the T-tree index.
A key value storage area for storing key value information to be subjected to condition comparison at the time of search;
A duplicate key storage area for storing duplicate key information corresponding to a plurality of records for one key;
A T-tree index construction apparatus comprising: a management unit that manages three areas of the T-tree main body storage area, the key value storage area, and the duplicate key storage area.
前記T木本体格納領域は、
前記T木インデックスのノード情報をキーを構成するカラム数、長さ及びキーの重複とは独立に構築する請求項2記載のT木インデックス構築装置。
The T-tree main body storage area is
The T-tree index construction apparatus according to claim 2, wherein the node information of the T-tree index is constructed independently of the number of columns constituting the key, the length, and duplication of the key.
前記管理手段は、
分割した前記T木本体格納領域、前記キー値格納領域及び前記重複キー格納領域の3つの領域の中でT木本体を構成するノードのみを、ディスク上にバックアップを取得するバックアップ取得手段を含む請求項2及び3記載のT木インデックス構築装置。
The management means includes
A backup acquisition unit that acquires a backup on a disk of only the nodes constituting the T-tree main body among the three areas of the divided T-tree main body storage area, the key value storage area, and the duplicate key storage area. Item 4. The T-tree index construction device according to items 2 and 3.
前記T木本体格納領域に格納されるノードは、
前記ノード内要素に前記キー値格納領域内に格納されているキー値の位置を指すポインタを含む請求項2記載のT木インデックス構築装置。
Nodes stored in the T-tree main body storage area are:
3. The T-tree index construction apparatus according to claim 2, wherein the in-node element includes a pointer indicating a position of a key value stored in the key value storage area.
前記キー値格納領域に格納されるキー値は、
1つのキーに対して1つのレコードが対応している場合には、各キー値に対応するレコードの位置を指すポインタを保持し、
1つのキーに対して複数のレコードが対応している場合には、前記重複キー格納領域のポインタの集合内の一つの要素を指すポインタを保持する請求項2記載のT木インデックス構築装置。
The key value stored in the key value storage area is:
When one record corresponds to one key, a pointer indicating the position of the record corresponding to each key value is held,
3. The T-tree index construction apparatus according to claim 2, wherein when a plurality of records correspond to one key, a pointer pointing to one element in the set of pointers in the duplicate key storage area is held.
前記重複キー格納領域に格納される前記重複キー情報は、
前記重複キーに対応するレコードの位置を指すポインタを有する請求項2記載のT木インデックス構築装置。
The duplicate key information stored in the duplicate key storage area is:
3. The T-tree index construction apparatus according to claim 2, further comprising a pointer that points to a position of a record corresponding to the duplicate key.
前記管理手段は、
前記T木本体格納領域、前記キー値格納領域及び前記重複キー格納領域内の要素をポインタで結合する手段を含む請求項2、5、6、及び7記載のT木インデックス構築装置。
The management means includes
8. The T-tree index construction device according to claim 2, 5, 6, and 7, comprising means for combining elements in the T-tree main body storage area, the key value storage area, and the duplicate key storage area with a pointer.
データベースをメモリ上に常駐させ、高速なデータアクセスを実現するデータベース管理システムで使用するT木インデックスを構築するT木インデックス構築プログラムを格納した記憶媒体であって、
T木インデックスを該T木インデックスの階層構造の情報を有するノードからなるT木本体、検索時に条件比較を行うキー値情報、一つキーに対して複数のレコードが対応する重複キー情報の3つの領域に分けて管理する管理プロセスを有し、
前記管理プロセスは、
前記T木インデックスのノード情報をキーを構成するカラム数、長さ及びキーの重複とは独立に構築し、分割した前記3つの領域の中でT木本体を構成するノードのみを、ディスク上にバックアップを取得するプロセスを有することを特徴とするT木インデックス構築プログラムを格納した記憶媒体。
A storage medium storing a T-tree index construction program for constructing a T-tree index used in a database management system that makes a database resident in a memory and realizes high-speed data access,
The T-tree index is a T-tree body consisting of nodes having information on the hierarchical structure of the T-tree index, key value information for comparing conditions at the time of search, and duplicate key information corresponding to a plurality of records for one key. It has a management process to manage by dividing into areas,
The management process is:
The node information of the T-tree index is constructed independently of the number of columns constituting the key, the length, and the duplication of the key, and only the nodes constituting the T-tree body in the three divided areas are placed on the disk. A storage medium storing a T-tree index construction program characterized by having a process for obtaining a backup.
JP25723997A 1997-09-22 1997-09-22 T-tree index construction method and apparatus, and storage medium storing T-tree index construction program Expired - Fee Related JP3622443B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP25723997A JP3622443B2 (en) 1997-09-22 1997-09-22 T-tree index construction method and apparatus, and storage medium storing T-tree index construction program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP25723997A JP3622443B2 (en) 1997-09-22 1997-09-22 T-tree index construction method and apparatus, and storage medium storing T-tree index construction program

Publications (2)

Publication Number Publication Date
JPH1196058A JPH1196058A (en) 1999-04-09
JP3622443B2 true JP3622443B2 (en) 2005-02-23

Family

ID=17303627

Family Applications (1)

Application Number Title Priority Date Filing Date
JP25723997A Expired - Fee Related JP3622443B2 (en) 1997-09-22 1997-09-22 T-tree index construction method and apparatus, and storage medium storing T-tree index construction program

Country Status (1)

Country Link
JP (1) JP3622443B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4567754B2 (en) 2008-01-17 2010-10-20 株式会社エスグランツ Bit string search device, search method and program
CN104424222B (en) * 2013-08-23 2019-09-13 华为技术有限公司 Database index method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5758353A (en) * 1995-12-01 1998-05-26 Sand Technology Systems International, Inc. Storage and retrieval of ordered sets of keys in a compact 0-complete tree

Also Published As

Publication number Publication date
JPH1196058A (en) 1999-04-09

Similar Documents

Publication Publication Date Title
US8843454B2 (en) Elimination of duplicate objects in storage clusters
US4677550A (en) Method of compacting and searching a data index
US4823310A (en) Device for enabling concurrent access of indexed sequential data files
US5590320A (en) Computer file directory system
US6209000B1 (en) Tracking storage for data items
US5754844A (en) Method and system for accessing chunks of data using matching of an access tab and hashing code to generate a suggested storage location
US4914569A (en) Method for concurrent record access, insertion, deletion and alteration using an index tree
JP4932726B2 (en) Storage system for randomly named blocks of data
EP1325409B1 (en) A shared file system having a token-ring style protocol for managing meta-data
US6415375B2 (en) Information storage and retrieval system
JP2002525755A (en) Method and apparatus for reorganizing an active DBMS table
JP4101410B2 (en) Time version data storage device
JP4825719B2 (en) Fast file attribute search
US20160125021A1 (en) Efficient updates in non-clustered column stores
US20070118574A1 (en) Reorganizing data with update activity
US8156126B2 (en) Method for the allocation of data on physical media by a file system that eliminates duplicate data
JP3622443B2 (en) T-tree index construction method and apparatus, and storage medium storing T-tree index construction program
CN113779286B (en) Method and device for managing graph data
JP4825504B2 (en) Data registration / retrieval system and data registration / retrieval method
KR100295392B1 (en) How to Configure a Dynamic File System
JPH07152615A (en) Data base reorganization system
CN117950574A (en) Fingerprint tracking structure for storage system
KR100205950B1 (en) Method for controlling simultaneity using by latch in storing system
KR100577518B1 (en) Method for Retrieval and file backup using to address indexing mechanism
KR20220106622A (en) Zipper compaction method and apparatus for compacting the plural of skiplists

Legal Events

Date Code Title Description
TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20041102

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20041115

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20071203

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20081203

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20091203

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees