JP2008015810A - Index division management method for table data with multiple columns - Google Patents

Index division management method for table data with multiple columns Download PDF

Info

Publication number
JP2008015810A
JP2008015810A JP2006186648A JP2006186648A JP2008015810A JP 2008015810 A JP2008015810 A JP 2008015810A JP 2006186648 A JP2006186648 A JP 2006186648A JP 2006186648 A JP2006186648 A JP 2006186648A JP 2008015810 A JP2008015810 A JP 2008015810A
Authority
JP
Japan
Prior art keywords
index
search
field
data
update frequency
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.)
Pending
Application number
JP2006186648A
Other languages
Japanese (ja)
Inventor
Shuji Yamazaki
修治 山崎
Hideaki Kasao
英明 笠尾
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.)
Hitachi Software Engineering Co Ltd
Original Assignee
Hitachi Software Engineering Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Software Engineering Co Ltd filed Critical Hitachi Software Engineering Co Ltd
Priority to JP2006186648A priority Critical patent/JP2008015810A/en
Publication of JP2008015810A publication Critical patent/JP2008015810A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an index management technique capable of maintaining retrieval efficiency and data storage efficiency in table data including a plurality of fields in spite of frequent update of the fields. <P>SOLUTION: When table data including a plurality of fields (columns) is managed on a computer, an index for the table data, a management object is created for columns with low update frequency except columns with high update frequency. At the time of search, it is checked whether a search condition for the columns with low update frequency is included in a designated search condition or not, and when it is included, search using the index is performed. Records are narrowed at high speed by the search using the index, and search is performed by sequential search to the narrowed records with a search condition for the columns with high update frequency excluded from the index structure. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、複数の列で構成された表のデータを、該表に格納されているデータに対して定義されたインデクスで、データの更新頻度別に分割管理する技術に関するものである。   The present invention relates to a technique for dividing and managing data in a table composed of a plurality of columns according to the data update frequency using an index defined for the data stored in the table.

従来のデータベース管理システム(DataBase Management System: DBMS)では、データを表に登録して管理する。その表は、レコード(行)とフィールド(列)で構成される。指定されたデータを検索する場合、レコードを格納した順に検索を行うため、登録したレコード件数が大量の場合は容易に抽出できない。そこで、大量に登録されているデータの検索効率を向上させるため、表に登録されているデータに対して索引(インデクス)を作成する方法が利用されている。   In a conventional database management system (DataBase Management System: DBMS), data is registered in a table and managed. The table is composed of records (rows) and fields (columns). When searching the specified data, the search is performed in the order in which the records are stored. Therefore, when the number of registered records is large, it cannot be easily extracted. Therefore, in order to improve the retrieval efficiency of data registered in large quantities, a method of creating an index (index) for data registered in a table is used.

なお、本発明に関連する公知技術文献としては下記の特許文献1がある。該文献には、CSVファイル等の被検索ファイルが大規模なものとなった場合でも効率的かつ高速にデータ抽出を行うためにインデクスファイルを用いて検索する技術が開示されている。
特開2003−162545
In addition, there exists the following patent document 1 as a well-known technical document relevant to this invention. This document discloses a technique for searching using an index file for efficient and high-speed data extraction even when a file to be searched such as a CSV file becomes large.
JP 2003-162545 A

インデクスを作成するにあたり、上記特許文献1によると、表に登録されているデータは予め整列し、各フィールドごとに対してインデクスを作成する必要がある。しかし、表に登録されているレコード及びデータは絶えず更新されるものであるため、インデクス管理情報も頻繁に変更されることとなり、そのためにインデクス情報を使った検索とそのデータの格納効率が下がり、有用な効果が得られない。   In creating an index, according to the above-mentioned Patent Document 1, it is necessary to arrange data registered in a table in advance and create an index for each field. However, since the records and data registered in the table are constantly updated, the index management information is also frequently changed, which reduces the search using the index information and the storage efficiency of the data, A useful effect cannot be obtained.

そこで、B-Tree(Binary-Tree)によるインデクス探索手法が考えられている。この手法を用いることで、表のレコードの格納順序に関係なく、整列されたデータとして探索することができる。B-Tree(Binary-Tree)によるインデクス探索手法で用いる木構造のインデクスのことをインデクスツリーと呼ぶ。インデクスツリーは、複数のフィールドを対象にして構成することができ、これによりデータの検索効率を上げることができる。   Therefore, an index search method using B-Tree (Binary-Tree) has been considered. By using this method, it is possible to search as sorted data regardless of the storage order of the records in the table. A tree-structured index used in the B-Tree (Binary-Tree) index search technique is called an index tree. An index tree can be configured for a plurality of fields, thereby increasing the data retrieval efficiency.

ところが、前述したように、表に登録されているレコードは絶えず更新されているため、それに伴いインデクスツリーも絶えず更新されることになる。このため、インデクスツリー構造が乱れ、指定したデータを検索するときの効率が低下してしまう。さらに、データの格納領域の断片化が発生するため、データの格納領域の再構成が必要となる頻度が高くなる。データの格納領域を再構成する場合は、業務を一度中断することになるため、業務の中断期間が長くなってしまう。   However, as described above, since the records registered in the table are constantly updated, the index tree is constantly updated accordingly. For this reason, the index tree structure is disturbed, and the efficiency when searching for the designated data is reduced. Furthermore, since the data storage area is fragmented, the frequency at which the data storage area needs to be reconfigured increases. When the data storage area is reconfigured, the business is suspended once, so the business suspension period becomes long.

本発明の目的は、複数のフィールドで構成された表データにおいて、それらのフィールドの更新が多い場合であっても、検索効率及びデータ格納効率を維持することができるインデクス管理の技術を提供することにある。   It is an object of the present invention to provide an index management technique capable of maintaining search efficiency and data storage efficiency even when table data composed of a plurality of fields is frequently updated. It is in.

上記の目的を達成するため、本発明のインデクス分割管理方式は、コンピュータ上で複数のフィールド(列)を備える表データを管理する際に、管理対象の表データに対し、所定の基準値以上に更新頻度の高いフィールドについてはインデクス作成の対象から除外し、それ以外の所定の基準値未満に更新頻度の低いフィールドについてはインデクス作成対象として、インデクスを作成することを特徴とする。そして、検索の際には、指示された探索条件が前記所定の基準値未満に更新頻度の低いフィールドについての探索条件を含むかどうかチェックし、含む場合は、そのインデクスを利用した探索を行なうようにする。具体的には、指示された探索条件が所定の基準値未満に更新頻度の低いフィールドについての探索条件のみからなる場合は、インデクスを利用した探索で、指示された探索条件を満たすレコードが探索できる。また、指示された探索条件が所定の基準値未満に更新頻度の低いフィールドについての探索条件と所定の基準値以上に更新頻度の高いフィールドについての探索条件の両方を含む場合は、まずインデクスを利用した探索で更新頻度の低いフィールドについての探索条件を満たすレコードに絞り込み、絞り込んだレコードを順検索して更新頻度の高いフィールドについての探索条件を満たすレコードを探索する。   In order to achieve the above object, the index division management method of the present invention, when managing table data having a plurality of fields (columns) on a computer, exceeds the predetermined reference value for the table data to be managed. Fields with a high update frequency are excluded from the index creation target, and other fields with a low update frequency less than a predetermined reference value are created as index creation targets. When searching, it is checked whether or not the instructed search condition includes a search condition for a field with a low update frequency below the predetermined reference value, and if so, a search using the index is performed. To. Specifically, when the instructed search condition includes only the search condition for a field with a low update frequency that is less than a predetermined reference value, a record that satisfies the instructed search condition can be searched by searching using an index. . If the specified search condition includes both a search condition for a field with a low update frequency below a predetermined reference value and a search condition for a field with a high update frequency at a predetermined reference value or higher, an index is used first. In this search, the records satisfying the search condition for the field with low update frequency are narrowed down, and the narrowed-down records are sequentially searched to search for the record satisfying the search condition for the field with high update frequency.

さらに、データの更新時には、指示された更新条件が前記所定の基準値未満に更新頻度の低いフィールドについての更新条件を含む場合は、前記フィールドの更新を行なった後に前記インデクスを再作成し、指示された更新条件が前記所定の基準値以上に更新頻度の高いフィールドについての更新条件のみを含む場合は、前記フィールドの更新のみを行なうようにする。   Furthermore, when updating data, if the specified update condition includes an update condition for a field with a low update frequency less than the predetermined reference value, the index is recreated after the field is updated, When the updated update condition includes only an update condition for a field whose update frequency is higher than the predetermined reference value, only the update of the field is performed.

上記インデクスは、例えば、インデクスの作成対象のフィールドをキーとする木構造をもつようなものである。インデクスを利用した探索は、例えば木構造のB-Treeサーチ(Binary-Tree Search)の方式などを用いる。なお、表データの更新によりインデクス格納容量が不足する場合があるが、その場合は、自動的に更新フィールドをインデクス作成の対象から除外するようにしてもよい。   The index has, for example, a tree structure with the index creation field as a key. The search using the index uses, for example, a B-Tree search (Binary-Tree Search) method having a tree structure. In some cases, the index storage capacity may be insufficient due to the update of the table data. In this case, the update field may be automatically excluded from the index creation target.

本発明の複数列に対するインデクスにおけるインデクス分割管理方式によれば、次のような効果がある。
(1)データの更新頻度の高いフィールドをインデクス構成対象から除外しているので、当該フィールドを更新した場合はインデクスに変更がないため、インデクスのデータ格納効率を維持することができる。また、検索時には、インデクスを利用した高速な検索が行えるので、データの検索効率の維持・向上を図ることができる。
(2)データの更新頻度の高いフィールドをインデクス構成対象から除外しているため、データの更新頻度の高いフィールドのデータ格納領域が不足し、別データ格納領域に分割格納する場合でもインデクスに変更がないため、データの検索効率の維持・向上、及びインデクスのデータ格納効率を維持することができる。
According to the index division management method for indexes for a plurality of columns according to the present invention, the following effects are obtained.
(1) Since a field with a high data update frequency is excluded from the index composition target, since the index is not changed when the field is updated, the data storage efficiency of the index can be maintained. Further, since a high-speed search using an index can be performed at the time of search, it is possible to maintain and improve data search efficiency.
(2) Since fields with high data update frequency are excluded from the index configuration target, the data storage area of the fields with high data update frequency is insufficient, and the index is changed even when it is divided and stored in another data storage area. Therefore, it is possible to maintain and improve the data retrieval efficiency and maintain the index data storage efficiency.

以下、本発明を適用した複数列の表データに対するインデクスにおけるインデクス分割管理方式の一実施の形態について説明する。   Hereinafter, an embodiment of an index division management method for indexes on table data of a plurality of columns to which the present invention is applied will be described.

図1は、本発明の実施の形態であるデータベース管理システムの構成例を示すブロック図である。データベース管理システム装置D1は、データベースアクセス部D3及びデータ管理部D4を備える。アプリケーションD2は、入力情報として表名や探索条件などを指定して、データベースアクセス部D3に処理を依頼する。データベースアクセス部D3は、アプリケーションD2で指定された入力情報を受け取るデータ入力部D31、データ管理部D4の情報を抽出・更新するデータ操作部D32、及び、結果情報をアプリケーションD2に受け渡すデータ出力部D33を備える。データ管理部D4は、様々なデータを管理する外部記憶装置で、各データは表D41に格納されて管理され、表D41のデータを管理するためにインデクスD42が作成されている。データ管理部D4は、複数の外部記憶装置で構成することもできる。なお、図1のデータベース管理システム装置D1やアプリケーションD2は、具体的にはコンピュータ上で所定のソフトウェアを実行することにより実現されている。   FIG. 1 is a block diagram showing a configuration example of a database management system according to an embodiment of the present invention. The database management system device D1 includes a database access unit D3 and a data management unit D4. The application D2 specifies a table name, a search condition, etc. as input information and requests the database access unit D3 to perform processing. The database access unit D3 includes a data input unit D31 that receives input information specified by the application D2, a data operation unit D32 that extracts and updates information in the data management unit D4, and a data output unit that transfers result information to the application D2. D33 is provided. The data management unit D4 is an external storage device that manages various data. Each data is stored and managed in a table D41, and an index D42 is created to manage the data in the table D41. The data management unit D4 can also be configured with a plurality of external storage devices. Note that the database management system apparatus D1 and the application D2 in FIG. 1 are specifically realized by executing predetermined software on a computer.

図2は、図1のシステムで管理する表の一例を示すデータ構成図である。表T1は、フィールド1(T11)とフィールド2(T12)とフィールド3(T13)の3つのフィールドで構成されており、データは登録した順に格納されている。フィールド1(T11)にはひらがなの文字が格納され、フィールド2(T12)には英字が格納され、フィールド3(T13)には数字が格納されるものとする。また、表T1に格納されているデータの更新頻度は、フィールド1(T11)とフィールド2(T12)は低く、フィールド3(T13)は高いとする。   FIG. 2 is a data configuration diagram showing an example of a table managed by the system of FIG. The table T1 includes three fields of field 1 (T11), field 2 (T12), and field 3 (T13), and data is stored in the order of registration. It is assumed that hiragana characters are stored in field 1 (T11), alphabetic characters are stored in field 2 (T12), and numbers are stored in field 3 (T13). The update frequency of the data stored in the table T1 is low in the field 1 (T11) and the field 2 (T12) and high in the field 3 (T13).

本実施形態では、表T1の検索効率を向上させるため、表T1に対して、図3のようなインデクスI1を作成する。インデクスI1は、表T1に格納されているデータをもとにインデクスツリーI11を作成し、各データの位置を特定できるインデクス管理部I12を、データの更新頻度の低いフィールド1(T11)とフィールド2(T12)の2つのフィールドに対して作成したものである。データの更新頻度の高いフィールド3(T13)については、インデクス管理部I12の管理対象に含めない構成にする。従って、フィールド3の検索を行なうときには、インデクスを利用することなく、表の各レコードのフィールド3のデータそのものを順番に参照しながら検索する順検索の手法を採る必要がある。   In this embodiment, in order to improve the search efficiency of the table T1, an index I1 as shown in FIG. 3 is created for the table T1. The index I1 creates an index tree I11 based on the data stored in the table T1, and sets the index management unit I12 that can specify the position of each data to the field 1 (T11) and the field 2 that are less frequently updated. This is created for the two fields of (T12). The field 3 (T13) with high data update frequency is not included in the management target of the index management unit I12. Therefore, when performing a search of field 3, it is necessary to adopt a sequential search method in which a search is performed while referring to the data of field 3 of each record in the table in order without using an index.

表T1にインデクスI1が定義されている状態で、表T1のレコードT14(図2)のフィールド3(T13)の値“5”を“11”に更新したとする。このとき、インデクスI1は、図4のようなインデクスI2の状態となる。図4から分るように、フィールド3(T13)はインデクスツリー構成対象から除外してあるため、インデクス管理部I12に対する変更はなく、インデクス管理部I11とI12は同じである。また、インデクスキー情報I13の値がI23に更新されるのみで別領域を使用しないため、インデクス管理部におけるデータ格納効率を維持することができる。また、データ更新前のインデクスI1とデータ更新後のインデクスI2は全く変更がないため、今までの検索効率を維持することができる。   Assume that the value “5” of the field 3 (T13) of the record T14 (FIG. 2) of the table T1 is updated to “11” in a state where the index I1 is defined in the table T1. At this time, the index I1 is in the state of the index I2 as shown in FIG. As can be seen from FIG. 4, since field 3 (T13) is excluded from the index tree construction target, there is no change to index management unit I12, and index management units I11 and I12 are the same. Also, since the value of the index key information I13 is only updated to I23 and no separate area is used, the data storage efficiency in the index management unit can be maintained. Further, since the index I1 before the data update and the index I2 after the data update are not changed at all, the search efficiency so far can be maintained.

図5は、本実施形態におけるインデクス管理方法での、インデクス作成時のフローチャート図である。表に対してインデクスを作成する場合、まずインデクスツリーの構成対象としようとするフィールドの更新頻度が高いかどうかを判断する(ステップC01)。データの更新頻度の高い列である場合は、インデクスツリー構成対象に含めずに終了する。データの更新頻度の低い列である場合は、その列に格納されているデータを昇順にしてインデクス管理部としてキー情報を登録し(ステップC02)、インデクスツリーを構成する(ステップC03)。   FIG. 5 is a flowchart at the time of creating an index in the index management method according to this embodiment. When creating an index for a table, first, it is determined whether or not the update frequency of the field to be configured in the index tree is high (step C01). If the column has a high data update frequency, the process ends without being included in the index tree configuration target. If it is a column with a low data update frequency, the data stored in that column is registered in ascending order and key information is registered as an index management unit (step C02), and an index tree is constructed (step C03).

図6は、本実施形態におけるインデクス管理方法での、データ検索時のフローチャート図である。データ検索時に与えられる命令は、例えば、図2の表に対して「{(列1が『う』)かつ(列2が『B』)かつ(列3が『8』)}または{(列1が『お』)かつ(列2が『C』)かつ(列3が『7』)}であるレコードを探索せよ」というようなものである。図6の処理に入る前の事前の処理により、与えられた命令を整理して、何れかの1つのフィールド(列)についての探索条件(例えば「列1が『う』」)を「かつ」で接続したものを単位として、幾つかの探索条件に区分けしておく。区分けした各探索条件ごとにステップS01〜S09の処理を行なう。   FIG. 6 is a flowchart at the time of data search in the index management method according to this embodiment. The instruction given at the time of data retrieval is, for example, “{(column 1 is“ U ”) and (column 2 is“ B ”) and (column 3 is“ 8 ”)} or {(column Search for a record in which 1 is “O”) and (column 2 is “C”) and (column 3 is “7”)}. The pre-processing before entering the processing of FIG. 6 arranges the given instructions, and sets the search condition (for example, “column 1 is“ U ””) for any one field (column) to “and”. The search is divided into several search conditions, with the unit connected in (1) as a unit. The processing of steps S01 to S09 is performed for each divided search condition.

まず初めの処理対象の探索条件が、データの更新頻度の低いフィールドについての探索条件を含むものである場合、その更新頻度の低いフィールドについての探索条件で、インデクスツリーを利用して、探索を行う(ステップS01)。インデクスツリーは更新頻度の低いフィールドについて作成されており、これを利用することにより高速に探索を行なうことができる。そして、インデクス管理部でその探索条件を満たしているレコードがあるかどうかを判断し(ステップS02)、無ければ上記探索条件を満たすレコードが無いということであるから、ステップS09に進んで、次の探索条件(上記事前の処理により区分けしたもの)があるか判断する。あればその探索条件を処理対象として(ステップS10)、ステップS01から繰り返す。   First, when the search condition for the first processing target includes a search condition for a field with low data update frequency, a search is performed using the index tree with the search condition for the field with low update frequency (step S01). The index tree is created for fields with a low update frequency, and by using this, a search can be performed at high speed. Then, the index management unit determines whether there is a record that satisfies the search condition (step S02). If there is no record, it means that there is no record that satisfies the search condition. It is determined whether there is a search condition (separated by the above prior process). If there is, the search condition is set as a processing target (step S10), and the process is repeated from step S01.

ステップS02で上記更新頻度の低いフィールドについての探索条件を満たすレコードがあった場合は、更新頻度の低いフィールドについての探索条件でレコードが絞り込まれたということであるから、当該絞り込まれたレコードを探索対象として、ステップS03以降の処理を行なう。まず、処理対象の探索条件が、インデクス構成対象外のフィールド(すなわち、データの更新頻度の高いフィールド)についての探索条件を含むか判断する(ステップS03)。そのような探索条件を含む場合は、上記更新頻度の低いフィールドについての探索条件で絞り込んだレコードを探索対象として、上記更新頻度の高いフィールドについての探索条件を満たすレコードを順検索し(ステップS04、ステップS06〜S08)、探索条件と合致するレコードを全て探索結果として出力した段階でステップS09に進む。ステップS03でインデクス構成対象外のフィールドについての探索条件を含まない場合は、ステップS01,S02の探索結果が、処理対象の探索条件を満たすレコードであるから、それらのレコードを探索結果として出力し(ステップS05)、ステップS09に進む。   If there is a record that satisfies the search condition for the field with low update frequency in step S02, it means that the record is narrowed down with the search condition for the field with low update frequency. As an object, the processing after step S03 is performed. First, it is determined whether the search condition to be processed includes a search condition for a field that is not an index configuration target (that is, a field with a high data update frequency) (step S03). When such a search condition is included, the records that are narrowed down by the search condition for the field with low update frequency are searched, and records that satisfy the search condition for the field with high update frequency are sequentially searched (step S04, In steps S06 to S08), the process proceeds to step S09 when all records matching the search conditions are output as search results. If the search condition for the field that is not the index construction target is not included in step S03, the search results in steps S01 and S02 are records that satisfy the search target condition for processing, so these records are output as search results ( Step S05), the process proceeds to Step S09.

なお、処理対象の探索条件が更新頻度の高いフィールドについての探索条件のみから構成される場合は、ステップS01,S02のインデクスを利用した探索の処理はスキップして、表内の全レコードを探索対象としてステップS03以降の処理を行なうものとする。   If the search condition to be processed consists only of search conditions for fields with a high update frequency, the search process using the indexes in steps S01 and S02 is skipped, and all records in the table are searched. Assuming that the processing after step S03 is performed.

上記のデータ検索命令「{(列1が『う』)かつ(列2が『B』)かつ(列3が『8』)}または{(列1が『お』)かつ(列2が『C』)かつ(列3が『7』)}であるレコードを探索せよ」が与えられたとして、図6の流れを説明する。図6の処理に入る前に、事前の処理により、上記命令を「(列1が『う』)かつ(列2が『B』)かつ(列3が『8』)」と「(列1が『お』)かつ(列2が『C』)かつ(列3が『7』)」の2つの探索条件に区分けしておく。   The above data search command “{(column 1 is“ U ”) and (column 2 is“ B ”) and (column 3 is“ 8 ”)} or {(column 1 is“ o ”) and (column 2 is“ C ”) and (search for a record in which column 3 is“ 7 ”)} is given”, the flow of FIG. 6 will be described. Before entering the processing of FIG. 6, the above instructions are changed to “(column 1 is“ U ”) and (column 2 is“ B ”) and (column 3 is“ 8 ”)” and “(column 1 Is divided into two search conditions: “O”) and (column 2 is “C”) and (column 3 is “7”).

まず探索条件「(列1が『う』)かつ(列2が『B』)かつ(列3が『8』)」を処理対象として、ステップS01からの処理を行なう。この探索条件のうち、インデクスが作成されている列1と列2についての探索条件「(列1が『う』)かつ(列2が『B』)」についてはインデクスを利用して高速に検索できる。そこで、ステップS01,S02で探索条件「(列1が『う』)かつ(列2が『B』)」でインデクスを利用した探索を行なう。これにより、図2の「う B 5」と「う B 8」のレコードに絞り込まれる。上記処理対象の探索条件は、インデクスが作成されていない列3についての探索条件「列3が『8』」も含むから、ステップS03からS04に進み、ステップS04,S06〜S08で上記絞り込まれた2つのレコードを探索対象として、探索条件「列3が『8』」を満たすレコードを順検索する。これにより、探索結果として「う B 8」のレコードが出力される。この結果は、探索条件「(列1が『う』)かつ(列2が『B』)かつ(列3が『8』)」の探索結果として、所定のバッファに記憶しておく。   First, the processing from step S01 is performed with the search condition “(column 1 is“ U ”) and (column 2 is“ B ”) and (column 3 is“ 8 ”) as a processing target. Of these search conditions, the search conditions “(column 1 is“ U ”) and (column 2 is“ B ”)” for columns 1 and 2 in which the index is created are searched at high speed using the index. it can. Therefore, in steps S01 and S02, a search using an index is performed under the search condition “(column 1 is“ U ”) and (column 2 is“ B ”)”. As a result, the records of “U B 5” and “U B 8” in FIG. 2 are narrowed down. The search condition to be processed includes the search condition “column 3 is“ 8 ”” for the column 3 for which no index has been created. Therefore, the process proceeds from step S03 to S04, and the search conditions are narrowed down in steps S04 and S06 to S08. Using two records as search targets, records that satisfy the search condition “column 3 is“ 8 ”” are sequentially searched. As a result, the record “U B 8” is output as the search result. This result is stored in a predetermined buffer as a search result of the search conditions “(column 1 is“ U ”) and (column 2 is“ B ”) and (column 3 is“ 8 ”).

次にステップS09からS10に進み、次の探索条件「(列1が『お』)かつ(列2が『C』)かつ(列3が『7』)」についてステップS01からの処理を行なう。上記と同様にして、インデクスを利用した探索で絞り込み、順検索を行ない、探索結果として「お C 7」のレコードを得る。その後、ステップS09では次の探索条件は無いので、データ検索を終了する。なお、上記2つの探索条件は「または」で結ばれていたので、上記探索結果を「または」で結んだ「(う B 8)または(お C 7)」が最終的な結果となる。   Next, the process proceeds from step S09 to S10, and the processing from step S01 is performed for the next search condition “(column 1 is“ O ”) and (column 2 is“ C ”) and (column 3 is“ 7 ”)”. In the same manner as described above, the search is narrowed down by the search using the index, the forward search is performed, and the record “O C 7” is obtained as the search result. Thereafter, since there is no next search condition in step S09, the data search is terminated. Since the two search conditions are connected with “or”, the final result is “(U B 8) or (O C 7)” obtained by connecting the search results with “or”.

図7は、本実施形態におけるインデクス管理方法での、データ更新時のフローチャート図である。なお、データ更新時には、更新すべきレコードを特定するための探索条件が与えられると共に、その探索条件で特定されるレコードの更新対象のフィールドを指定する情報と、そのフィールドに設定する値が与えられるものとする。   FIG. 7 is a flowchart when updating data in the index management method according to this embodiment. At the time of data update, a search condition for specifying a record to be updated is given, information for specifying a field to be updated of the record specified by the search condition, and a value set in the field are given. Shall.

まず、更新対象のフィールドがインデクスツリー構成対象のフィールドか判定する(ステップU01)。   First, it is determined whether the update target field is an index tree construction target field (step U01).

インデクスツリー構成対象のフィールドである場合は、与えられた探索条件に応じてインデクスツリーを利用して更新対象のレコードの探索を行ない(ステップU02)、該当するインデクス管理レコードをインデクスツリーから削除して(ステップU03)、該当するレコードの該当するフィールドのデータを更新する(ステップU04)。次に、更新後のインデクス管理レコードを挿入すべき新たな位置を探索するために、再度、インデクスツリーを利用して探索を行い(ステップU05)、該当するインデクス管理レコードをインデクスツリーに追加し、インデクスツリーを再作成する(ステップU06)。   If the field is an index tree configuration target field, the record to be updated is searched using the index tree in accordance with the given search condition (step U02), and the corresponding index management record is deleted from the index tree. (Step U03), the data of the corresponding field of the corresponding record is updated (Step U04). Next, in order to search for a new position where the updated index management record is to be inserted, a search is performed again using the index tree (step U05), and the corresponding index management record is added to the index tree. An index tree is re-created (step U06).

なお、更新すべきレコードを特定するための探索条件がインデクスツリー構成対象外のフィールドについての探索条件のみからなる場合は、ステップU02でインデクスを利用した探索の代わりに順検索で更新対象のレコードの探索を行ない、ステップU03では当該更新対象のレコードのインデクス管理レコードを削除するようにすればよい。また、更新すべきレコードを特定するための探索条件がインデクスツリー構成対象のフィールドについての探索条件とインデクスツリー構成対象外のフィールドについての探索条件の両方を含むものである場合は、ステップU02のインデクスツリーを利用した探索だけでは絞り込みが行なえるだけであるので、さらにインデクスツリー構成対象外のフィールドについての探索条件で探索を行なう必要があるが、その探索はステップU02で行なえばよい。要するにU02〜U06では、更新対象のレコードの更新対象のフィールドを更新する処理に加えて、当該レコードのインデクスの作り直しを行なっている点が特徴である。   If the search condition for specifying the record to be updated consists only of search conditions for fields that are not included in the index tree structure, in step U02 instead of searching using the index, the search target records A search is performed, and in step U03, the index management record of the record to be updated may be deleted. If the search condition for specifying the record to be updated includes both the search condition for the field that is the index tree construction target and the search condition for the field that is not the index tree construction target, the index tree of step U02 is Since it is only possible to narrow down the search by using only the search, it is necessary to perform a search under the search condition for the field that is not the object of the index tree configuration, but the search may be performed in step U02. In short, U02 to U06 are characterized in that, in addition to the process of updating the update target field of the update target record, the index of the record is recreated.

ステップU01でインデクスツリー構成対象外のフィールドの更新である場合は、まず与えられた探索条件に応じてインデクスツリーを利用して更新対象のレコードの探索を行なう(ステップU07)。なお、ステップU07は、更新すべきレコードを特定するための探索条件がインデクスツリー構成対象のフィールドについての探索条件を含む場合に、その探索条件でレコードを絞り込む処理を行なうものである。もし更新すべきレコードを特定するための探索条件がインデクスツリー構成対象外のフィールドについての探索条件のみからなる場合は、ステップU07はスキップする。   If the field is not an index tree construction target in step U01, the record to be updated is first searched using the index tree in accordance with a given search condition (step U07). In step U07, when a search condition for specifying a record to be updated includes a search condition for a field that is an index tree construction target, a process for narrowing records with the search condition is performed. If the search condition for specifying the record to be updated consists only of the search condition for the field that is not the index tree construction target, step U07 is skipped.

次に、更新すべきレコードを特定するための探索条件がインデクスツリー構成対象外のフィールドについての探索条件を含む場合は、ステップU07で絞り込んだレコードを処理対象とし、該処理対象のレコードを1つ1つ取り出しながらステップU08〜U11の処理を行なう。まず、取り出したレコードが、与えられているインデクスツリー構成対象外のフィールドについての探索条件を満たすか判断する(ステップU08)。ステップU08で探索条件を満たさない場合は、ステップU10に進む。ステップU08で探索条件を満たす場合は、そのレコードが更新対象のレコードであるということであるから、そのレコードの更新対象のフィールドを指定されたとおりに更新し(ステップU09)、ステップU10に進む。次のレコードが存在するか判断し(ステップU10)、存在しなければステップU12に進み、存在すれば次のレコードを処理対象として(ステップU11)、ステップU08からの処理を繰り返す。   Next, when the search condition for specifying the record to be updated includes the search condition for the field that is not the index tree construction target, the record narrowed down in step U07 is set as the processing target, and one record of the processing target is set. The process of steps U08-U11 is performed while taking out one. First, it is determined whether or not the retrieved record satisfies the search condition for a field that is not a given index tree construction target (step U08). If the search condition is not satisfied in step U08, the process proceeds to step U10. If the search condition is satisfied in step U08, it means that the record is a record to be updated, so the field to be updated in the record is updated as specified (step U09), and the process proceeds to step U10. It is determined whether or not the next record exists (step U10). If it does not exist, the process proceeds to step U12. If it exists, the next record is set as a processing target (step U11), and the processes from step U08 are repeated.

なお、更新すべきレコードを特定するための探索条件がインデクスツリー構成対象外のフィールドについての探索条件を含まない場合は、既にステップU07の探索だけで更新すべきレコードが特定されているはずであり、ステップU08〜U11のような順検索を行なう必要はない。従って、その場合は、ステップU07の後、更新対象のレコードの更新対象のフィールドを指定されたとおりに更新し、ステップU12に進むようにすればよい。要するにU07〜U11では、更新対象のレコードの更新対象のフィールドを更新する処理を行なうだけで、当該レコードのインデクスについては全くそのままにしている点が特徴である。これにより、インデクスツリー構造が変わらず、新たなインデクス管理領域を使用しないため、データ管理領域の格納効率を維持することができる。   If the search condition for specifying the record to be updated does not include the search condition for the field that is not the index tree construction target, the record to be updated should already be specified only by the search in step U07. There is no need to perform a sequential search as in steps U08 to U11. Therefore, in this case, after step U07, the update target field of the update target record may be updated as specified, and the process may proceed to step U12. In short, U07 to U11 are characterized in that only the process of updating the update target field of the record to be updated is performed, and the index of the record is left as it is. As a result, the index tree structure does not change, and a new index management area is not used, so that the storage efficiency of the data management area can be maintained.

さらに、次のデータ更新が指示されている場合は(ステップU12)、そのデータ更新を行なうべく、次の探索条件を処理対象として(ステップU13)、ステップU01からの処理を繰り返す。指示された全てのデータ更新が終了した段階でデータ更新とインデクス管理情報の更新が終了する。   Further, when the next data update is instructed (step U12), the processing from step U01 is repeated with the next search condition as a processing target (step U13) in order to perform the data update. At the stage when all the instructed data updates are completed, the data update and the index management information update are completed.

なお、上記実施の形態では、図5のステップC01において、フィールドの更新頻度が高いかどうかによりインデクスを作成するかしないかを決定しているが、この更新頻度の高低の判断は任意である。例えば、所定期間における各フィールドの更新回数を集計しておき、更新頻度の高低を分ける閾値(基準値)を決定しておき、その閾値以上の回数の更新が為されているフィールドを更新頻度が高いフィールドとすればよい。また、人の判断で更新頻度の高低の基準値を随時決定できるようにしてもよい。   In the above embodiment, whether or not to create an index is determined in step C01 in FIG. 5 depending on whether or not the field update frequency is high, but the determination of whether the update frequency is high or low is arbitrary. For example, the number of updates of each field in a predetermined period is aggregated, a threshold value (reference value) that determines whether the update frequency is high or low is determined, and a field that has been updated a number of times greater than or equal to the threshold value has an update frequency. It can be a high field. Further, a reference value with a high or low update frequency may be determined at any time by human judgment.

以上のように、本実施の形態の複数列に対するインデクスにおけるインデクス分割管理方式によれば、次のような効果がある。
(1)データの更新頻度の高いフィールドをインデクスツリー構成対象から除外しており、レコード更新を行った場合においてもインデクスツリーに変更がないため、検索効率を維持・向上させることができる。
(2)データの更新頻度の高いフィールドをインデクスツリー構成対象から除外しているため、データの更新頻度の高いフィールドのデータ格納領域が不足し、別のデータ格納領域に分割格納した場合でもインデクスツリーに変更がないため、検索効率を維持・向上させることができる。
As described above, according to the index division management method for indexes on a plurality of columns according to the present embodiment, the following effects are obtained.
(1) Fields with a high data update frequency are excluded from the object of index tree configuration, and even when a record is updated, there is no change in the index tree, so that search efficiency can be maintained and improved.
(2) Since the field with high data update frequency is excluded from the index tree configuration target, the data storage area of the field with high data update frequency is insufficient, and the index tree even when divided and stored in another data storage area Since there is no change in the search efficiency, search efficiency can be maintained and improved.

データベース管理システム構成の一例を示すブロック図である。It is a block diagram which shows an example of a database management system structure. 本発明の実施形態を説明する表の一例を示すデータ構成図である。It is a data block diagram which shows an example of the table | surface explaining embodiment of this invention. 図2の表に対するインデクスを示すデータ構成図である。FIG. 3 is a data configuration diagram showing an index for the table of FIG. 2. 本発明によるインデクス管理方法での、データの更新を行った場合の図3のインデクスを示すデータ構成図である。FIG. 4 is a data configuration diagram showing the index of FIG. 3 when data is updated in the index management method according to the present invention. 本発明におけるインデクス管理方法での、インデクス作成時のフローチャート図である。It is a flowchart figure at the time of the index creation in the index management method in this invention. 本発明におけるインデクス管理方法での、データ検索時のフローチャート図である。It is a flowchart figure at the time of the data search by the index management method in this invention. 本発明におけるインデクス管理方法での、データ更新時のフローチャート図である。It is a flowchart figure at the time of the data update in the index management method in this invention.

符号の説明Explanation of symbols

D1…データベース管理システム(DBMS : DataBase Management System)、D2…アプリケーション、D3…データアクセス部、D31…データ入力部、D32…データ操作部、D33…データ出力部、D4…データ管理部、D41…表、D42…インデクス、T1…表、I1,I2…インデクス、I11…インデクスツリー、I12…インデクスツリー構成対象。   D1 ... Database Management System (DBMS), D2 ... Application, D3 ... Data Access Unit, D31 ... Data Input Unit, D32 ... Data Operation Unit, D33 ... Data Output Unit, D4 ... Data Management Unit, D41 ... Table D42 ... index, T1 ... table, I1, I2 ... index, I11 ... index tree, I12 ... index tree configuration target.

Claims (2)

コンピュータ上で複数のフィールド(列)を備える表データを管理するためのインデクス分割管理方法であって、
コンピュータが備えるインデクス作成手段が、前記管理対象の表データに対し、所定の基準値以上に更新頻度の高いフィールドについてはインデクス作成の対象から除外し、それ以外の所定の基準値未満に更新頻度の低いフィールドについてはインデクス作成対象として、インデクスを作成するステップと、
コンピュータが備える検索手段が、指示された探索条件が前記所定の基準値未満に更新頻度の低いフィールドについての探索条件を含む場合は、前記インデクスを利用した探索を行なうステップと
を備えることを特徴とする複数列の表データにおけるインデクス分割管理方法。
An index partition management method for managing table data having a plurality of fields (columns) on a computer,
The index creation means provided in the computer excludes fields with a higher update frequency than the predetermined reference value from the management target table data from the index generation target, and updates the update frequency below the other predetermined reference value. For low fields, the index creation target is an index creation step;
The search means included in the computer includes a step of performing a search using the index when the instructed search condition includes a search condition for a field with a low update frequency less than the predetermined reference value. Index division management method for multi-column table data.
請求項1に記載の複数列の表データにおけるインデクス分割管理方法において、
コンピュータが備える更新手段が、
指示された更新条件が前記所定の基準値未満に更新頻度の低いフィールドについての更新条件を含む場合は、前記フィールドの更新を行なった後に前記インデクスを再作成するステップと、
前記指示された更新条件が前記所定の基準値以上に更新頻度の高いフィールドについての更新条件のみを含む場合は、前記フィールドの更新のみを行なうステップと、
を備えることを特徴とする複数列の表データにおけるインデクス分割管理方法。
The index partition management method for table data of a plurality of columns according to claim 1,
The updating means provided in the computer is
If the instructed update condition includes an update condition for a field with a low update frequency less than the predetermined reference value, re-creating the index after updating the field;
If the instructed update condition includes only an update condition for a field having a higher update frequency than the predetermined reference value, only updating the field; and
An index division management method for table data of a plurality of columns, comprising:
JP2006186648A 2006-07-06 2006-07-06 Index division management method for table data with multiple columns Pending JP2008015810A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006186648A JP2008015810A (en) 2006-07-06 2006-07-06 Index division management method for table data with multiple columns

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006186648A JP2008015810A (en) 2006-07-06 2006-07-06 Index division management method for table data with multiple columns

Publications (1)

Publication Number Publication Date
JP2008015810A true JP2008015810A (en) 2008-01-24

Family

ID=39072755

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006186648A Pending JP2008015810A (en) 2006-07-06 2006-07-06 Index division management method for table data with multiple columns

Country Status (1)

Country Link
JP (1) JP2008015810A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9594785B2 (en) 2010-12-16 2017-03-14 Nec Corporation Database management device and database management method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63201716A (en) * 1987-02-17 1988-08-19 Nec Corp Index maintenances system
JPH052515A (en) * 1991-06-26 1993-01-08 Hitachi Ltd Optimized reorganization system for data base
JPH06215037A (en) * 1993-01-18 1994-08-05 Fuji Xerox Co Ltd Automatic updating device for index
JP2002259442A (en) * 2001-02-28 2002-09-13 Fujitsu Ltd Database search method and recording medium
JP2003296349A (en) * 2002-04-03 2003-10-17 Mitsubishi Electric Corp Data retrieval device and update method by server
JP2004110219A (en) * 2002-09-17 2004-04-08 Hitachi Ltd Data processing system and join processing method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63201716A (en) * 1987-02-17 1988-08-19 Nec Corp Index maintenances system
JPH052515A (en) * 1991-06-26 1993-01-08 Hitachi Ltd Optimized reorganization system for data base
JPH06215037A (en) * 1993-01-18 1994-08-05 Fuji Xerox Co Ltd Automatic updating device for index
JP2002259442A (en) * 2001-02-28 2002-09-13 Fujitsu Ltd Database search method and recording medium
JP2003296349A (en) * 2002-04-03 2003-10-17 Mitsubishi Electric Corp Data retrieval device and update method by server
JP2004110219A (en) * 2002-09-17 2004-04-08 Hitachi Ltd Data processing system and join processing method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9594785B2 (en) 2010-12-16 2017-03-14 Nec Corporation Database management device and database management method

Similar Documents

Publication Publication Date Title
US8626717B2 (en) Database backup and restore with integrated index reorganization
US9195657B2 (en) Columnar storage of a database index
CN100458779C (en) Index and its extending and searching method
JP2019530068A (en) Table incremental clustering maintenance
JP5427640B2 (en) Decision tree generation apparatus, decision tree generation method, and program
US11269954B2 (en) Data searching method of database, apparatus and computer program for the same
JP6982049B2 (en) Methods, equipment, equipment and storage media for managing indexes
US20170046394A1 (en) Fast incremental column store data loading
JP6642435B2 (en) Data processing device, data processing method, and program
US10733218B2 (en) System, method, and program for aggregating data
JP2008198237A (en) Structured document management system
KR101693108B1 (en) Database read method and apparatus using t-tree index for improving read performance
JP2008015810A (en) Index division management method for table data with multiple columns
KR101992631B1 (en) File indexing apparatus and method thereof using asynchronous method
KR100667741B1 (en) Indexing method of feature vector data space
KR101656077B1 (en) System and method for time base partitioning using implicit time column value
KR101679011B1 (en) Method and Apparatus for moving data in DBMS
US9928274B2 (en) Dynamically adjust duplicate skipping method for increased performance
JP2007048318A (en) Relational database processing method and relational database processor
US20150269253A1 (en) Information processing device
KR102568662B1 (en) Zipper compaction method and apparatus for compacting the plural of skiplists
JP2014130498A (en) Device and method for presenting facet
JP2018081603A (en) Kv data structure conversion device, kv data structure conversion method, and kv data structure conversion program
Antoine et al. Accelerating spatial join operations using bit-indices
JP2007323153A (en) Index file retrieving device, retrieving method, retrieval program and recording medium with its program recorded

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090119

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110714

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110805

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20120210