JP2013242674A - Database control device, b-tree index processing method, and program - Google Patents

Database control device, b-tree index processing method, and program Download PDF

Info

Publication number
JP2013242674A
JP2013242674A JP2012115104A JP2012115104A JP2013242674A JP 2013242674 A JP2013242674 A JP 2013242674A JP 2012115104 A JP2012115104 A JP 2012115104A JP 2012115104 A JP2012115104 A JP 2012115104A JP 2013242674 A JP2013242674 A JP 2013242674A
Authority
JP
Japan
Prior art keywords
prefix
index
key
record
search
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
JP2012115104A
Other languages
Japanese (ja)
Inventor
Makoto Onizuka
真 鬼塚
Kota Tsuyuzaki
浩太 露崎
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 JP2012115104A priority Critical patent/JP2013242674A/en
Publication of JP2013242674A publication Critical patent/JP2013242674A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To reduce frequency of random key insertion operation in a B-tree index of each database control device while dispersing loads in a plurality of database control devices to an access into which new record groups are continuously inserted.SOLUTION: A database control device which stores data in a storage unit includes: prefix generation means for generating a prefix to be given to a key of a B-tree index stored in the storge unit of the data control device, by using a registration record and registrant information of the record as input, when registering the record in a database; index registration means for registering the registration record in the B-tree index by using a synthetic key in which the prefix is given to the key of the B-tree index; and index retrieval means for performing retrieval to the B-tree index by using the synthetic key as a retrieval key for input when retrieving the B-tree index.

Description

本発明は、複数のデータベース管理装置を分散構成した分散データベース装置の中で分散方式がハッシュ分散方式である分散データベース装置において、データベース管理装置がBtreeインデックスを利用する方式を対象とした技術に関するものである。   The present invention relates to a technique for a method in which a database management device uses a Btree index in a distributed database device in which a distribution method is a hash distribution method among distributed database devices in which a plurality of database management devices are distributed. is there.

従来の分散データベース装置では、新規レコードが挿入された際に、まず複数あるデータベース管理装置の中からそのレコードを管理するデータベース管理装置を割り当てる(ルーティングする)。   In a conventional distributed database device, when a new record is inserted, a database management device that manages the record is first assigned (routed) from among a plurality of database management devices.

そして、割り当てられたデータベース管理装置では、挿入されたレコードを格納する際に、インデックス構築を指定されたレコードのキーを用いて、Btreeインデックスにレコードを挿入する。   Then, in the assigned database management device, when storing the inserted record, the record is inserted into the Btree index by using the key of the record designated for index construction.

分散方式がハッシュ分散方式である場合、負荷分散をするためルーティングの際にレコードの特定のカラム値のハッシュ値を利用する。例えば、メールサービスやblog システムのケースでは、利用者IDのハッシュ値を利用することで利用者ごとにデータを分散する例が挙げられる。   When the distribution method is a hash distribution method, a hash value of a specific column value of a record is used at the time of routing for load distribution. For example, in the case of a mail service or blog system, an example of distributing data for each user by using a hash value of a user ID is given.

また、データベース管理装置におけるBtreeインデックスの性能特性として、ランダムなインデックスのキーの挿入操作はディスク装置においてランダムアクセスが発生して性能が低下するのに対して、シーケンシャルなキーの挿入操作はディスク装置においてシーケンシャルアクセスになるためより性能が高いことが知られている。このことを図7に示している。   In addition, as a performance characteristic of Btree index in the database management device, random index key insertion operation causes random access in the disk device and the performance deteriorates, whereas sequential key insertion operation in the disk device It is known that the performance is higher because of sequential access. This is illustrated in FIG.

上述した従来技術の性能上の特性を踏まえた、分散データベースの設計方針は以下のようになる。   The design policy of the distributed database based on the above-mentioned performance characteristics of the prior art is as follows.

・分散データベース装置全体での性能を負荷分散の観点から向上させるため、各データベース管理装置に挿入されるレコードを均等に割り当てるように、ハッシュに基づいてデータを分散する。   In order to improve the performance of the entire distributed database apparatus from the viewpoint of load distribution, the data is distributed based on the hash so that the records to be inserted into each database management apparatus are evenly allocated.

・各データベース管理装置においては、Btreeの性能を向上させるため、シーケンシャルなキーの挿入操作が多くなるように挿入レコードのインデックスキーを設計する。   In each database management device, in order to improve the performance of Btree, the index key of the insertion record is designed so that the sequential key insertion operation increases.

しかし、ハッシュ分散方式を用いる分散データベース装置においては、上記の2点は両立が難しい。その理由は、一般的に分散の際にハッシュの入力キーをBtree のキーとして利用するため、複数のデータベース管理装置においてレコードが均等に分散されるキーを用いる場合は、各データベース管理装置のBtreeにおいてランダムなインデックスのキーの挿入操作が生じてしまうためである。   However, in the distributed database device using the hash distribution method, it is difficult to satisfy both of the above two points. The reason is that, in general, the hash input key is used as the Btree key during distribution, so when using a key in which records are evenly distributed among multiple database management devices, the Btree of each database management device This is because a random index key insertion operation occurs.

例えば、メールサービスやblogシステムのケースにおいて、利用者IDをキーとしてそのハッシュ値によって分散するデータベース管理装置にルーティングを行い、各データベース装置のBtree では利用者IDをキーとする場合、複数の異なる利用者によるレコードの挿入操作によって、ディスク装置においてランダムアクセスが多発してBtreeインデックスの性能が劣化するという問題が生じる。   For example, in the case of a mail service or blog system, when routing is performed to a database management device distributed by the hash value using the user ID as a key, and the user ID is used as a key in the Btree of each database device, multiple different uses As a result of the record insertion operation by the user, there is a problem that random access frequently occurs in the disk device and the performance of the Btree index deteriorates.

一方、各データベース管理装置のBtreeにおいてシーケンシャルなインデックスのキーの挿入操作が行われるようなキーを用いる場合は、複数のデータベース管理装置において複数レコードが連続的に同一のデータベース管理装置に割り当てられてしまい、負荷が分散しないという問題が生じてしまう。   On the other hand, when using a key that allows a sequential index key insertion operation to be performed in the Btree of each database management device, multiple records are continuously assigned to the same database management device in multiple database management devices. The problem that the load is not distributed arises.

Modern B-Tree Techniques, Goetz Graefe (著), 出版社: Now Publishers (2011/08) , ISBN-10: 1601984820 , ISBN-13: 978-1601984821Modern B-Tree Techniques, Goetz Graefe (Author), Publisher: Now Publishers (2011/08), ISBN-10: 1601984820, ISBN-13: 978-1601984821

本発明は上記の点に鑑みてなされたものであり、新規レコード群が連続的に挿入されるアクセスに対して、複数のデータベース管理装置における負荷を分散すると同時に、各データベース管理装置のBtreeインデックスにおけるランダムなキーの挿入操作回数を削減することで高速なレコード挿入を実現する、ハッシュ分散方式の分散データベース装置におけるデータベース管理装置を提供することを目的とする。   The present invention has been made in view of the above points, and for the access in which a new record group is continuously inserted, the load on a plurality of database management devices is distributed and at the same time the Btree index of each database management device. It is an object of the present invention to provide a database management apparatus in a distributed database apparatus using a hash distribution method, which realizes high-speed record insertion by reducing the number of random key insertion operations.

上記の課題を解決するために、本発明は、データを記憶装置に格納するデータベース管理装置であって、
データベースにレコードを登録する際に、登録レコードおよびレコードの登録者情報を入力として、前記データベース管理装置の記憶装置に格納されるBtreeインデックスのキーに付与するプレフィックスを生成するプレフィックス生成手段と、
Btreeインデックスのキーに前記プレフィックスを付与した合成キーを用いて登録レコードをBtreeインデックスに登録するインデックス登録手段と、
Btreeインデックスを検索する際に、検索キーとして合成キーを入力として、Btree インデックスに対する検索を行うインデックス検索手段と、を有するデータベース管理装置として構成される。
In order to solve the above problems, the present invention provides a database management apparatus for storing data in a storage device,
When registering a record in a database, a prefix generation means for generating a prefix to be given to a key of a Btree index stored in a storage device of the database management device, using a registration record and registrant information of the record as input,
Index registration means for registering a registration record in a Btree index using a composite key with the prefix added to the key of the Btree index;
When a Btree index is searched, the database management apparatus includes index search means for searching the Btree index using a synthetic key as a search key.

また、本発明は、データを記憶装置に格納するデータベース管理装置であって、
データベースにレコードを登録する際に、登録レコードおよびレコードの登録者情報を入力として、前記データベース管理装置の記憶装置に格納されるBtreeインデックスのキーに付与するプレフィックスを生成する登録時用のプレフィックス生成手段と、
Btreeインデックスのキーに、前記登録時用のプレフィックス生成手段により生成されたプレフィックスを付与した合成キーを用いて登録レコードをBtreeインデックスに登録するインデックス登録手段と、
Btreeインデックスを検索する際に、検索キーおよび検索対象の登録者情報を入力として、プレフィックスを生成する検索時用のプレフィックス生成手段と、
前記検索キーに、前記検索時用のプレフィックス生成手段により生成されたプレフィックスを付与した合成キーを用いてBtreeインデックスに対する検索を行うインデックス検索手段と、を有するデータベース管理装置として構成してもよい。
The present invention is also a database management device for storing data in a storage device,
When registering a record in the database, the registration generation and the registrant information of the record are input, and a prefix generation means for registration is generated that generates a prefix to be added to the key of the Btree index stored in the storage device of the database management device When,
Index registration means for registering a registration record in a Btree index using a composite key in which a prefix generated by the prefix generation means for registration is added to the key of the Btree index;
When searching a Btree index, a search key and a search target registrant information as input, and a prefix generation means for search that generates a prefix,
You may comprise as a database management apparatus which has an index search means which searches with respect to a Btree index using the synthetic | combination key which provided the prefix produced | generated by the said prefix generation means for the said search key to the said search key.

前記プレフィックス生成手段は、登録される複数レコードにおいて、プレフィックスを付与して得られる合成キーがBtreeインデックスにおいて連続するように、プレフィックスを生成するように構成される。   The prefix generation means is configured to generate a prefix so that a composite key obtained by adding a prefix in a plurality of registered records is continuous in a Btree index.

また、前記プレフィックス生成手段は、登録されるレコード群において、インデックスに登録するキーをクラスタ化し、各クラスタにIDを割り当て、得られたクラスタIDをプレフィックスとして生成するように構成してもよい。   The prefix generation means may be configured to cluster keys registered in an index in a record group to be registered, assign an ID to each cluster, and generate the obtained cluster ID as a prefix.

また、本発明は、前記データベース管理装置が実行するBtreeインデックス処理方法として構成してもよく、更に、コンピュータを、前記データベース管理装置における各手段として機能させるためのプログラムとして構成することもできる。   In addition, the present invention may be configured as a Btree index processing method executed by the database management apparatus, and may further be configured as a program for causing a computer to function as each unit in the database management apparatus.

本発明によれば、新規レコード群が連続的に挿入されるアクセスに対して、複数のデータベース管理装置における負荷を分散すると同時に、各データベース管理装置のBtreeインデックスにおけるランダムなキーの挿入操作回数を削減することで高速なレコード挿入を実現する、ハッシュ分散方式の分散データベース装置におけるデータベース管理装置を提供することが可能となる。   According to the present invention, for accesses in which new record groups are continuously inserted, the load on a plurality of database management devices is distributed, and at the same time, the number of random key insertion operations in the Btree index of each database management device is reduced. By doing so, it is possible to provide a database management apparatus in a distributed database apparatus of the hash distribution system that realizes high-speed record insertion.

本発明の実施の形態におけるデータベース管理装置10の構成図である。It is a block diagram of the database management apparatus 10 in embodiment of this invention. 本発明の実施の形態におけるレコード登録操作の制御フローを説明する図である。It is a figure explaining the control flow of record registration operation in an embodiment of the invention. 本発明の実施の形態におけるレコード検索操作の制御フローを説明する図である。It is a figure explaining the control flow of the record search operation in embodiment of this invention. プレフィックス生成手段21、31の処理フローを示す図である。It is a figure which shows the processing flow of the prefix production | generation means 21 and 31. FIG. ツイートデータ管理における第一の具体例を示す図である。It is a figure which shows the 1st specific example in tweet data management. ツイートデータ管理における第二の具体例を示す図である。It is a figure which shows the 2nd specific example in tweet data management. Btreeインデックスの性能特性を示すグラフである。It is a graph which shows the performance characteristic of a Btree index.

以下、図面を参照して本発明の実施の形態を説明する。なお、以下で説明する実施の形態は一例に過ぎず、本発明が適用される実施の形態は、以下の実施の形態に限られるわけではない。   Embodiments of the present invention will be described below with reference to the drawings. The embodiment described below is only an example, and the embodiment to which the present invention is applied is not limited to the following embodiment.

(実施の形態の概要)
まず、本発明の実施の形態の概要について説明する。本実施の形態では、データベース管理装置のBtreeインデックスにおいて、インデックスに挿入する複数レコードに共通する値を算出して、その値をインデックスのキー値にプレフィックスとして付与した合成キーを作成し、合成キーを用いてレコードをインデックス登録する。
(Outline of the embodiment)
First, an outline of an embodiment of the present invention will be described. In the present embodiment, in the Btree index of the database management device, a value common to a plurality of records to be inserted into the index is calculated, and a composite key in which the value is added as a prefix to the index key value is created, and the composite key is Use to index records.

この構成により、レコード群が連続して挿入される操作に対して、従来のデータベース管理装置のBtree インデックスよりも、ランダムなキーの挿入操作回数を削減することができる。   With this configuration, it is possible to reduce the number of random key insertion operations compared to the conventional Btree index of a database management apparatus for operations in which record groups are continuously inserted.

Btreeに対する検索を行う際には、検索キーとして合成キーを入力して検索を実行してもよいし、検索キーおよび検索対象の登録者情報を入力として、プレフィックス生成手段によりプレフィックスを得ることで正確なインデックス検索を実現することとしてもよい。   When searching for a Btree, the search may be performed by entering a composite key as a search key, or by using the search key and registrant information to be searched as input and obtaining a prefix by means of prefix generation. It is also possible to realize a simple index search.

本実施の形態において、上記プレフィックス生成手段では、登録される複数レコードにおいて、プレフィックスを付与して得られる合成キーがBtreeインデックスにおいて連続するように、プレフィックスを生成する。   In the present embodiment, the prefix generation means generates a prefix so that a composite key obtained by adding a prefix in a plurality of registered records is continuous in a Btree index.

複数レコードをBtreeインデックスに連続的に登録する際に、このプレフィックスをキーに付与した合成キーを用いてインデックス登録することによって、ランダムなキーの挿入操作回数を削減することができる。   When a plurality of records are continuously registered in the Btree index, the number of random key insertion operations can be reduced by registering the index using a composite key with the prefix added to the key.

また、上記プレフィックス生成手段は、Btreeインデックスを検索する際には、検索キーおよび検索対象の登録者情報を入力としてプレフィックスを導出し、検索キーにプレフィックスを付与した合成キーを用いることによって、Btreeインデックスに対する検索を正確に行うことができる。   In addition, when searching for a Btree index, the prefix generation means derives a prefix by using a search key and registrant information to be searched as input, and uses a composite key in which the prefix is added to the search key. Can be accurately searched.

従って、大量のレコード群が挿入されるアクセスに対して、複数のデータベース管理装置における負荷を分散すると同時に、各データベース管理装置のBtreeインデックスにおけるランダムなキーの挿入操作回数を削減することで、高速なレコード挿入を実現することができるようになる。   Therefore, for accesses to which a large number of record groups are inserted, the load on a plurality of database management devices is distributed, and at the same time, the number of random key insertion operations in the Btree index of each database management device is reduced, thereby achieving high speed Record insertion can be realized.

(実施の形態の詳細)
以下、図面を参照しながら、本発明の実施の形態を詳細に説明する。
(Details of the embodiment)
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

<装置構成>
図1に、本実施の形態に係るデータベース管理装置10の機能構成図を示す。図1に示すように、本実施の形態におけるデータベース管理装置10は、レコード登録部11、レコード検索部12、レコード管理部13、プレフィックス生成ルール管理部14を備える。なお、本実施の形態のデータベース管理装置10は、複数のデータベース管理装置を分散配置した分散データベース装置(システム)を構成する1つのデータベース管理装置である。
<Device configuration>
FIG. 1 shows a functional configuration diagram of the database management apparatus 10 according to the present embodiment. As shown in FIG. 1, the database management apparatus 10 in the present embodiment includes a record registration unit 11, a record search unit 12, a record management unit 13, and a prefix generation rule management unit 14. The database management apparatus 10 of this embodiment is a single database management apparatus that constitutes a distributed database apparatus (system) in which a plurality of database management apparatuses are distributed and arranged.

データ操作者は分散データベース管理装置を介して、データベース管理装置10に登録命令または検索命令を入力する。なお、図1では分散データベース管理装置の記載を省略している。   The data operator inputs a registration command or a search command to the database management device 10 via the distributed database management device. In FIG. 1, the description of the distributed database management apparatus is omitted.

レコード登録部11は、データ操作者からの登録命令を処理する機能部である。レコード検索部12は、データ操作者からの検索命令を処理する機能部である。レコード管理部13は、主記憶およびハードディスク装置に対してレコード群を格納するデータベースおよびレコード群に対して構築したBtreeインデックスを備える。Btreeはレコード群のキーを指定して構築するため、同一のレコード群に対して異なるキーで複数のBtreeインデックスを構築しても良い。   The record registration unit 11 is a functional unit that processes a registration command from the data operator. The record search unit 12 is a functional unit that processes a search command from the data operator. The record management unit 13 includes a database for storing record groups in the main memory and the hard disk device, and a Btree index constructed for the record groups. Since a Btree is constructed by specifying a key of a record group, a plurality of Btree indexes may be constructed with different keys for the same record group.

プレフィックス生成ルール管理部14は、Btreeインデックス毎にプレフィックスをどのように生成するかを定義したルールを保持し、管理する。   The prefix generation rule management unit 14 holds and manages a rule that defines how a prefix is generated for each Btree index.

本実施の形態に係るデータベース管理装置10は、CPU、メモリ、及びハードディスク等を備えるコンピュータに、各機能部の処理に対応するプログラムを実行させることにより実現可能である。当該プログラムは、可搬メモリ等の記憶媒体に格納して配布し、上記コンピュータにインストールして用いてもよいし、ネットワーク上のサーバからダウンロードして上記コンピュータにインストールしてもよい。   The database management apparatus 10 according to the present embodiment can be realized by causing a computer including a CPU, a memory, a hard disk, and the like to execute a program corresponding to the processing of each functional unit. The program may be stored in a storage medium such as a portable memory and distributed, installed on the computer, or downloaded from a server on a network and installed on the computer.

<装置の詳細構成及び動作>
以下、本実施の形態に係るデータベース管理装置10の構成及び動作をより詳細に説明する。
<Detailed configuration and operation of the device>
Hereinafter, the configuration and operation of the database management apparatus 10 according to the present embodiment will be described in more detail.

図2を参照して、本実施の形態のデータベース管理装置10におけるレコード登録操作の制御フローを説明する。図2に示すように、レコード登録部11は、プレフィックス生成手段21とインデックス登録手段22を含む。   With reference to FIG. 2, the control flow of the record registration operation in the database management apparatus 10 of this Embodiment is demonstrated. As shown in FIG. 2, the record registration unit 11 includes a prefix generation unit 21 and an index registration unit 22.

まず、クライアントプログラム20を介して、データ操作者はレコード登録操作をデータベース管理装置10に入力する(ステップ21)。   First, the data operator inputs a record registration operation to the database management apparatus 10 via the client program 20 (step 21).

登録命令は、登録レコードおよびレコードを登録した登録者情報を含む。データベース管理装置10に入力された登録命令は、レコード登録部11のプレフィックス生成手段21およびインデックス登録手段22に入力される(ステップ22)。   The registration command includes a registration record and registrant information that registered the record. The registration command input to the database management apparatus 10 is input to the prefix generation unit 21 and the index registration unit 22 of the record registration unit 11 (step 22).

プレフィックス生成手段21は、入力された登録レコードの情報を用いて本登録操作に関わるBtreeインデックスを特定して、該当のBtreeインデックスに関するプレフィックス生成ルールを、プレフィックス生成ルール管理部14から取得する(ステップ23、24)。プレフィックス生成ルール管理部14では、各Btree毎に、登録レコードあるいはレコードの登録者情報を入力してプレフィックスを出力するプレフィックス生成ルールを保持している。   The prefix generation unit 21 specifies the Btree index related to the main registration operation using the input registration record information, and acquires the prefix generation rule regarding the corresponding Btree index from the prefix generation rule management unit 14 (step 23). 24). The prefix generation rule management unit 14 holds a prefix generation rule for inputting a registration record or registrant information of a record and outputting a prefix for each Btree.

プレフィックス生成手段21は、得られたプレフィックス生成ルールに登録レコード、レコードの登録者情報を適用することでプレフィックスを生成・出力する(ステップ25)。   The prefix generation unit 21 generates and outputs a prefix by applying the registration record and the registrant information of the record to the obtained prefix generation rule (step 25).

インデックス登録手段22は、入力された登録レコードおよびプレフィックスから合成キーを導出して、この合成キーを用いてレコード管理部13に格納されているインデックスおよびデータベースに登録レコードを登録する(ステップ26)。   The index registration means 22 derives a composite key from the input registration record and prefix, and registers the registration record in the index and database stored in the record management unit 13 using this composite key (step 26).

次に、図3を参照して、本実施の形態のデータベース管理装置10におけるレコード検索操作の制御フローを説明する。図3に示すように、レコード検索部12は、プレフィックス生成手段31とインデックス検索手段32を含む。なお、レコード検索部12が、プレフィックス生成手段31を備える代わりに、レコード検索部12が、レコード登録部11のプレフィックス生成手段21を利用することとしてもよい。   Next, with reference to FIG. 3, the control flow of the record search operation in the database management apparatus 10 of this embodiment will be described. As shown in FIG. 3, the record search unit 12 includes a prefix generation unit 31 and an index search unit 32. Note that the record search unit 12 may use the prefix generation unit 21 of the record registration unit 11 instead of the record search unit 12 including the prefix generation unit 31.

クライアントプログラム20を介して、データ操作者はレコード検索命令をデータベース管理装置10に入力する(ステップ31)。検索命令は、検索キー、検索対象の登録者情報を含む。   A data operator inputs a record search command to the database management apparatus 10 via the client program 20 (step 31). The search command includes a search key and search target registrant information.

データベース管理装置10に入力された検索命令は、レコード検索部12のプレフィックス生成手段31およびインデックス検索手段32に入力される(ステップ32)。プレフィックス生成手段31は、入力された検索キーの情報を用いて本検索命令に関わる Btreeインデックスを特定して、該当のBtreeインデックスに関するプレフィックス生成ルールを、プレフィックス生成ルール管理部14から取得する(ステップ33、34)。プレフィックス生成ルール管理部14はまた、各Btree毎に、検索キーおよび検索対象の登録者情報を入力してプレフィックスを出力するプレフィックス生成ルールを保持している。   The search command input to the database management apparatus 10 is input to the prefix generation unit 31 and the index search unit 32 of the record search unit 12 (step 32). The prefix generation unit 31 specifies the Btree index related to this search command using the input search key information, and acquires the prefix generation rule related to the corresponding Btree index from the prefix generation rule management unit 14 (step 33). 34). The prefix generation rule management unit 14 also holds a prefix generation rule that inputs a search key and search target registrant information and outputs a prefix for each Btree.

プレフィックス生成手段31は、得られたプレフィックス生成ルールに検索キー、検索対象の登録者情報を適用することでプレフィックスを生成・出力する(ステップ35)。   The prefix generation unit 31 generates and outputs a prefix by applying a search key and search target registrant information to the obtained prefix generation rule (step 35).

インデックス検索手段32は、入力された検索キーおよびプレフィックスから合成キーを導出して、この合成キーを用いてレコード管理部13に格納されているインデックスに対して検索命令を発行し(ステップ36)、検索結果レコードを取得する(ステップ37)。   The index search means 32 derives a composite key from the input search key and prefix, and issues a search command to the index stored in the record management unit 13 using this composite key (step 36). A search result record is acquired (step 37).

結果として得られた検索結果レコードは、クライアントプログラム20を介してデータ操作者に返却される(ステップ38)。   The search result record obtained as a result is returned to the data operator via the client program 20 (step 38).

なお、プレフィックス生成手段31を備えずに、検索キーとして合成キーを入力し、この合成キーを用いてインデックス検索手段32が検索を行うようにしてもよい。   Instead of providing the prefix generation means 31, a composite key may be input as a search key, and the index search means 32 may perform a search using this composite key.

次に、図4を参照して、プレフィックス生成手段21、31の処理フローを説明する。   Next, the processing flow of the prefix generation means 21 and 31 will be described with reference to FIG.

レコード登録時に対応するプレフィックス生成手段21は、ステップ41において、入力された登録レコードの情報を用いて、本登録操作に関わるBtreeインデックスを特定する。そして、該当のBtreeインデックスに関するプレフィックス生成ルールを、プレフィックス生成ルール管理部14から取得する。   In step 41, the prefix generation means 21 corresponding to the record registration specifies the Btree index related to the main registration operation using the input registration record information. Then, a prefix generation rule regarding the corresponding Btree index is acquired from the prefix generation rule management unit 14.

ステップ42では、プレフィックス生成手段21は、登録レコードとレコードの登録者情報を用いて、ステップ41で特定したプレフィックス生成ルールを適用して、プレフィックスを出力する。   In step 42, the prefix generation means 21 applies the prefix generation rule specified in step 41 using the registration record and the registrant information of the record, and outputs the prefix.

レコード検索時に対応するプレフィックス生成手段31は、ステップ41において、検索キーの情報を用いて、本検索操作に関わるBtreeインデックスを特定する。そして、該当のBtreeインデックスに関するプレフィックス生成ルールを、プレフィックス生成ルール管理部から取得する。   In step 41, the prefix generation means 31 corresponding to the record search specifies the Btree index related to the main search operation using the search key information. Then, a prefix generation rule regarding the corresponding Btree index is acquired from the prefix generation rule management unit.

ステップ42では、プレフィックス生成手段31は、検索キーと検索対象の登録者情報を用いて、ステップ41で特定したプレフィックス生成ルールを適用して、プレフィックスを出力する。   In step 42, the prefix generation means 31 applies the prefix generation rule specified in step 41 using the search key and search target registrant information, and outputs a prefix.

(具体例)
以下、図面を参照して、具体例を説明する。
(Concrete example)
Hereinafter, specific examples will be described with reference to the drawings.

図5はツイート(登録商標)データ管理における第一の具体例を示す図である(以下の説明に記載された「ツイート」は登録商標である)。図5に示すように、本具体例におけるデータベーススキーマは、
(ツイートID,ツイート作成者ID,timezone,timestamp,ツイート内容,{ハッシュタグ},…)
なるテーブル構造であり、ツイートIDが主キーである。また、Btreeインデックスは1つ構築されており、そのキーは (ツイート作成者ID,ツイートID)のマルチカラムインデックスになっている。
FIG. 5 is a diagram showing a first specific example in tweet (registered trademark) data management (“tweet” described in the following description is a registered trademark). As shown in FIG. 5, the database schema in this example is
(Tweet ID, tweet creator ID, timezone, timestamp, tweet content, {hashtag},…)
The tweet ID is the primary key. One Btree index is built, and its key is a multi-column index of (tweet creator ID, tweet ID).

この例ではプレフィックスとして、ツイート作成者が属するtimezoneを用いる。この際のプレフィックス生成ルールは、
・レコード登録時にはレコードの登録者情報からtimezoneを抽出
・レコード検索時には検索対象の登録者情報からtimezoneを抽出
するというルールになる。
In this example, the timezone to which the tweet creator belongs is used as a prefix. The prefix generation rule at this time is
-When registering a record, the time zone is extracted from the registrant information of the record.-When searching for a record, the time zone is extracted from the registrant information to be searched.

この結果、プレフィックスをインデックスのキーに付与して得られる合成キーは、
(timezone +ツイート作成者ID,ツイートID)
となる。ここで "+" はtimezoneの文字の値とツイート作成者IDの値を連結する操作である。こうして得られる合成キーを用いて、レコード登録時にはインデックスにレコードを登録する。
As a result, the composite key obtained by adding the prefix to the index key is
(timezone + Tweet creator ID, Tweet ID)
It becomes. Here, "+" is an operation that concatenates the timezone character value and the tweet creator ID value. A record is registered in the index when registering a record using the synthetic key thus obtained.

一方、レコードの検索時には合成キーを用いて、インデックスを利用してレコード検索を実行する。例えば、以下の二つの検索命令
検索命令1: 検索キー= (ツイート作成者ID)
検索命令2: 検索キー= (ツイート作成者ID,ツイートID)
は、合成キーを用いて
検索命令1: 合成キー = (timezone + ツイート作成者ID)
検索命令2: 合成キー = (timezone + ツイート作成者ID,ツイートID)
と変換されて、インデックスを利用してレコード検索を実行する。
On the other hand, when searching for a record, a record search is executed using an index using a composite key. For example, the following two search commands Search command 1: Search key = (tweet creator ID)
Search command 2: Search key = (tweet creator ID, tweet ID)
Search command 1: Composite key = (timezone + Tweet creator ID)
Search instruction 2: Composite key = (timezone + Tweet creator ID, Tweet ID)
And record search is performed using the index.

図6はツイートデータ管理における第二の具体例を示す図である。第二の具体例において、図5と異なる点はプレフィックスの箇所である。本例では、プレフィックスとして、あらかじめ利用者をクラスタ化して複数の利用者が属するコミュニティを抽出し、各コミュニティにIDを付与しておく。このコミュニティIDをレコードの登録者情報あるいは検索対象の登録者情報に加えておくことで、図5のtimezoneと同様にプレフィックスとしてコミュニティIDを利用する例になっている。   FIG. 6 is a diagram showing a second specific example in tweet data management. In the second specific example, the difference from FIG. 5 is the location of the prefix. In this example, as a prefix, users are clustered in advance to extract communities to which a plurality of users belong, and IDs are assigned to the communities. By adding this community ID to the registrant information of the record or the registrant information to be searched, the community ID is used as a prefix as in the time zone of FIG.

(実施の形態のまとめ、効果)
以上説明したように、プレフィックスを加えた合成キーを用いてBtreeインデックスにレコードを登録することによって、例えばツイートデータ管理では東京といった同一 timezoneに属する複数利用者から登録されたレコード群についてシーケンシャルなキーの挿入操作になる。この結果、複数のデータベース管理装置における負荷を分散すると同時に、インデックスに対するレコード登録操作がディスク装置においてシーケンシャルアクセスになり、その結果高速なレコード登録を実現することができる。
(Summary of the embodiment, effects)
As described above, by registering a record in the Btree index using a composite key with a prefix added, for example, in tweet data management, sequential keys of records registered from multiple users belonging to the same timezone such as Tokyo are registered. It becomes an insert operation. As a result, the load in the plurality of database management devices is distributed, and at the same time, the record registration operation for the index becomes a sequential access in the disk device, and as a result, high-speed record registration can be realized.

本発明は、上記の実施の形態に限定されることなく、特許請求の範囲内において、種々変更・応用が可能である。   The present invention is not limited to the above-described embodiments, and various modifications and applications are possible within the scope of the claims.

10 データベース管理装置
11 レコード登録部
12 レコード検索部
13 レコード管理部
14 プレフィックス生成ルール管理部
21、31 プレフィックス生成手段
22 インデックス登録手段
32 インデックス検索手段
DESCRIPTION OF SYMBOLS 10 Database management apparatus 11 Record registration part 12 Record search part 13 Record management part 14 Prefix generation rule management parts 21 and 31 Prefix generation means 22 Index registration means 32 Index search means

Claims (7)

データを記憶装置に格納するデータベース管理装置であって、
データベースにレコードを登録する際に、登録レコードおよびレコードの登録者情報を入力として、前記データベース管理装置の記憶装置に格納されるBtreeインデックスのキーに付与するプレフィックスを生成するプレフィックス生成手段と、
Btreeインデックスのキーに前記プレフィックスを付与した合成キーを用いて登録レコードをBtreeインデックスに登録するインデックス登録手段と、
Btreeインデックスを検索する際に、検索キーとして合成キーを入力として、Btree インデックスに対する検索を行うインデックス検索手段と、
を有するデータベース管理装置。
A database management device for storing data in a storage device,
When registering a record in a database, a prefix generation means for generating a prefix to be given to a key of a Btree index stored in a storage device of the database management device, using a registration record and registrant information of the record as input,
Index registration means for registering a registration record in a Btree index using a composite key with the prefix added to the key of the Btree index;
When searching a Btree index, an index search means for performing a search on the Btree index using a synthetic key as a search key,
A database management device.
データを記憶装置に格納するデータベース管理装置であって、
データベースにレコードを登録する際に、登録レコードおよびレコードの登録者情報を入力として、前記データベース管理装置の記憶装置に格納されるBtreeインデックスのキーに付与するプレフィックスを生成する登録時用のプレフィックス生成手段と、
Btreeインデックスのキーに、前記登録時用のプレフィックス生成手段により生成されたプレフィックスを付与した合成キーを用いて登録レコードをBtreeインデックスに登録するインデックス登録手段と、
Btreeインデックスを検索する際に、検索キーおよび検索対象の登録者情報を入力として、プレフィックスを生成する検索時用のプレフィックス生成手段と、
前記検索キーに、前記検索時用のプレフィックス生成手段により生成されたプレフィックスを付与した合成キーを用いてBtreeインデックスに対する検索を行うインデックス検索手段と、
を有するデータベース管理装置。
A database management device for storing data in a storage device,
When registering a record in the database, the registration generation and the registrant information of the record are input, and a prefix generation means for registration is generated that generates a prefix to be added to the key of the Btree index stored in the storage device of the database management device When,
Index registration means for registering a registration record in a Btree index using a composite key in which a prefix generated by the prefix generation means for registration is added to the key of the Btree index;
When searching a Btree index, a search key and a search target registrant information as input, and a prefix generation means for search that generates a prefix,
Index search means for performing a search on a Btree index using a composite key with a prefix generated by the search prefix generation means added to the search key;
A database management device.
前記プレフィックス生成手段は、登録される複数レコードにおいて、プレフィックスを付与して得られる合成キーがBtreeインデックスにおいて連続するように、プレフィックスを生成する
請求項1または2に記載のデータベース管理装置。
The database management device according to claim 1, wherein the prefix generation unit generates a prefix so that a composite key obtained by adding a prefix in a plurality of registered records is continuous in a Btree index.
前記プレフィックス生成手段は、登録されるレコード群において、インデックスに登録するキーをクラスタ化し、各クラスタにIDを割り当て、得られたクラスタIDをプレフィックスとして生成する
請求項1ないし3のうちいずれか1項に記載のデータベース管理装置。
The prefix generation unit clusters keys registered in an index in a record group to be registered, assigns an ID to each cluster, and generates the obtained cluster ID as a prefix. The database management device described in 1.
データを記憶装置に格納するデータベース管理装置が実行するBtreeインデックス処理方法であって、
データベースにレコードを登録する際に、登録レコードおよびレコードの登録者情報を入力として、前記データベース管理装置の記憶装置に格納されるBtreeインデックスのキーに付与するプレフィックスを生成するプレフィックス生成ステップと、
Btreeインデックスのキーに前記プレフィックスを付与した合成キーを用いて登録レコードをBtreeインデックスに登録するインデックス登録ステップと、
Btreeインデックスを検索する際に、検索キーとして合成キーを入力として、Btree インデックスに対する検索を行うインデックス検索ステップと、
を有するBtreeインデックス処理方法。
A Btree index processing method executed by a database management device that stores data in a storage device,
When registering a record in the database, a prefix generation step for generating a prefix to be given to a key of a Btree index stored in the storage device of the database management device, using the registration record and the registrant information of the record as input,
An index registration step of registering a registration record in the Btree index using a composite key with the prefix added to the key of the Btree index;
When searching a Btree index, an index search step for performing a search on the Btree index using a synthetic key as a search key,
Btree index processing method.
データを記憶装置に格納するデータベース管理装置が実行するBtreeインデックス処理方法であって、
データベースにレコードを登録する際に、登録レコードおよびレコードの登録者情報を入力として、前記データベース管理装置の記憶装置に格納されるBtreeインデックスのキーに付与するプレフィックスを生成する登録時のプレフィックス生成ステップと、
Btreeインデックスのキーに、前記登録時のプレフィックス生成ステップにより生成されたプレフィックスを付与した合成キーを用いて登録レコードをBtreeインデックスに登録するインデックス登録ステップと、
Btreeインデックスを検索する際に、検索キーおよび検索対象の登録者情報を入力として、プレフィックスを生成する検索時のプレフィックス生成ステップと、
前記検索キーに、前記検索時のプレフィックス生成ステップにより生成されたプレフィックスを付与した合成キーを用いてBtreeインデックスに対する検索を行うインデックス検索ステップと、
を有するBtreeインデックス処理方法。
A Btree index processing method executed by a database management device that stores data in a storage device,
When registering a record in a database, a registration prefix and a registrant information of the record are input, and a prefix generation step at the time of generating a prefix to be given to a key of a Btree index stored in the storage device of the database management device; ,
An index registration step of registering a registration record in the Btree index using a composite key in which the prefix generated by the prefix generation step at the time of registration is added to the key of the Btree index;
When searching a Btree index, using a search key and search target registrant information as input, a prefix generation step at the time of generating a prefix,
An index search step for performing a search for a Btree index using a composite key to which the prefix generated by the prefix generation step at the time of search is added to the search key;
Btree index processing method.
コンピュータを、請求項1ないし4のうちいずれか1項に記載されたデータベース管理装置における各手段として機能させるためのプログラム。   The program for functioning a computer as each means in the database management apparatus described in any one of Claims 1 thru | or 4.
JP2012115104A 2012-05-18 2012-05-18 Database control device, b-tree index processing method, and program Pending JP2013242674A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012115104A JP2013242674A (en) 2012-05-18 2012-05-18 Database control device, b-tree index processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012115104A JP2013242674A (en) 2012-05-18 2012-05-18 Database control device, b-tree index processing method, and program

Publications (1)

Publication Number Publication Date
JP2013242674A true JP2013242674A (en) 2013-12-05

Family

ID=49843510

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012115104A Pending JP2013242674A (en) 2012-05-18 2012-05-18 Database control device, b-tree index processing method, and program

Country Status (1)

Country Link
JP (1) JP2013242674A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108320396A (en) * 2017-12-28 2018-07-24 中国神华能源股份有限公司 Control method, the device and system of locker
CN112783904A (en) * 2019-11-07 2021-05-11 北京沃东天骏信息技术有限公司 Method and device for updating index data

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108320396A (en) * 2017-12-28 2018-07-24 中国神华能源股份有限公司 Control method, the device and system of locker
CN112783904A (en) * 2019-11-07 2021-05-11 北京沃东天骏信息技术有限公司 Method and device for updating index data

Similar Documents

Publication Publication Date Title
CN104765848B (en) What support result efficiently sorted in mixing cloud storage symmetrically can search for encryption method
US10282664B2 (en) Method and device for constructing event knowledge base
US8468120B2 (en) Systems and methods for tracking and reporting provenance of data used in a massively distributed analytics cloud
US9715536B2 (en) Virtualization method for large-scale distributed heterogeneous data
US11893024B2 (en) Metadata driven dataset management
JP2017512338A (en) Implementation of semi-structured data as first class database elements
US9722879B1 (en) Method and apparatus of an intuitive web based command line interface
JP5844895B2 (en) Distributed data search system, distributed data search method, and management computer
CN104572785B (en) A kind of distributed method and apparatus for creating index
WO2014030235A1 (en) Distributed database system
WO2016129259A1 (en) Server device, data search system, search method, and recording medium
Mittal et al. Privacy preserving synonym based fuzzy multi-keyword ranked search over encrypted cloud data
Choi et al. Improved performance optimization for massive small files in cloud computing environment
Xin et al. Publishing bibliographic data on the Semantic Web using BibBase
JP2013242674A (en) Database control device, b-tree index processing method, and program
KR20130097366A (en) Method and apparatus for managing data center based on ontology
Gao et al. Supporting queries and analyses of large-scale social media data with customizable and scalable indexing techniques over NoSQL databases
Xie et al. On massive spatial data retrieval based on spark
US10198558B2 (en) Data source security cluster
JP2013242675A (en) Dispersion information control device, dispersion information search method, data dispersion arrangement method and program
JP2011113103A (en) Multi-tenant type computer system
US11016946B1 (en) Method and apparatus for processing object metadata
Wang et al. Jingwei+: A distributed large-scale RDF data server
Balakrishnan et al. Extensibility of File Set Over Encoded Cloud Data Through Empowered Fine Grained Multi Keyword Search
Tang et al. mDHT: a multi-level-indexed DHT algorithm to extra-large-scale data retrieval on HDFS/Hadoop architecture