JP2016015011A - Database device, database management method, and program - Google Patents

Database device, database management method, and program Download PDF

Info

Publication number
JP2016015011A
JP2016015011A JP2014136591A JP2014136591A JP2016015011A JP 2016015011 A JP2016015011 A JP 2016015011A JP 2014136591 A JP2014136591 A JP 2014136591A JP 2014136591 A JP2014136591 A JP 2014136591A JP 2016015011 A JP2016015011 A JP 2016015011A
Authority
JP
Japan
Prior art keywords
key
record
index table
bucket
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.)
Pending
Application number
JP2014136591A
Other languages
Japanese (ja)
Inventor
健治 川合
Kenji Kawai
健治 川合
重松 智志
Satoshi Shigematsu
智志 重松
川村 智明
Tomoaki Kawamura
智明 川村
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 JP2014136591A priority Critical patent/JP2016015011A/en
Publication of JP2016015011A publication Critical patent/JP2016015011A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To configure a database of small-capacity memories dramatically improved in efficiency of use.SOLUTION: A database device can generate from key values, by using N hash functions f[n], N entry numbers each matching an N index table 2[n] (n=0 ... N-1), it can avoid in an advance collision in which N entry numbers take on the same value, store a key Keach time it is entered from outside while selecting a bucket for storing the key and allocating each key to one or other bucket, and accordingly the efficiency of use of memories by the index table can be dramatically improved over a current level.

Description

本発明は、データベース装置、データベース管理方法およびプログラムに関し、特に、データ容量の大きい大規模データベースからキーに対応したレコードを高スループットで取得するデータベース装置、データベース管理方法およびプログラムに関する。   The present invention relates to a database apparatus, a database management method, and a program, and more particularly, to a database apparatus, a database management method, and a program for acquiring a record corresponding to a key from a large-scale database having a large data capacity with high throughput.

従来、通信ネットワークを構築するノードであるイーサネット(登録商標)等のLANスイッチには、回線から受信したパケットの転送先を決定するための転送データベースを有するデータベース装置が備えられている。   Conventionally, a LAN switch such as Ethernet (registered trademark), which is a node that constructs a communication network, is provided with a database device having a transfer database for determining a transfer destination of a packet received from a line.

LANスイッチでは、送信するパケットに含まれる宛先アドレス(例えばMACアドレス)をキーとして、当該パケットの転送先(通信ネットワークの回線を指定する回線IDおよび送信ポートを指定する送信ポートID等)や当該パケットの廃棄有無の情報をデータベース装置の転送データベースから取得することが行われる。またLANスイッチでは、パケットの宛先アドレス値と、当該宛先アドレス値を持つパケットの転送先とを転送データベースに登録することが行われる。   In the LAN switch, with the destination address (for example, MAC address) included in the packet to be transmitted as a key, the transfer destination of the packet (a line ID that specifies a line of a communication network, a transmission port ID that specifies a transmission port, etc.) and the packet The information on whether or not to discard is acquired from the transfer database of the database device. In the LAN switch, the destination address value of the packet and the transfer destination of the packet having the destination address value are registered in the transfer database.

例えば、100[Gbps]の回線間でパケットを転送する際、LANスイッチは、最少パケット長が64バイトのパケットを受信する時間内に当該パケットの転送先(回線IDおよび送信ポートID等)を決定する必要があるものの、その決定までの時間は僅か約6ナノ秒である。   For example, when transferring a packet between lines of 100 [Gbps], the LAN switch determines the transfer destination (line ID, transmission port ID, etc.) of the packet within the time when a packet with a minimum packet length of 64 bytes is received. Although it needs to be done, the time to decision is only about 6 nanoseconds.

したがって、LANスイッチがパケットの転送先を決定するために許容されるクロックサイクル数は、クロック周波数が500[MHz]の場合、1サイクルが2ナノ秒であるから僅か3サイクルとなる。   Therefore, the number of clock cycles allowed for the LAN switch to determine the packet transfer destination is only 3 cycles since one cycle is 2 nanoseconds when the clock frequency is 500 [MHz].

このような短時間で転送データベースからパケットの宛先アドレスに対する転送先の情報(以下、これを「転送先情報」と呼ぶ。)を取得するための手法として、ハッシュテーブルを用いる手法がある。この手法では、ハッシュ関数を用いてパケットの宛先アドレスをハッシュテーブルのエントリ番号に変換する。   As a technique for acquiring transfer destination information (hereinafter referred to as “transfer destination information”) for a packet destination address from the transfer database in such a short time, there is a technique using a hash table. In this technique, a packet destination address is converted into a hash table entry number using a hash function.

ハッシュテーブルの各エントリには、エントリのエントリ番号に対応付けられる宛先アドレス値と、当該宛先アドレス値に対応するパケットの転送先情報とを格納しておく。   Each entry of the hash table stores a destination address value associated with the entry number of the entry and transfer destination information of a packet corresponding to the destination address value.

LANスイッチは、パケットの転送先情報を取得するとき、ハッシュ関数を用いてパケットの宛先アドレスをハッシュテーブルのエントリ番号に変換し、当該エントリ番号が示す当該ハッシュテーブルのエントリに格納された宛先アドレス値と当該パケットの宛先アドレスとが一致した場合に、当該エントリに格納された転送先情報を取得する。そしてLANスイッチは、その転送先情報に基づいてパケットの転送先を決定する。   When the LAN switch obtains the packet transfer destination information, it converts the packet destination address into the hash table entry number using a hash function, and the destination address value stored in the entry of the hash table indicated by the entry number And the destination address of the packet match, the transfer destination information stored in the entry is acquired. The LAN switch determines a packet transfer destination based on the transfer destination information.

なお、エントリに格納された宛先アドレス値と当該パケットの宛先アドレスとが一致しない場合、LANスイッチはパケットの転送先情報がハッシュテーブルに未登録であると認識し、当該パケットを可能性のある全ての転送先に対してブロードキャストする。   If the destination address value stored in the entry does not match the destination address of the packet, the LAN switch recognizes that the forwarding destination information of the packet is not registered in the hash table, and all possible packets Broadcast to the forwarding destination.

上述したようなハッシュテーブルを用いる手法では、異なる2個以上の宛先アドレスの各々を1つのハッシュ関数により変換したときのエントリ番号が同一値となった場合、すなわち、ハッシュ値(エントリ番号)の衝突(コリジョン)が生じた場合、これらの宛先アドレスのうち1個だけしか転送データベースに登録することはできない。   In the method using the hash table as described above, when each of two or more different destination addresses is converted by one hash function, the entry number becomes the same value, that is, the hash value (entry number) collides. When (collision) occurs, only one of these destination addresses can be registered in the transfer database.

登録できなかった宛先アドレスを持つパケットを転送する場合、当該パケットの転送先が不明なので、LANスイッチは当該パケットをコピーし、全ての転送先にブロードキャストすることになる。このようにパケットをコピーして全ての転送先にブロードキャストすることによって、宛先アドレスを登録できた場合には不要であった転送性能劣化や回線の混雑を招くことになる。   When transferring a packet having a destination address that could not be registered, since the transfer destination of the packet is unknown, the LAN switch copies the packet and broadcasts it to all transfer destinations. By copying packets and broadcasting them to all transfer destinations in this way, transfer performance deterioration and line congestion that are unnecessary when the destination address can be registered are caused.

上述したような転送性能劣化や回線の混雑を回避する方法として、異なる2個以上の宛先アドレスの各々を1つのハッシュ関数により変換した各ハッシュ値(各エントリ番号)に対して最大L個(Lは1以上の整数)の宛先アドレス値を格納可能なバケットを索引用のハッシュテーブルの各エントリとする手法がある(例えば、非特許文献1を参照。)。   As a method for avoiding the above-described transfer performance deterioration and line congestion, a maximum of L (L) entries can be obtained for each hash value (each entry number) obtained by converting each of two or more different destination addresses using one hash function. There is a technique in which a bucket capable of storing a destination address value of 1 or more is used as an entry in an index hash table (see, for example, Non-Patent Document 1).

この手法では、宛先アドレス値とその転送先情報を転送データベースに登録する場合、宛先アドレスをハッシュ関数により変換したエントリ番号に対応するバケットの空き位置に宛先アドレス値を格納するとともに、当該宛先アドレス値の格納位置に応じて定まる転送データベース内の位置に宛先アドレス値に対応する転送先情報を格納する。   In this method, when registering the destination address value and its transfer destination information in the transfer database, the destination address value is stored in the empty position of the bucket corresponding to the entry number converted by the hash function, and the destination address value The transfer destination information corresponding to the destination address value is stored at a position in the transfer database determined in accordance with the storage position.

また、パケットの転送先を決定する場合、当該パケットの宛先アドレスからハッシュ関数を用いて変換したエントリ番号により索引用のハッシュテーブル内のバケットを指定し、当該バケットに格納されている複数の宛先アドレス値のうち、当該パケットの宛先アドレスと一致する宛先アドレス値を検索する。   Also, when determining the packet transfer destination, a bucket in the index hash table is specified by the entry number converted from the destination address of the packet using a hash function, and a plurality of destination addresses stored in the bucket Among the values, a destination address value that matches the destination address of the packet is searched.

この検索において、当該パケットの宛先アドレスと一致する宛先アドレス値が指定のバケットから見つけられた場合、LANスイッチは宛先アドレス値の格納位置に応じた転送データベース内の位置に格納されている転送先情報を取得し、当該転送先情報を用いてパケットの転送先を決定する。   In this search, when a destination address value matching the destination address of the packet is found from the designated bucket, the LAN switch stores the transfer destination information stored in the transfer database according to the storage location of the destination address value. , And the transfer destination of the packet is determined using the transfer destination information.

このように、上述した手法では、異なる2個以上の宛先アドレスの各々をハッシュ関数により変換したハッシュ値(エントリ番号)が同じになる最大L個までの宛先アドレス値を転送データベースに登録することができるため、索引用のハッシュテーブルにおけるバケットのバケットサイズLを大きくすることにより、ハッシュ値の衝突によって宛先アドレス値を登録できない確率を低減できる。   As described above, in the above-described method, up to L destination address values having the same hash value (entry number) obtained by converting each of two or more different destination addresses using a hash function may be registered in the transfer database. Therefore, by increasing the bucket size L of the bucket in the index hash table, the probability that the destination address value cannot be registered due to the collision of hash values can be reduced.

大久保修一,“「さくらのクラウド」を例に見るネットワーク仮想化の設計と実装”,さくらインターネット研究所,p.25-26http://research.sakura.ad.jp/wp-content/uploads/2011/10/20110927-hbstudy.pdfShuichi Okubo, “Design and Implementation of Network Virtualization Using“ Sakura Cloud ”as an Example”, Sakura Internet Laboratory, p.25-26http: //research.sakura.ad.jp/wp-content/uploads/2011 /10/20110927-hbstudy.pdf

しかしながら、一定個数のランダム値からなる宛先アドレスを登録することのできるデータベース装置においては、同じハッシュ値(エントリ番号)を持つことになる宛先アドレスの個数にばらつきが生じるので、一定個数の宛先アドレスを登録可能なハッシュテーブルのバケットサイズLは、宛先アドレスの個数のばらつきの最大値とする必要がある。   However, in a database device that can register a destination address consisting of a fixed number of random values, the number of destination addresses that have the same hash value (entry number) varies. The bucket size L of the hash table that can be registered must be the maximum value of the variation in the number of destination addresses.

しかしながら、同じハッシュ値(エントリ番号)を持つ宛先アドレスの個数のばらつきが最大値となる確率は低いため、一定個数の宛先アドレスを転送データベースに登録し終えた時点で、索引用のハッシュテーブル内のバケットの大多数において、そのバケットに宛先アドレス値が格納されている宛先アドレスの個数はバケットサイズLに到達していないと考えられる。   However, since there is a low probability that the variation in the number of destination addresses having the same hash value (entry number) will be the maximum value, when a predetermined number of destination addresses have been registered in the transfer database, In the majority of buckets, it is considered that the number of destination addresses in which destination address values are stored in the bucket has not reached the bucket size L.

すなわち、索引用のハッシュテーブルに対して設けられたメモリには、未使用領域が多く残存することになる。また、同じ理由によって、転送データベース用に設けられたメモリに対しても、多数の未使用領域が残存してしまう。   That is, many unused areas remain in the memory provided for the index hash table. For the same reason, a large number of unused areas remain in the memory provided for the transfer database.

したがって、索引用のハッシュテーブルや転送データベースをメモリにより構成したデータベース装置においては、メモリの使用効率が低くなり、登録すべき宛先アドレスや転送先情報のデータサイズよりも大きな容量のメモリを備える必要があり、メモリの無駄が大きいという問題があった。   Therefore, in a database device in which the hash table for index and the transfer database are configured by memory, the memory use efficiency becomes low, and it is necessary to provide a memory having a capacity larger than the data size of the destination address to be registered and the transfer destination information. There was a problem that memory wasted.

本発明は、以上のような問題点を解消するためになされたものであり、データベースを構成するメモリの使用効率を格段に向上させた小容量のメモリによって構成されるデータベース装置、データベース管理方法およびプログラムを提案することを目的とする。   The present invention has been made to solve the above problems, and a database device, a database management method, and a database device configured by a small-capacity memory in which the use efficiency of the memory constituting the database is remarkably improved. The purpose is to propose a program.

本発明に係るデータベース装置は、複数のキー値を格納可能な複数のキー格納位置が設けられ、互いに異なるエントリ番号にそれぞれ対応付けられたバケットを複数有するN(Nは2以上の整数)個の索引テーブルと、前記N個の索引テーブルのそれぞれに対応した互いに異なるN個のハッシュ関数を備え、当該N個のハッシュ関数を用いて外部から入力されたキーのキー値に基づき前記N個の索引テーブルにそれぞれ対応したN個のエントリ番号を生成するエントリ番号生成部と、前記バケットのうち前記キー格納位置に対応したレコード格納位置に当該キー値と対応するレコード値を格納するレコードテーブルと、前記N個のエントリ番号に対応した前記N個の索引テーブルにおけるN個のバケットの中から前記キー値を格納するバケットを選択し、当該バケットに前記キー値を格納する索引テーブル登録部と、前記キー値を格納したキー格納位置と対応する前記レコードテーブルの前記レコード格納位置に当該キー値と対応したレコード値を格納するレコードテーブル登録部とを備えるようにする。   The database device according to the present invention is provided with a plurality of key storage positions capable of storing a plurality of key values, and has a plurality of N (N is an integer of 2 or more) buckets each associated with a different entry number. An index table and N hash functions different from each other corresponding to each of the N index tables, and the N indexes based on a key value of a key input from the outside using the N hash functions An entry number generation unit that generates N entry numbers corresponding to each table; a record table that stores a record value corresponding to the key value in a record storage position corresponding to the key storage position in the bucket; A bucket for storing the key value from N buckets in the N index tables corresponding to N entry numbers. An index table registration unit for storing the key value in the bucket, and storing the record value corresponding to the key value in the record storage position of the record table corresponding to the key storage position storing the key value And a record table registration unit.

請求項1において、前記N個のエントリ番号に対応した前記N個の索引テーブルにおけるN個のバケットの中から、前記キーと一致するキー値が格納されている前記バケットを検索する索引テーブル検索部と、前記索引テーブル検索部により検索した前記バケットにおける前記キー値が格納されたキー格納位置と対応した前記レコードテーブルの前記レコード格納位置から前記レコード値を取得するレコードテーブル検索部とを更に備えることを特徴とする。   2. The index table search unit according to claim 1, wherein the index table search unit searches for the bucket in which a key value matching the key is stored from N buckets in the N index tables corresponding to the N entry numbers. And a record table search unit for acquiring the record value from the record storage position of the record table corresponding to the key storage position in which the key value is stored in the bucket searched by the index table search unit. It is characterized by.

請求項1において、前記索引テーブル登録部は、前記N個のバケットのうち既に格納されているキー値の個数であるバケット長、または前記N個のバケットのうち追加で格納可能なキー値の個数である空きバケット長に基づいて、前記N個の索引テーブルにおいて前記N個のエントリ番号に対応したN個のバケットの中から前記キー値の格納先となるバケットを選択することを特徴とする。   2. The index table registration unit according to claim 1, wherein the index table registration unit includes a bucket length that is the number of key values already stored in the N buckets, or a number of key values that can be additionally stored in the N buckets. In the N index tables, a bucket that stores the key value is selected from N buckets corresponding to the N entry numbers in the N index tables.

請求項1において、前記N個の索引テーブルは、前記索引テーブル登録部および前記索引テーブル検索部の双方から同時にアクセス可能であり、前記レコードテーブルは、前記レコードテーブル登録部および前記レコードテーブル検索部の双方から同時にアクセス可能であることを特徴とする。   2. The N index tables can be simultaneously accessed from both the index table registration unit and the index table search unit, and the record table includes the record table registration unit and the record table search unit. It can be accessed from both sides simultaneously.

請求項1において、前記レコードテーブルは、複数のレコード値を格納可能な複数のレコード格納位置が設けられ、互いに異なるレコードエントリ番号に対応付けられたバケットをそれぞれ複数有するN個のレコードテーブルであることを特徴とする。   2. The record table according to claim 1, wherein the record table is provided with a plurality of record storage positions capable of storing a plurality of record values and has a plurality of buckets respectively associated with different record entry numbers. It is characterized by.

請求項1において、前記索引テーブル登録部は、前記N個の索引テーブルにおける全ての前記キー格納位置に当該キー値を格納しているか否かを表すキー格納マップテーブルを参照し、前記N個の索引テーブルにおいて前記N個のエントリ番号に対応したN個のバケットの中から前記キー値の格納先となる前記バケットを選択することを特徴とする。   The index table registration unit according to claim 1, wherein the index table registration unit refers to a key storage map table that indicates whether or not the key value is stored in all the key storage positions in the N index tables, and In the index table, the bucket serving as the storage destination of the key value is selected from N buckets corresponding to the N entry numbers.

本発明によれば、N個のハッシュ関数を用いて前記N個の索引テーブルにそれぞれ対応したN個のエントリ番号をキー値から生成することができるので、N個のエントリ番号が衝突する確率を予め低減し、外部からキーが入力される度にN個の索引テーブルの中からキーを格納すべきバケットを選択して格納することができるので、従来に比して索引テーブルのメモリ使用効率を大幅に改善するとともに、少容量のメモリによって構成することができる。   According to the present invention, since N entry numbers corresponding to the N index tables can be generated from the key values using N hash functions, the probability that the N entry numbers collide is obtained. Since it is possible to select and store a bucket in which a key is to be stored from N index tables each time a key is input from the outside, it is possible to reduce the memory usage efficiency of the index table compared to the conventional case. In addition to the significant improvement, the memory can be configured with a small capacity memory.

第1の実施の形態におけるデータベース装置の構成を示すブロック図である。It is a block diagram which shows the structure of the database apparatus in 1st Embodiment. 第1の実施の形態における索引テーブルの構成を示す図である。It is a figure which shows the structure of the index table in 1st Embodiment. 第1の実施の形態におけるレコードテーブルの構成を示す図である。It is a figure which shows the structure of the record table in 1st Embodiment. 第1の実施の形態における索引テーブル制御部による登録処理手順を示すフローチャートである。It is a flowchart which shows the registration processing procedure by the index table control part in 1st Embodiment. 第1の実施の形態における索引テーブル制御部による検索処理手順を示すフローチャートである。It is a flowchart which shows the search processing procedure by the index table control part in 1st Embodiment. 第1の実施の形態におけるメモリ使用効率の説明に供するグラフである。It is a graph with which it uses for description of the memory usage efficiency in 1st Embodiment. 第2の実施の形態におけるデータベース装置の構成を示すブロック図である。It is a block diagram which shows the structure of the database apparatus in 2nd Embodiment. 第3の実施の形態におけるデータベース装置の構成を示すブロック図である。It is a block diagram which shows the structure of the database apparatus in 3rd Embodiment. 第3の実施の形態におけるレコードテーブルの構成を示す図である。It is a figure which shows the structure of the record table in 3rd Embodiment. 第3の実施の形態におけるキー格納マップテーブルの構成を示す図である。It is a figure which shows the structure of the key storage map table in 3rd Embodiment. 第3の実施の形態における索引テーブル登録部による登録処理手順を示すフローチャートである。It is a flowchart which shows the registration processing procedure by the index table registration part in 3rd Embodiment. 第3の実施の形態における索引テーブル検索部による検索処理手順を示すフローチャートである。It is a flowchart which shows the search processing procedure by the index table search part in 3rd Embodiment.

<第1の実施の形態>
<データベース装置の全体構成>
以下、本発明における第1の実施の形態におけるデータベース装置の構成について図1を用いて説明する。
<First Embodiment>
<Overall configuration of database device>
Hereinafter, the configuration of the database apparatus according to the first embodiment of the present invention will be described with reference to FIG.

このデータベース装置1は、CPU(Central Processing Unit)、メモリ、インタフェース等からなるコンピュータ(ハードウェア)にコンピュータプログラム(ソフトウェア)をインストールすることによって実現され、当該データベース装置1の機能は、コンピュータの各種ハードウェア資源とコンピュータプログラムとが協働することによって実現される。また、コンピュータプログラムは、コンピュータ読取可能な記録媒体や記憶装置に格納された状態で提供されても良く、或いは電気通信回線を介して提供されても良い。   The database device 1 is realized by installing a computer program (software) in a computer (hardware) including a CPU (Central Processing Unit), a memory, an interface, and the like. This is realized by the cooperation of the hardware resource and the computer program. Further, the computer program may be provided in a state of being stored in a computer-readable recording medium or a storage device, or may be provided via an electric communication line.

図1に示すように、第1の実施の形態におけるデータベース装置1は、複数のキーに対応したキー値(宛先アドレス値)を格納するN個(Nは2以上の整数)の索引テーブル2[n](n=0…N-1)、索引テーブル2[n]に格納された複数のキー値(宛先アドレス値)にそれぞれ対応した複数のレコード値(転送先情報)を格納するレコードテーブル3、索引テーブル2[n]に対するキー値(宛先アドレス値)の登録や検索、レコードテーブル制御部5と連動してキー値に対応したレコード値のレコードテーブル3に対する登録やレコードテーブル3からの検索を制御する索引テーブル制御部4、索引テーブル制御部4と連動してレコードテーブル3に対するレコード値の登録またはレコードテーブル3からのレコード値の検索を制御するレコードテーブル制御部5によって構成されている。なお、データベース装置1では、複数の索引テーブル2[n] (n=0…N-1)およびレコードテーブル3によって転送データベースが構成されている。   As shown in FIG. 1, the database apparatus 1 according to the first embodiment has N index tables 2 [N is an integer of 2 or more] that store key values (destination address values) corresponding to a plurality of keys. n] (n = 0... N-1), a record table 3 for storing a plurality of record values (transfer destination information) respectively corresponding to a plurality of key values (destination address values) stored in the index table 2 [n]. , Registration and retrieval of key values (destination address values) for the index table 2 [n], registration of record values corresponding to the key values in the record table 3 and retrieval from the record table 3 in conjunction with the record table control unit 5 Index table control unit 4 to be controlled, record table for controlling record value registration to record table 3 or search of record value from record table 3 in conjunction with index table control unit 4 It is constituted by a control unit 5. In the database apparatus 1, a transfer database is configured by a plurality of index tables 2 [n] (n = 0... N−1) and the record table 3.

<索引テーブルの構成>
図2には、索引テーブル2[n] (n=0…N-1)の構成例を示す。索引テーブル2[0]、……、2[n]、……、2[N-1]は全て同じ構成であるため、ここでは便宜上、索引テーブル2[n]について説明する。
<Configuration of index table>
FIG. 2 shows a configuration example of the index table 2 [n] (n = 0... N−1). Since the index tables 2 [0],... 2 [n],... 2 [N-1] all have the same configuration, the index table 2 [n] will be described here for convenience.

索引テーブル2[n] (n=0…N-1)はメモリであり、各索引テーブル2[n]はM個のエントリ11[i](i=0…M-1)を有している。ここで、[n] (n=0…N-1)は索引テーブル2[n]を特定する索引テーブル番号(2以上の整数)であり、[i] (i=0…M-1)は索引テーブル2[n]内の複数のエントリ11[i]を特定するエントリ番号(1以上の整数)である。   The index table 2 [n] (n = 0... N-1) is a memory, and each index table 2 [n] has M entries 11 [i] (i = 0... M-1). . Here, [n] (n = 0... N-1) is an index table number (an integer greater than or equal to 2) that specifies the index table 2 [n], and [i] (i = 0... M-1) is This is an entry number (an integer greater than or equal to 1) that identifies a plurality of entries 11 [i] in the index table 2 [n].

このエントリ11[i](i=0…M-1)は、複数のキー値(宛先アドレス値)を格納可能なL個のキー格納位置12[i][j] (i=0…M-1) (j=0…L-1)が設けられたバケット10[i](i=0…M-1)として構成されている。この場合、エントリ11[i]はバケット10[i]であると言え、[i]はエントリ番号であると同時にバケット番号(1以上の整数)であるとも言える。   This entry 11 [i] (i = 0... M-1) has L key storage positions 12 [i] [j] (i = 0... M-) that can store a plurality of key values (destination address values). 1) It is configured as a bucket 10 [i] (i = 0... M-1) provided with (j = 0... L-1). In this case, it can be said that the entry 11 [i] is the bucket 10 [i], and [i] is the bucket number (an integer of 1 or more) at the same time as the entry number.

ここで、索引テーブル2[n] (n=0…N-1)のキー格納位置12[i][j] (i=0…M-1) (j=0…L-1)は、エントリ番号[i] (i=0…M-1)と、バケット内キー格納位置番号[j](j=0…L-1)とによって特定される。バケット内キー格納位置番号[j] (j=0…L-1)は、バケット10[i] (i=0…M-1)内のキー格納位置を特定する番号(1以上の整数)である。   Here, the key storage position 12 [i] [j] (i = 0 ... M-1) (j = 0 ... L-1) of the index table 2 [n] (n = 0 ... N-1) is an entry. It is specified by the number [i] (i = 0... M-1) and the in-bucket key storage position number [j] (j = 0... L-1). The key storage position number [j] (j = 0 ... L-1) in the bucket is a number (an integer greater than or equal to 1) that identifies the key storage position in the bucket 10 [i] (i = 0 ... M-1). is there.

このような構成の索引テーブル2[n](n=0…N-1)に格納されたキー値(宛先アドレス値)を読み出す場合には、索引テーブル2[n] (n=0…N-1)を特定する索引テーブル番号[n]を指定し、さらに、読み出すべきエントリ11[i]を特定するエントリ番号[i](バケット番号[i])を指定することにより当該エントリ11[i](バケット10[i])に格納された複数のキー値(宛先アドレス)に対する読出アクセスを行う(詳細については後述する)。   When reading the key value (destination address value) stored in the index table 2 [n] (n = 0... N-1) having such a configuration, the index table 2 [n] (n = 0... N- By specifying an index table number [n] specifying 1), and further specifying an entry number [i] (bucket number [i]) specifying an entry 11 [i] to be read out, the entry 11 [i] Read access is made to a plurality of key values (destination addresses) stored in (bucket 10 [i]) (details will be described later).

また、索引テーブル2[n] (n=0…N-1)に対して、新たなキーに対応したキー値(宛先アドレス値)を格納する場合には、格納先となる索引テーブル2[n] (n=0…N-1)を特定する索引テーブル番号[n] (n=0…N-1)を指定する。そして、エントリ11[i] (i=0…M-1)を特定するエントリ番号[i](バケット番号[i])およびバケット内キー格納位置番号[j](j=0…L-1)を指定することにより、キー格納位置12[i][j] (i=0…M-1) (j=0…L-1)を特定し、そのキー格納位置12[i][j] (i=0…M-1) (j=0…L-1)に対して格納すべきキー値(宛先アドレス値)の書込アクセスを行う(詳細については後述する)。   Further, in the case where a key value (destination address value) corresponding to a new key is stored in the index table 2 [n] (n = 0... N-1), the index table 2 [n] serving as the storage destination is stored. ] Specify the index table number [n] (n = 0 ... N-1) for specifying (n = 0 ... N-1). Then, the entry number [i] (bucket number [i]) specifying the entry 11 [i] (i = 0... M-1) and the key storage position number [j] (j = 0... L-1) in the bucket. Is specified, the key storage position 12 [i] [j] (i = 0 ... M-1) (j = 0 ... L-1) is specified, and the key storage position 12 [i] [j] ( i = 0... M-1) (j = 0... L-1) is written to the key value (destination address value) to be stored (details will be described later).

<レコードテーブルの構成>
図3には、レコードテーブル3の構成例を示す。レコードテーブル3はメモリであり、全ての索引テーブル2[n](n=0…N-1)のキー格納位置12[i][j] (i=0…M-1) (j=0…L-1)に格納したキー値(宛先アドレス値)の各々に対応したレコード値(パケットの転送先情報)を格納可能なレコードエントリ20[k](k=0…K-1)が設けられている。
<Structure of record table>
FIG. 3 shows a configuration example of the record table 3. The record table 3 is a memory, and the key storage positions 12 [i] [j] (i = 0 ... M-1) (j = 0 ...) of all the index tables 2 [n] (n = 0 ... N-1). A record entry 20 [k] (k = 0... K-1) is provided that can store record values (packet transfer destination information) corresponding to each of the key values (destination address values) stored in (L-1). ing.

ここで、[k] (k=0…K-1)は、レコードテーブル3内のレコード格納位置であるレコードエントリ20[k]を特定するレコードエントリ番号(1以上の整数)であり、索引テーブル2[n] (n=0…N-1)のキー格納位置12[i][j] (i=0…M-1) (j=0…L-1)に格納されたキー値に対応したレコード値の格納位置を特定するためのものである。   Here, [k] (k = 0... K-1) is a record entry number (an integer greater than or equal to 1) that identifies the record entry 20 [k] that is a record storage position in the record table 3, and is an index table. 2 [n] (n = 0 ... N-1) key storage position 12 [i] [j] (i = 0 ... M-1) Corresponds to the key value stored in (j = 0 ... L-1) This is for specifying the storage position of the record value.

第1の実施の形態において、全ての索引テーブル2[n](n=0…N-1)に設けられたキー格納位置12[i][j] (i=0…M-1) (j=0…L-1)の全個数は、索引テーブル数N×各索引テーブル2[n] (n=0…N-1)のテーブルサイズM(索引テーブル2[n]のエントリ数(バケット数))×各バケットのバケットサイズL(キー格納位置12[i][j]の個数)により表される。   In the first embodiment, key storage positions 12 [i] [j] (i = 0... M-1) (j provided in all index tables 2 [n] (n = 0... N-1) = 0... L−1) is the total number of index tables N × each index table 2 [n] (n = 0... N-1) table size M (number of entries in index table 2 [n] (number of buckets) )) × Bucket size L of each bucket (number of key storage positions 12 [i] [j]).

したがって、レコードテーブル3の各レコードエントリ20[k] (k=0…K-1)に1個のレコード値(パケットの転送先情報)を格納する1個のメモリとして構成した場合のレコードテーブル3のレコードテーブルサイズKは、K=N×M×Lとなり、全ての索引テーブル2[n] (n=0…N-1)に設けられたキー格納位置12[i][j] (i=0…M-1) (j=0…L-1)の全個数と同じになる。   Therefore, the record table 3 in the case where it is configured as one memory that stores one record value (packet transfer destination information) in each record entry 20 [k] (k = 0... K-1) of the record table 3. Record table size K is K = N × M × L, and key storage positions 12 [i] [j] (i =) provided in all index tables 2 [n] (n = 0... N−1). 0 ... M-1) (j = 0 ... L-1) is the same as the total number.

索引テーブル2[n] (n=0…N-1)のキー格納位置12[i][j] (i=0…M-1) (j=0…L-1)と、レコードテーブル3のレコードエントリ20[k] (k=0…K-1)のレコードエントリ番号[k]との対応付けは、当該キー格納位置12[i][j] (i=0…M-1) (j=0…L-1)に基づいてレコードエントリ20[k] (k=0…K-1)のレコードエントリ番号[k]を一意に算出できる計算方法であればよい。   The key storage position 12 [i] [j] (i = 0 ... M-1) (j = 0 ... L-1) of the index table 2 [n] (n = 0 ... N-1) and the record table 3 The record entry 20 [k] (k = 0... K-1) is associated with the record entry number [k] in correspondence with the key storage position 12 [i] [j] (i = 0 ... M-1) (j = 0... L-1), any calculation method that can uniquely calculate the record entry number [k] of the record entry 20 [k] (k = 0... K-1) may be used.

例えば、1つの計算方法として、索引テーブル2[n] (n=0…N-1)を示す索引テーブル番号[n]、エントリ11[i]を示すエントリ番号[i] (i=0…M-1)、キー格納位置12[i][j] (i=0…M-1) (j=0…L-1)を示すバケット内キー格納位置番号[j](j=0…L-1)を用いて、レコードエントリ20[k] (k=0…K-1)のレコードエントリ番号[k]を次の(式1)により算出することが可能である。
k=n×M×L+i×L+j …………………………………………………………(式1)
For example, as one calculation method, index table number [n] indicating index table 2 [n] (n = 0... N-1), entry number [i] indicating entry 11 [i] (i = 0... M -1), key storage position 12 [i] [j] (i = 0 ... M-1) In-bucket key storage position number [j] (j = 0 ... L- 1), the record entry number [k] of the record entry 20 [k] (k = 0... K−1) can be calculated by the following (Equation 1).
k = n × M × L + i × L + j ………………………………………………………… (Formula 1)

このような構成のレコードテーブル3のレコードエントリ20[k] (k=0…K-1)に格納されたレコード値(転送先情報)をデータベース装置1が読み出す場合、当該データベース装置1は読出先となるレコードエントリ20[k] (k=0…K-1)に対応したレコードエントリ番号[k]を指定することにより読出アクセスを行う(詳細については後述する)。   When the database device 1 reads the record value (transfer destination information) stored in the record entry 20 [k] (k = 0... K-1) of the record table 3 having such a configuration, the database device 1 reads the destination. Read access is performed by designating the record entry number [k] corresponding to the record entry 20 [k] (k = 0... K-1) to be (details will be described later).

一方、レコードテーブル3に対して新たなレコード値(転送先情報)を格納する場合、データベース装置1は格納先となるレコードエントリ番号[k] (k=0…K-1)を指定することにより書込アクセスを行う(詳細については後述する)。   On the other hand, when a new record value (transfer destination information) is stored in the record table 3, the database device 1 designates a record entry number [k] (k = 0... K-1) as a storage destination. Write access is performed (details will be described later).

<索引テーブル制御部の構成>
図1において、索引テーブル登録部および索引テーブル検索部としての索引テーブル制御部4は、外部から入力された登録用のキーKr(パケットの宛先アドレス)のキー値(宛先アドレス値)を索引テーブル2[n] (n=0…N-1)のキー格納位置12[i][j] (i=0…M-1) (j=0…L-1)に格納したり、当該キー値に対応した登録対象のレコードRrのレコード値(転送先情報)をレコードテーブル3に格納する等の制御をレコードテーブル制御部5と連動して行うものである。
<Configuration of index table control unit>
In FIG. 1, an index table control unit 4 serving as an index table registration unit and an index table search unit uses a key value (destination address value) of a registration key K r (packet destination address) input from the outside as an index table. 2 [n] (n = 0 ... N-1) key storage position 12 [i] [j] (i = 0 ... M-1) (j = 0 ... L-1) is performed in conjunction with the record table controller 5 controls such as storing a record value of the record R r of registered corresponding to (transfer destination information) in the record table 3.

また、索引テーブル制御部4は、外部から入力された検索用のキーKsに対応した検索対象のレコードRsのレコード値をレコードテーブル3から取得する等の制御についてもレコードテーブル制御部5と連動して行うものである。 In addition, the index table control unit 4 and the record table control unit 5 also perform control such as acquiring the record value of the record R s to be searched corresponding to the search key K s input from the outside from the record table 3. It is done in conjunction.

索引テーブル制御部4は、N個の索引テーブル2[n] (n=0…N-1)にそれぞれ対応した互いに異なるN個のハッシュ関数f[n] (n=0…N-1)を備えるとともに、登録用のキーKr(宛先アドレス)から当該N個のハッシュ関数f[n] (n=0…N-1)にそれぞれ対応したハッシュ値からなるエントリ番号[n] (n=0…N-1)を生成するエントリ番号生成部4aを有している。 The index table control unit 4 assigns N different hash functions f [n] (n = 0... N-1) respectively corresponding to the N index tables 2 [n] (n = 0... N-1). And an entry number [n] (n = 0) consisting of hash values respectively corresponding to the N hash functions f [n] (n = 0... N−1) from the registration key K r (destination address). ... Have an entry number generation unit 4a for generating (N-1).

ここで、エントリ番号[n] (n=0…N-1)は、ハッシュ関数f[n] (n=0…N-1)に対応してキーKrから変換されるものであり、各索引テーブル2[n](n=0…N-1)に設けられた複数のエントリ11[i] (i=0…M-1)に対応する。 Here, the entry number [n] (n = 0... N-1) is converted from the key K r in correspondence with the hash function f [n] (n = 0... N-1). This corresponds to a plurality of entries 11 [i] (i = 0... M-1) provided in the index table 2 [n] (n = 0... N-1).

索引テーブル制御部4は、登録用のキーKrのキー値(宛先アドレス値)を索引テーブル2[n] (n=0…N-1)に格納する際、キー値が未格納のキー格納位置12[i][j] (i=0…M-1) (j=0…L-1)を探索し、そこに格納する必要がある。 When the index table control unit 4 stores the key value (destination address value) of the registration key Kr in the index table 2 [n] (n = 0... N-1), the key table in which the key value is not stored is stored. The position 12 [i] [j] (i = 0... M-1) (j = 0... L-1) needs to be searched and stored therein.

そのため、索引テーブル制御部4では、各索引テーブル2[n] (n=0…N-1)のうち、キーKrをハッシュ関数f[n] (n=0…N-1)により変換したエントリ番号[n] (n=0…N-1)のバケット10[n] (n=0…N-1)について、バケット長(後述する)もしくは空きバケット長(後述する)を取得する必要がある。 Therefore, the index table control unit 4 converts the key K r in each index table 2 [n] (n = 0... N-1) by the hash function f [n] (n = 0... N-1). For bucket 10 [n] (n = 0 ... N-1) of entry number [n] (n = 0 ... N-1), it is necessary to acquire a bucket length (described later) or an empty bucket length (described later). is there.

ここで、バケット長とは、エントリ番号[n] (n=0…N-1)のバケット10[n] (n=0…N-1)における複数のキー格納位置12[i][j](i=0…M-1)(j=0…L-1)に既に格納されているキー値の個数である。また、空きバケット長とは、エントリ番号[n] (n=0…N-1)のバケット10[n] (n=0…N-1)における複数のキー格納位置12[i][j] (i=0…M-1) (j=0…L-1)に対して追加で格納可能なキー値の個数である。   Here, the bucket length is a plurality of key storage positions 12 [i] [j] in the bucket 10 [n] (n = 0 ... N-1) of the entry number [n] (n = 0 ... N-1). This is the number of key values already stored in (i = 0 ... M-1) (j = 0 ... L-1). The empty bucket length is a plurality of key storage positions 12 [i] [j] in the bucket 10 [n] (n = 0 ... N-1) of the entry number [n] (n = 0 ... N-1). (i = 0 ... M-1) This is the number of key values that can be additionally stored for (j = 0 ... L-1).

索引テーブル制御部4において、エントリ番号[n] (n=0…N-1)のバケット10[n] (n=0…N-1)におけるバケット長または空きバケット長を取得する方法としては、以下の3通りがある。   In the index table control unit 4, as a method of acquiring the bucket length or the empty bucket length in the bucket 10 [n] (n = 0 ... N-1) of the entry number [n] (n = 0 ... N-1), There are the following three types.

一つ目のバケット長取得方法では、索引テーブル2[n] (n=0…N-1)のうち、キー値(宛先アドレス値)が未格納の全ての各キー格納位置12[i][j] (i=0…M-1) (j=0…L-1)に対して、無効なキー値(格納済のキー値とは一致しない任意の値)を格納しておく。これにより、索引テーブル制御部4は、バケット長もしくは空きバケット長を取得する場合に、エントリ番号[n] (n=0…N-1)により指定したバケット10[n] (n=0…N-1)における全キー値(有効なキー値および無効なキー値の全て)を取得し、当該全キー値のうち、無効なキー値を持つキーKrの個数を計数し、それを対象となるバケット10[n](n=0…N-1)に対する空きバケット長として取得することができる。ただし、索引テーブル制御部4は有効なキー値を持つキーKrの個数を計数してもよく、この場合には、それを対象となるバケット10[n] (n=0…N-1)に対するバケット長として取得することができる。 In the first bucket length acquisition method, all the key storage positions 12 [i] [not stored in the key value (destination address value) in the index table 2 [n] (n = 0... N-1). j] (i = 0... M-1) An invalid key value (an arbitrary value that does not match the stored key value) is stored for (j = 0... L-1). As a result, when the index table control unit 4 acquires the bucket length or the empty bucket length, the bucket 10 [n] (n = 0... N) designated by the entry number [n] (n = 0... N-1). acquired all key values (all valid key values and invalid key values) in -1), among the entire key value, counts the number of key K r with an invalid key value, the target it Can be acquired as an empty bucket length for the bucket 10 [n] (n = 0... N−1). However, the index table control unit 4 may count the number of keys K r having a valid key value. In this case, the bucket 10 [n] (n = 0. Can be obtained as the bucket length for.

二つ目のバケット長取得方法では、索引テーブル2[n] (n=0…N-1)における全てのキー格納位置12[i][j](i=0…M-1)(j=0…L-1)に対して格納有無を表すフラグを設け、初期状態(未だ登録されたキー値が存在しない状態)において当該フラグをクリアしておき、キー値の格納に合わせてキー格納位置12[i][j] (i=0…M-1) (j=0…L-1)に設けられたフラグをセットする。これにより、索引テーブル制御部4は、バケット長もしくは空きバケット長を取得する場合に、エントリ番号[n] (n=0…N-1)により指定した対象となるバケット10[n] (n=0…N-1)のキー格納位置12[i][j](i=0…M-1)(j=0…L-1)にセットされたフラグ(あるいはセットされていないフラグ)の個数を計数し、それを対象となるバケット10[n] (n=0…N-1)に対するバケット長(あるいは空きバケット長)として取得することができる。   In the second bucket length acquisition method, all key storage positions 12 [i] [j] (i = 0 ... M-1) (j = 0 ... L-1) is provided with a flag indicating whether or not it is stored, and the flag is cleared in the initial state (the state where the registered key value does not yet exist). 12 [i] [j] (i = 0... M-1) The flag provided at (j = 0... L-1) is set. As a result, when the index table control unit 4 acquires the bucket length or the empty bucket length, the bucket 10 [n] (n = Number of flags set (or not set) in the key storage position 12 [i] [j] (i = 0 ... M-1) (j = 0 ... L-1) of 0 ... N-1) Can be obtained as the bucket length (or empty bucket length) for the target bucket 10 [n] (n = 0... N-1).

三つ目のバケット長取得方法では、索引テーブル2[n] (n=0…N-1)の各エントリ11[n] (n=0…N-1)に対してバケット長(あるいは空きバケット長)を表すカウンタを設け、初期状態(未だ登録されたキー値が存在しない状態)において当該カウンタを初期化しておき、キー値の格納に合わせて当該キー値を格納したバケット10[n] (n=0…N-1)に対応するカウンタのカウント値を更新する。これにより、索引テーブル制御部4は、バケット長もしくは空きバケット長を取得する場合に、各エントリ11[n] (n=0…N-1)のカウンタ値を取得し、そのカウンタ値を対象となるバケット10[n] (n=0…N-1)に対するバケット長(あるいは空きバケット長)として取得することができる。   In the third bucket length acquisition method, a bucket length (or an empty bucket) is assigned to each entry 11 [n] (n = 0 ... N-1) of the index table 2 [n] (n = 0 ... N-1). Counter 10 representing the length), the counter is initialized in an initial state (a state in which a registered key value does not yet exist), and the bucket 10 [n] ( The counter value corresponding to n = 0... N-1) is updated. Thereby, when acquiring the bucket length or the empty bucket length, the index table control unit 4 acquires the counter value of each entry 11 [n] (n = 0... N−1) and targets the counter value. Can be acquired as a bucket length (or an empty bucket length) for a bucket 10 [n] (n = 0... N−1).

<レコードテーブル制御部の構成>
図1において、レコードテーブル登録部およびレコードテーブル検索部としてのレコードテーブル制御部5は、索引テーブル制御部4と連動して、索引テーブル2[n] (n=0…N-1)のキー格納位置12[i][j] (i=0…M-1) (j=0…L-1)に格納した登録用のキーKrのキー値(宛先アドレス値)に対応した登録対象のレコードRrのレコード値(転送先情報)をレコードテーブル3に格納する制御を行うものである。
<Configuration of record table control unit>
In FIG. 1, a record table control unit 5 as a record table registration unit and a record table search unit interlocks with the index table control unit 4 and stores the key of the index table 2 [n] (n = 0... N−1). position 12 [i] [j] ( i = 0 ... M-1) registered in the record corresponding to the key value of the key K r for registration stored in the (j = 0 ... L-1 ) ( destination address value) Control for storing the record value (transfer destination information) of R r in the record table 3 is performed.

またレコードテーブル制御部5は、索引テーブル制御部4と連動して、当該索引テーブル制御部4に入力された検索用のキーKsに対応する検索対象のレコードRsをレコードテーブル3から取得するための制御を行うものである。 The record table control unit 5 acquires the record R s to be searched corresponding to the search key K s input to the index table control unit 4 from the record table 3 in conjunction with the index table control unit 4. Control is performed.

ここで、登録用のキーKrと検索用のキーKsとは異なるキー値であることを前提としているが、登録用および検索用の双方において同じキー値のキーKrまたはKsが用いられてもよい。同様に、登録対象のレコードRrと検索対象のレコードRsとは異なるレコード値であることを前提としているが、登録対象および検索対象のレコードRrおよびRsに対して同じレコード値が用いられてもよい。 Here, it is assumed that the registration key K r and the search key K s have different key values, but the same key value key K r or K s is used for both registration and search. May be. Similarly, it is assumed that the record R r to be registered and the record R s to be searched have different record values, but the same record value is used for the records R r and R s to be registered and searched. May be.

<登録用のキーおよび当該キーに対応したレコードの登録処理手順>
次に、データベース装置1における登録用のキーKrおよび当該キーKrに対応した登録対称のレコードRrの転送データベースに対する登録処理について説明する。なお、索引テーブル制御部4によるキーKrの転送データベースに対する登録動作については、図4のフローチャートを参照しながら説明する。
<Registration process for registration key and record corresponding to the key>
Next, registration process will be described with respect to the forwarding database of records R r registration symmetry corresponding to the key K r and the key K r for registration in the database device 1. The operation of registering the key Kr in the transfer database by the index table control unit 4 will be described with reference to the flowchart of FIG.

データベース装置1(図1)では、登録用のキーKr(宛先アドレス)と当該キーKrに対応する登録対象のレコードRr(転送先情報)を転送データベースに登録する場合、索引テーブル制御部4は、外部から登録用のキーKrと登録命令を意味する制御信号S1とを入力する(ステップSP1)。 In the database apparatus 1 (FIG. 1), when registering a registration key K r (destination address) and a record R r (transfer destination information) corresponding to the key K r in the transfer database, an index table control unit 4 receives a registration key Kr and a control signal S1 indicating a registration command from the outside (step SP1).

索引テーブル制御部4は、各索引テーブル2[n](n=0…N-1)にそれぞれ対応したN個のハッシュ関数f[n] (n=0…N-1)を用いて、外部から入力した登録用のキーKr(宛先アドレス)からN個のエントリ番号[n] (n=0…N-1)を同時に生成する(ステップSP2[0]、……、ステップSP2[n]、……、ステップSP2[N-1])。 The index table control unit 4 uses the N hash functions f [n] (n = 0... N-1) corresponding to the index tables 2 [n] (n = 0. N entry numbers [n] (n = 0... N-1) are generated simultaneously from the registration key K r (destination address) input from (step SP2 [0],..., Step SP2 [n]. , ..., step SP2 [N-1]).

索引テーブル制御部4は、各エントリ番号[n] (n=0…N-1)の各バケット10[n] (n=0…N-1)に対し、既にキー値が格納されている場合の個数を表す各バケット長[n] (n=0…N-1) を取得する(ステップSP3[0]、……、ステップSP3[n]、……、ステップSP3[N-1])。なお、バケット長[n]を取得する代わりに、追加で格納可能なキー値の個数である空きバケット長[n]を取得するようにしてもよい。   When the index table control unit 4 has already stored a key value for each bucket 10 [n] (n = 0 ... N-1) of each entry number [n] (n = 0 ... N-1). Each bucket length [n] (n = 0... N-1) representing the number of nodes is acquired (step SP3 [0],..., Step SP3 [n],..., Step SP3 [N-1]). Instead of acquiring the bucket length [n], an empty bucket length [n] that is the number of key values that can be additionally stored may be acquired.

索引テーブル制御部4は、ステップSP3[0]、……、ステップSP3[n]、……、ステップSP3[N-1]により得られたN個のバケット長[n](n=0…N-1)の中から最小値となるバケット長[nr]を探索し、その最小値のバケット長[nr]に対応した索引テーブル2[nr]を選択する(ステップSP4)。   The index table control unit 4 performs N bucket lengths [n] (n = 0... N) obtained in steps SP3 [0],..., Steps SP3 [n],. -1) is searched for the minimum bucket length [nr], and the index table 2 [nr] corresponding to the minimum bucket length [nr] is selected (step SP4).

索引テーブル制御部4は、最小値のバケット長[nr]に対応した索引テーブル2[nr]のキー格納位置[nr][j] (j=0…L-1)のうち、キー値が未格納のキー格納位置12[nr][jr]を探索する(ステップSP5)。ここで、キー格納位置12[nr][jr] における[nr]は、キー格納位置12を特定する最小値のバケット長[nr]に対応したエントリ番号[nr]であり、[jr]はキー値が未格納のキー格納位置を特定するバケット内キー格納位置番号[jr]である。   The index table control unit 4 determines that the key value of the key storage position [nr] [j] (j = 0... L-1) of the index table 2 [nr] corresponding to the minimum bucket length [nr] The key storage position 12 [nr] [jr] for storage is searched (step SP5). Here, [nr] at the key storage position 12 [nr] [jr] is the entry number [nr] corresponding to the minimum bucket length [nr] that identifies the key storage position 12, and [jr] is the key This is the key storage position number [jr] in the bucket that identifies the key storage position whose value is not stored.

索引テーブル制御部4は、索引テーブル2[nr]におけるエントリ11[nr]のバケット10[nr]のうち、キー値が未格納のキー格納位置12[nr][jr]を見つけられたか否かを判定し(ステップSP6)、見つけられた場合には、索引テーブル2[nr]におけるエントリ11[nr]のバケット10[nr]においてキー値が未格納のキー格納位置12[nr][jr]に登録用のキーKrのキー値を格納する(ステップSP7)。 The index table control unit 4 determines whether or not the key storage position 12 [nr] [jr] in which the key value is not stored is found in the bucket 10 [nr] of the entry 11 [nr] in the index table 2 [nr]. (Step SP6) and if found, the key storage position 12 [nr] [jr] where the key value is not stored in the bucket 10 [nr] of the entry 11 [nr] in the index table 2 [nr] It stores the key value of the key K r for registration (step SP7).

索引テーブル制御部4は、索引テーブル2[nr]のキー格納位置12[nr][jr]に対して登録用のキーKrのキー値を格納したので、索引テーブル2[nr]を示す索引テーブル番号[nr]、エントリ番号[nr]、キー格納位置12[nr][jr]を示すバケット内キー格納位置番号[jr]を上述した(式1)に代入する。 Since the index table control unit 4 stores the key value of the registration key K r in the key storage position 12 [nr] [jr] of the index table 2 [nr], the index table 2 [nr] indicates the index table 2 [nr]. The in-bucket key storage position number [jr] indicating the table number [nr], the entry number [nr], and the key storage position 12 [nr] [jr] is substituted into the above-described (Expression 1).

これにより索引テーブル制御部4は、レコードエントリ20[k]のレコードエントリ番号[k] (k=0…K-1)を次の(式2)により算出し、これをレコードテーブル制御部5に供給し(ステップSP8)、索引テーブル制御部4の登録処理を終了する。
k=索引テーブル番号[nr]×M×L+エントリ番号[nr]×L+jr………………(式2)
As a result, the index table control unit 4 calculates the record entry number [k] (k = 0... K−1) of the record entry 20 [k] by the following (Equation 2), and sends this to the record table control unit 5. (Step SP8), and the registration process of the index table control unit 4 is terminated.
k = index table number [nr] × M × L + entry number [nr] × L + jr (Equation 2)

レコードテーブル制御部5(図1)は、索引テーブル制御部4と同様に外部から登録命令を意味する制御信号S1が入力されており、索引テーブル制御部4から供給されたレコードテーブル3のレコードエントリ番号[k] (k=0…K-1)と、登録用のキーKrに対応した登録対象のレコードRrとを入力する。 As with the index table control unit 4, the record table control unit 5 (FIG. 1) receives a control signal S 1 indicating a registration command from the outside, and the record entry of the record table 3 supplied from the index table control unit 4 Enter the number [k] (k = 0... K-1) and the record Rr to be registered corresponding to the registration key Kr .

レコードテーブル制御部5は、登録命令を意味する制御信号S1にしたがって、レコードエントリ番号[k] (k=0…K-1)に対応したレコードテーブル3のレコードエントリ20[k]にレコードRrのレコード値を格納する。 The record table control unit 5 records the record R r in the record entry 20 [k] of the record table 3 corresponding to the record entry number [k] (k = 0... K−1) according to the control signal S1 meaning a registration command. Stores the record value of.

ところで、索引テーブル制御部4は、索引テーブル2[nr]におけるエントリ11[nr]のバケット10[nr]のうち、キー値が未格納のキー格納位置12[nr][jr]を見つけられなかった場合、すなわちエントリ11[nr]のバケット[nr]に既にキー値が全て格納されている場合には、登録用のキーKrのキー値を索引テーブル2[nr]に登録することはできないので、登録不可時の処理を行う(ステップSP7)。 By the way, the index table control unit 4 cannot find the key storage position 12 [nr] [jr] in which the key value is not stored in the bucket 10 [nr] of the entry 11 [nr] in the index table 2 [nr]. If, that is, the already key values into buckets [nr] entry 11 [nr] are all stored can not be registered key value of the key K r for registration in the index table 2 [nr] Therefore, processing when registration is impossible is performed (step SP7).

索引テーブル制御部4は、登録不可時の処理として、例えば、登録用のキーKrのキー値を索引テーブル2[nr]に登録できない回数をカウンタにより計数し、計数する度に更新し、その計数値を保持しておく。 Index table control unit 4, as the processing at the time of registration impossible, for example, the number of times that can not register a key value of the key K r for registration in the index table 2 [nr] counted by the counter, and updates whenever the counting, the The count value is retained.

あるいは索引テーブル制御部4は、登録不可時の処理として、索引テーブル2[nr]におけるエントリ11[nr]のバケット[nr]に対して既に格納済のキー値のうち1個のキー値の登録を抹消する。そして索引テーブル制御部4は、その抹消したキー格納位置12[i][r] (i=0…M-1) (j=0…L-1)に対して登録用のキーKrのキー値を登録するとともに、そのキー格納位置12[i][r] (i=0…M-1) (j=0…L-1)に対応したレコードテーブル3のレコードエントリ番号[k] (k=0…K-1)を算出し、これをレコードテーブル制御部5へ供給する。 Alternatively, the index table control unit 4 registers one key value among the already stored key values for the bucket [nr] of the entry 11 [nr] in the index table 2 [nr] as a process when registration is impossible. Delete. The index table control unit 4 then uses the key K r for registration for the deleted key storage position 12 [i] [r] (i = 0... M-1) (j = 0... L-1). In addition to registering a value, the record entry number [k] (k) in the record table 3 corresponding to the key storage position 12 [i] [r] (i = 0... M-1) (j = 0... L-1) = 0... K-1) is calculated and supplied to the record table control unit 5.

なお、索引テーブル制御部4は、バケット長[n](n=0…N-1)が最小値となるバケット長[nr]のエントリ番号[nr]に対応する索引テーブル2[nr]を選択するようにしたが(ステップSP4)、これに限るものではなく、登録対象とすべき索引テーブル2[nr]を選択する索引テーブル選択方法としては、それ以外に以下の3通りがある。   The index table control unit 4 selects the index table 2 [nr] corresponding to the entry number [nr] of the bucket length [nr] where the bucket length [n] (n = 0... N-1) is the minimum value. However, the present invention is not limited to this, and there are the following three other index table selection methods for selecting the index table 2 [nr] to be registered.

一つ目の索引テーブル選択方法では、空きバケット長[n] (n=0…N-1)が0よりも大きいバケット10[n] (n=0…N-1)の中で索引テーブル番号[n] (n=0…N-1)が最小値の索引テーブル番号[nr]を持つ索引テーブル2[nr]を選択する。   In the first index table selection method, the index table number in the bucket 10 [n] (n = 0... N-1) where the empty bucket length [n] (n = 0... N-1) is larger than 0. [n] (n = 0... N-1) is selected as the index table 2 [nr] having the index table number [nr] having the minimum value.

二つ目の索引テーブル選択方法では、空きバケット長[n] (n=0…N-1)の中で最大値をとる空きバケット長[nr] となった索引テーブル番号[nr]を持つ索引テーブル2[nr]を選択する。   In the second index table selection method, an index having an index table number [nr] that is the empty bucket length [nr] that takes the maximum value among the empty bucket lengths [n] (n = 0 ... N-1). Select table 2 [nr].

三つ目の索引テーブル選択方法では、各索引テーブル2[n] (n=0…N-1)が異なるテーブルサイズM(エントリ11[i] (i=0…M-1) の個数)である場合に、空きバケット長[n] (n=0…N-1)を索引テーブル2[n] (n=0…N-1)毎に設定された重み係数で重み付けした重み付け空きバケット長[n] (n=0…N-1)のうち、最大値をとる重み付け空きバケット長[nr]となった索引テーブル番号[nr]を持つ索引テーブル2[nr]を選択する。   In the third index table selection method, each index table 2 [n] (n = 0... N-1) has a different table size M (number of entries 11 [i] (i = 0... M-1)). When there is a weighted free bucket length [n] (n = 0 ... N-1) weighted by a weighting factor set for each index table 2 [n] (n = 0 ... N-1) n] (n = 0... N-1), the index table 2 [nr] having the index table number [nr] having the maximum weighted free bucket length [nr] is selected.

なお、一つ目乃至三つ目の索引テーブル選択方法においては、各索引テーブル2[n] (n=0…N-1)のバケットサイズL(キー格納位置12[i][r] (i=0…M-1) (j=0…L-1)の個数)が異なる場合にも適用することができる。   In the first to third index table selection methods, the bucket size L of each index table 2 [n] (n = 0... N−1) (key storage position 12 [i] [r] (i = 0 ... M-1) (number of j = 0 ... L-1)) is also different.

<検索用のキーに対応したレコードの検索処理手順>
次に、データベース装置1において、検索用のキーKsのキー値に対応した検索対象となるレコードRsのレコード値を転送データベースから検索する検索処理について説明する。なお、索引テーブル制御部4により検索用のキーKsに対応したレコードRsを転送データベースから検索する検索動作については、図5のフローチャートを参照しながら説明する。
<Record search processing procedure corresponding to the search key>
Next, a description will be given of a search process for searching the transfer database for the record value of the record R s to be searched corresponding to the key value of the search key K s in the database device 1. A search operation for searching the transfer database for the record R s corresponding to the search key K s by the index table control unit 4 will be described with reference to the flowchart of FIG.

データベース装置1では、検索用のキーKsに対応したキー値(宛先アドレス)に対応したレコードRsのレコード値(転送先情報)を転送データベースから取得する場合、索引テーブル制御部4は、当該キーKs(宛先アドレス)と、検索命令であることを示す制御信号S2とを入力する(ステップSP11)。 In the database apparatus 1, when the record value (transfer destination information) of the record R s corresponding to the key value (destination address) corresponding to the search key K s is acquired from the transfer database, the index table control unit 4 A key K s (destination address) and a control signal S2 indicating a search command are input (step SP11).

索引テーブル制御部4は、全索引テーブル2[n](n=0…N-1)にそれぞれ対応したN個のハッシュ関数f[n] (n=0…N-1)を用いて、外部から入力した検索用のキーKs(宛先アドレス)からN個のエントリ番号[n] (n=0…N-1)を同時に生成する(ステップSP12[0]、……、ステップSP12[n]、……、ステップSP12[N-1])。 The index table control unit 4 uses the N hash functions f [n] (n = 0... N-1) corresponding to all the index tables 2 [n] (n = 0. N entry numbers [n] (n = 0... N−1) are simultaneously generated from the search key K s (destination address) input from (step SP12 [0],..., Step SP12 [n]). , ..., step SP12 [N-1]).

索引テーブル制御部4は、索引テーブル2[n](n=0…N-1)における各エントリ番号[n] (n=0…N-1)の各バケット10[n] (n=0…N-1)に既に格納されている最大L個のキー値(宛先アドレス値)を取得する(ステップSP13[0]、……、ステップSP13[n]、……、ステップSP13[N-1])。   The index table control unit 4 stores each bucket 10 [n] (n = 0...) Of each entry number [n] (n = 0... N−1) in the index table 2 [n] (n = 0... N−1). N maximum key values (destination address values) already stored in N-1) are acquired (step SP13 [0],..., Step SP13 [n],..., Step SP13 [N-1]). ).

索引テーブル制御部4は、ステップSP13[0]、……、ステップSP13[n]、……、ステップSP13[N-1]によりそれぞれ取得した最大L個のキー値(宛先アドレス値)のうち、検索用のキーKs(宛先アドレス)と一致するキー値(宛先アドレス値)が格納されている索引テーブル番号[ns]と、そのキー格納位置[ns][js]とを探索する(ステップS14)。 The index table control unit 4 includes, among the maximum L key values (destination address values) acquired in step SP13 [0],..., Step SP13 [n],. An index table number [ns] storing a key value (destination address value) matching the search key K s (destination address) and its key storage position [ns] [js] are searched (step S14). ).

ここで、キー格納位置12[ns][js] における[ns]は、検索用のキーKs(宛先アドレス)と一致するキー値(宛先アドレス値)が格納されていた索引テーブル番号[ns]であり、[js]はその索引テーブル番号[ns]の索引テーブル2[ns]のうち、検索用のキーKs(宛先アドレス)と一致するキー値(宛先アドレス値)が格納されていたキー格納位置を特定するバケット内キー格納位置番号[js]である。 Here, [ns] at the key storage position 12 [ns] [js] is the index table number [ns] in which the key value (destination address value) that matches the search key K s (destination address) is stored. [Js] is a key in which a key value (destination address value) matching the search key K s (destination address) is stored in the index table 2 [ns] of the index table number [ns]. This is the key storage position number [js] in the bucket that identifies the storage position.

索引テーブル制御部4は、検索用のキーKs(宛先アドレス)と一致するキー値(宛先アドレス値)を索引テーブル番号[ns]の索引テーブル2[ns]の中から見つけられたか否かを判定し(ステップSP15)、見つけられた場合には、索引テーブル2[ns]を示す索引テーブル番号[ns]、エントリ番号[ns]、キー格納位置12[ns][js]を示すバケット内キー格納位置番号[js]を上述した(式1)に代入する。 The index table control unit 4 determines whether or not a key value (destination address value) matching the search key K s (destination address) has been found in the index table 2 [ns] of the index table number [ns]. If it is determined (step SP15) and found, the index table number [ns] indicating the index table 2 [ns], the entry number [ns], and the key in the bucket indicating the key storage position 12 [ns] [js] The storage position number [js] is assigned to the above (Equation 1).

これにより索引テーブル制御部4は、レコードエントリ20[k]のレコードエントリ番号[k] (k=0…K-1)を次の(式3)により算出し、これをレコードテーブル制御部5に供給し(ステップSP16)、索引テーブル制御部4の検索処理を終了する。
k=索引テーブル番号[ns]×M×L+エントリ番号[ns]×L+js………………(式3)
As a result, the index table control unit 4 calculates the record entry number [k] (k = 0... K−1) of the record entry 20 [k] by the following (Equation 3), and sends this to the record table control unit 5. (Step SP16), and the search process of the index table control unit 4 is terminated.
k = index table number [ns] x M x L + entry number [ns] x L + js (Equation 3)

レコードテーブル制御部5(図1)は、索引テーブル制御部4と同様に外部から検索命令を意味する制御信号S2が既に入力されており、その状態で索引テーブル制御部4から供給されたレコードテーブル3のレコードエントリ番号[k]を入力する。   As with the index table control unit 4, the record table control unit 5 (FIG. 1) has already received a control signal S2 indicating a search command from the outside, and the record table supplied from the index table control unit 4 in that state. 3 record entry number [k] is entered.

レコードテーブル制御部5は、検索命令を意味する制御信号S2にしたがって、レコードエントリ番号[k] (k=0…K-1)に対応したレコードテーブル3のレコードエントリ20[k] (k=0…K-1)から検索対象となるレコードRsのレコード値を取得し、これを外部へ出力する。 The record table control unit 5 records the record entry 20 [k] (k = 0) in the record table 3 corresponding to the record entry number [k] (k = 0... K-1) according to the control signal S2 meaning a search command. ... the record value of the record R s to be searched is acquired from K-1) and output to the outside.

ところで、索引テーブル制御部4は、検索用のキーKs(宛先アドレス)と一致するキー値(宛先アドレス値)を索引テーブル番号[ns]の索引テーブル2[ns]の中から見つけられなかった場合、検索用のキーKsのキー値は索引テーブル2[n]に未登録であるので、見つけられなかったことを表したレコード値を出力するといった検索不可時の処理を行う(ステップSP17)。 By the way, the index table control unit 4 could not find the key value (destination address value) matching the search key K s (destination address) from the index table 2 [ns] of the index table number [ns]. In this case, since the key value of the search key K s is not registered in the index table 2 [n], a process when the search is impossible is performed such as outputting a record value indicating that the key was not found (step SP17). .

索引テーブル制御部4は、ステップSP17における検索不可時の他の処理として、例えば、未登録となった検索用のキーKs(以下、これを「未登録検索キーKs」と呼ぶ。)の検索回数をカウンタにより計数し、計数する度に更新し、その計数値を保持しておくもできる。 The index table control unit 4 performs, for example, an unregistered search key K s (hereinafter referred to as “unregistered search key K s ”) as another process when search is impossible in step SP17. The number of searches can be counted by a counter, updated every time it is counted, and the count value can be held.

あるいは索引テーブル制御部4は、ステップSP17における検索不可時の他の処理として、未登録となった検索用のキーKsに対するデフォルトのレコード値をレコードテーブル3から取得するため、索引テーブル2[ns]には登録済のレコード値が無いことを意味する特別なレコードエントリ番号[k] (k=0…K-1)を生成し、これをレコードテーブル制御部5へ供給することもできる。 Alternatively, the index table control unit 4 obtains a default record value for the unregistered search key K s from the record table 3 as another process when the search is not possible in step SP17. ] Can generate a special record entry number [k] (k = 0... K-1), which means that there is no registered record value, and supply it to the record table control unit 5.

<第1の実施の形態における効果>
第1の実施の形態におけるデータベース装置1と、既存技術を用いた従来のデータベース装置とをメモリ使用効率の観点から比較検討する。
<Effect in the first embodiment>
The database apparatus 1 in the first embodiment and a conventional database apparatus using existing technology are compared and examined from the viewpoint of memory usage efficiency.

例えば、第1の実施の形態におけるデータベース装置1における索引テーブル2[n]の個数Nを「2」、各索引テーブル2[n](n=1,2)のテーブルサイズM(エントリ数すなわちバケット数)を「512」に固定する。また、各索引テーブル2[n](n=1,2)のバケットサイズL(キー格納位置[i][j] (i=0…M-1) (j=0…L-1)の個数)は全て同値とし、合計バケットサイズを「L×2」とする。   For example, the number N of index tables 2 [n] in the database apparatus 1 in the first embodiment is “2”, and the table size M (number of entries, ie buckets) of each index table 2 [n] (n = 1, 2) The number is fixed to “512”. The number of bucket sizes L (key storage positions [i] [j] (i = 0... M-1) (j = 0... L-1) of each index table 2 [n] (n = 1, 2). ) Are all the same value, and the total bucket size is “L × 2”.

この合計バケットサイズである「L×2」をパラメータとして、一定個数のランダム値からなる登録用のキーKrを全て転送データベースに登録するために必要なバケットサイズLをシミュレーションにより求めた。 Using the total bucket size “L × 2” as a parameter, the bucket size L necessary for registering all the registration keys K r made up of a fixed number of random values in the transfer database was obtained by simulation.

具体的には、16000個のランダム値からなる登録用のキーKrを転送データベースに登録する場合を多数回試行し、各試行において、登録できなかったキーKrが発生したか否かを判定した。さらに、登録できなかったキーKrが発生した試行回数をカウンタにより計数し(上述したステップSP9における登録不可時の処理)、その計数値を全試行回数で除算した値を登録失敗発生率として取得した。 Specifically, the case of registering the key K r for registration consisting 16000 random value to the forwarding database attempts multiple times in each trial, determine whether the key K r which can not be registered is generated did. Further, the number of trials in which the key Kr that could not be registered is counted by a counter (processing when registration is impossible in the above-described step SP9), and a value obtained by dividing the count value by the total number of trials is obtained as a registration failure occurrence rate. did.

なお、第1の実施の形態では、索引テーブル2[n]の個数Nが「2」であるため、2個の索引テーブル2[n](n=1,2)における各々のエントリ番号[n]を生成するための2個のハッシュ関数f[n] (n=1,2)が必要となる。これら2個のハッシュ関数f[n]としては、1つのキー値から互いに相関のないエントリ番号[n]を生成できる関数を採用する。   In the first embodiment, since the number N of index tables 2 [n] is “2”, each entry number [n in two index tables 2 [n] (n = 1, 2) ] To generate two hash functions f [n] (n = 1, 2) are required. As these two hash functions f [n], a function that can generate entry numbers [n] having no correlation with each other from one key value is adopted.

例えば、キー値に対してCRC(Cyclic Redundancy Check)演算を施したビット列を2分割してエントリ番号[n]に用いたり、異なる2個のIV(Initial Vector)を用いてキー値に暗号演算を施した2個のビット列をエントリ番号[n]に用いる等の方法がある。   For example, a bit string obtained by performing a CRC (Cyclic Redundancy Check) operation on the key value is divided into two and used for the entry number [n], or the key value is encrypted using two different IVs (Initial Vectors) There is a method of using the two applied bit strings for the entry number [n].

比較対象とする既存技術を用いたデータベース装置では、1個の索引テーブル2[n]を有し、その索引テーブル2[n]のテーブルサイズMを第1の実施の形態におけるデータベース装置1と同じ「512」に固定する。また、1個の索引テーブル2[n]の合計バケットサイズ(この場合、索引テーブル2[n]が1個なので合計バケットサイズ=バケットサイズである)をパラメータとして、一定個数のランダム値からなる登録用のキーKrを全て転送データベースに登録するために必要なバケットサイズLをシミュレーションにより求めた。 The database device using the existing technology to be compared has one index table 2 [n], and the table size M of the index table 2 [n] is the same as that of the database device 1 in the first embodiment. Fix to “512”. Also, a registration consisting of a fixed number of random values using as a parameter the total bucket size of one index table 2 [n] (in this case, the total bucket size = bucket size since there is only one index table 2 [n]) It was determined by simulation of the bucket size L required to register in all transfer database of the key K r of use.

第1の実施の形態におけるデータベース装置1と、既存技術を用いた従来のデータベース装置とを、バケットサイズが同じ条件で比較することによって、2つのデータベース装置で使用されるメモリは同量となる。すなわち、第1の実施の形態におけるデータベース装置1における索引テーブル2[n](n=1,2)が2個で各バケットサイズ「L」のとき、比較対象とすべき従来のデータベース装置における索引テーブル2[n]は1個でバケットサイズ「L×2」となる。   By comparing the database apparatus 1 according to the first embodiment and the conventional database apparatus using the existing technology under the same bucket size, the memory used by the two database apparatuses becomes the same amount. That is, when there are two index tables 2 [n] (n = 1, 2) in the database apparatus 1 in the first embodiment and each bucket size is “L”, the index in the conventional database apparatus to be compared is to be compared. One table 2 [n] is the bucket size “L × 2”.

ここで、第1の実施の形態におけるデータベース装置1および従来のデータベース装置のテーブルサイズMは同値であるため、合計バケットサイズが同値である場合は、索引テーブル2[n]およびレコードテーブル3に使用されるメモリ量は、両者ともに、M×L×2×「キー値1個をレコードテーブル3に格納するために必要なメモリ量」であって同値となる。   Here, since the table size M of the database device 1 in the first embodiment and the conventional database device is the same value, when the total bucket size is the same value, it is used for the index table 2 [n] and the record table 3. Both memory amounts are M × L × 2 × “the amount of memory required to store one key value in the record table 3”, which is the same value.

したがって、第1の実施の形態におけるデータベース装置1と従来のデータベース装置との間で比較したとき、上述した登録失敗発生率が「0」となるときの合計バケットサイズの小さい方が、同じ個数のキーKrのキー値を登録するために必要なメモリ量が小さくなり、メモリ使用効率が高いということになる。 Therefore, when comparing between the database device 1 in the first embodiment and the conventional database device, the smaller total bucket size when the above-described registration failure occurrence rate is “0” is the same number. This means that the amount of memory necessary for registering the key value of the key Kr is reduced, and the memory usage efficiency is high.

図6に、登録失敗発生率が「0」となるときの合計バケットサイズの小さい方がメモリ使用効率の高いことのシミュレーション結果を示す。第1の実施の形態におけるデータベース装置1では、合計バケットサイズ「2×L」が36以上のときに登録失敗発生率が0となったのに対し、従来のデータベース装置では合計バケットサイズ「L」が58以上のときに登録失敗発生率が0となった。   FIG. 6 shows a simulation result that the smaller the total bucket size when the registration failure occurrence rate is “0”, the higher the memory use efficiency. In the database apparatus 1 in the first embodiment, the registration failure occurrence rate becomes 0 when the total bucket size “2 × L” is equal to or larger than 36, whereas in the conventional database apparatus, the total bucket size “L”. The registration failure rate became 0 when the value was 58 or more.

すなわち、16000個のキーKrを登録するために、第1の実施の形態におけるデータベース装置1に必要なメモリ量が、512(テーブルサイズM)×36(バケットサイズ)×(キー値のキー長+レコード値のレコード長)であるのに対し、従来のデータベース装置では512(テーブルサイズM)×58(バケットサイズ)×(キー値のキー長+レコード値のレコード長)となる。   That is, in order to register 16000 keys Kr, the amount of memory necessary for the database apparatus 1 in the first embodiment is 512 (table size M) × 36 (bucket size) × (key length of key value + In the conventional database apparatus, 512 (table size M) × 58 (bucket size) × (key value key length + record value record length).

したがって、第1の実施の形態におけるデータベース装置1では、転送データベースに必要なメモリ量を38%(1−(36/58))も削減することができたことになる。また、第1の実施の形態におけるデータベース装置1では、最大512×36個のキーKrを登録できるメモリに16000個のキーKrを登録しているので、そのメモリ使用効率は87%(16000/(512×36))であるのに対し、従来のデータベース装置では最大512×58個のキーKrを登録できるメモリに16000個のキーKrを登録しているので、そのメモリ使用効率は54%(16000/(512×58))である。 Therefore, in the database apparatus 1 in the first embodiment, the amount of memory required for the transfer database can be reduced by 38% (1- (36/58)). In the database apparatus 1 according to the first embodiment, since 16000 keys Kr are registered in a memory capable of registering a maximum of 512 × 36 keys K r , the memory usage efficiency is 87% (16000/1). On the other hand, in the conventional database apparatus, since 16000 keys Kr are registered in a memory capable of registering a maximum of 512 × 58 keys Kr, the memory usage efficiency is 54% ( 16000 / (512 × 58)).

ところで従来のデータベース装置では、索引テーブル2[n]が1個であり、1種類のハッシュ関数f[n](n=0)により登録用のキーKrを当該索引テーブル2[n]のエントリ番号[n]に変換するだけである。このため、従来のデータベース装置では、複数のハッシュ関数f[n])(n=0…N-1)を用いる場合に比べて、異なるキーKrであっても同じハッシュ値のエントリ番号に変換される確率が高い。したがって、従来のデータベース装置では、同じエントリ番号のバケットに最大L個(例えば少なくとも58個)までのキー値を格納できるメモリ容量が必要になる。 By the way, in the conventional database apparatus, there is one index table 2 [n], and a registration key K r is entered in the index table 2 [n] by one type of hash function f [n] (n = 0). Just convert it to the number [n]. For this reason, in the conventional database apparatus, even when different keys K r are used, the same hash value entry number is converted as compared with the case where a plurality of hash functions f [n]) (n = 0... N−1) are used. The probability of being done is high. Therefore, the conventional database device requires a memory capacity that can store up to L (for example, at least 58) key values in a bucket having the same entry number.

これに対して、第1の実施の形態におけるデータベース装置1では、索引テーブル制御部4がN個の索引テーブル2[n] (n=0…N-1)にそれぞれ対応したN個のハッシュ関数f[n] (n=0…N-1)を有し、登録用のキーKrをN個のハッシュ関数f[n] (n=0…N-1)により索引テーブル2[n] (n=0…N-1)毎に互いに相関のないエントリ番号[n]を生成できるので、これらのエントリ番号[n]が同じハッシュ値となる確率は非常に低くなる。 On the other hand, in the database device 1 in the first embodiment, the index table control unit 4 has N hash functions respectively corresponding to the N index tables 2 [n] (n = 0... N−1). f [n] (n = 0... N-1), and the registration key Kr is indexed by indexing table 2 [n] (N hash functions f [n] (n = 0 ... N-1). Since entry numbers [n] that are not correlated with each other can be generated every n = 0... N−1), the probability that these entry numbers [n] have the same hash value is very low.

したがって、データベース装置1では、同じエントリ番号[n]のバケット10[n]に対して格納するキー値の個数が少なくなる。そしてデータベース装置1では、バケット長[nr]が最小値のバケット[nr]から順番に当該キー値を格納していくことにより、索引テーブル2[n]間において格納されているキー値の個数にばらつきが少なく平坦化されるので、同じエントリ番号[n]のバケット10[n]に格納するキー値のメモリ容量は少なくて済む。   Therefore, in the database apparatus 1, the number of key values stored for the bucket 10 [n] having the same entry number [n] is reduced. The database device 1 stores the key values in order from the bucket [nr] having the smallest bucket length [nr], thereby obtaining the number of key values stored between the index tables 2 [n]. Since the variation is flattened with little variation, the memory capacity of the key value stored in the bucket 10 [n] of the same entry number [n] can be small.

このように、データベース装置1では、N個の索引テーブル2[n] (n=0…N-1) にそれぞれ対応したN個のハッシュ関数f[n] (n=0…N-1)により登録用のキーKrをN個のエントリ番号[n] (n=0…N-1)に同時に変換し、その各エントリ番号[n] (n=0…N-1)の各バケット10[n]に対して当該キーKrに対応したキー値を登録する。これにより、索引テーブル2[n] (n=0…N-1)およびレコードテーブル3のメモリ使用効率を大幅に改善することが可能であり、一定数の登録用のキーKrを格納するために必要な索引テーブル2[n] (n=0…N-1)およびレコードテーブル3に必要なメモリ量を大幅に削減することができるという優れた効果を得ることができる。 As described above, the database apparatus 1 uses the N hash functions f [n] (n = 0... N-1) corresponding to the N index tables 2 [n] (n = 0... N-1), respectively. The registration key K r is simultaneously converted into N entry numbers [n] (n = 0... N−1), and each bucket 10 [ registering a key value corresponding to the key K r with respect to n]. Thereby, the memory usage efficiency of the index table 2 [n] (n = 0... N-1) and the record table 3 can be greatly improved, and a certain number of registration keys Kr are stored. The index table 2 [n] (n = 0... N-1) required for the record table 3 and the memory amount required for the record table 3 can be greatly reduced.

<第1の実施の形態に対応した他の実施の形態>
なお、レコードテーブル3は、上述した構成に限るものではなく、図1に示したようなN個の索引テーブル2[n]と同様に、N個のメモリからなるレコードテーブル3[n](n=0…N-1)として構成してもよい。この場合、各レコードテーブル3[n] (n=0…N-1)のテーブルサイズkは、索引テーブル2[n]のテーブルサイズM(索引テーブルのエントリ数(バケット数))×各バケットのバケットサイズL(キー格納位置[i][j] (i=0…M-1) (j=0…L-1)の個数)となる。
<Another embodiment corresponding to the first embodiment>
Note that the record table 3 is not limited to the above-described configuration, and similarly to the N index tables 2 [n] as shown in FIG. 1, the record table 3 [n] (n = 0 ... N-1). In this case, the table size k of each record table 3 [n] (n = 0... N-1) is the table size M of the index table 2 [n] (number of entries in the index table (number of buckets)) × of each bucket. Bucket size L (the number of key storage positions [i] [j] (i = 0... M-1) (j = 0... L-1)).

また、索引テーブル2[n]に格納したキー値と対応するレコード値は、索引テーブル番号[n] (n=0…N-1)、エントリ番号[i] (i=0…M-1)、バケット内キー格納位置番号[j] (j=0…L-1)を用いて、レコードテーブル3[n]のレコードエントリ番号[k](k=(i×L+j)により特定されるレコードエントリ20[k] (k=0…K-1)に格納される。   The record value corresponding to the key value stored in the index table 2 [n] is the index table number [n] (n = 0... N-1) and the entry number [i] (i = 0... M-1). , The record entry specified by the record entry number [k] (k = (i × L + j) in the record table 3 [n] using the in-bucket key storage position number [j] (j = 0... L-1). 20 [k] (k = 0... K-1).

このようにN個のメモリからなるN個のレコードテーブル3[n](n=0…N-1)を用いることにより、複数のキー値にそれぞれ対応した各レコード値にアクセスするとき、各キー値の格納された索引テーブル2[n]が異なっているのであれば、各レコード値の格納されたレコードテーブル3[n]すなわちメモリも異なることになる。このため、データベース装置1は各レコード値に対して同時並行的にアクセスすることが可能となり、各キー値のアクセスを行う処理を並列化して高スループット化することができる。   By using N record tables 3 [n] (n = 0... N-1) made up of N memories in this way, when accessing each record value corresponding to a plurality of key values, each key is accessed. If the index table 2 [n] storing values is different, the record table 3 [n] storing each record value, that is, the memory is also different. For this reason, the database device 1 can access each record value simultaneously and in parallel, and the processing for accessing each key value can be parallelized to increase the throughput.

<第2の実施の形態>
以下、本発明における第2の実施の形態におけるデータベース装置の構成について図7を用いて説明する。なお、第2の実施の形態におけるデータベース装置100において、図1に示されたデータベース装置1と同一の構成要素には同一の符号を用る。
<Second Embodiment>
Hereinafter, the configuration of the database apparatus according to the second embodiment of the present invention will be described with reference to FIG. Note that in the database device 100 according to the second embodiment, the same reference numerals are used for the same constituent elements as those of the database device 1 shown in FIG.

このデータベース装置100においても、CPU(Central Processing Unit)、メモリ、インタフェース等からなるコンピュータ(ハードウェア)にコンピュータプログラム(ソフトウェア)をインストールすることによって実現され、当該データベース装置100の機能は、コンピュータの各種ハードウェア資源とコンピュータプログラムとが協働することによって実現される。また、コンピュータプログラムは、コンピュータ読取可能な記録媒体や記憶装置に格納された状態で提供されても良く、或いは電気通信回線を介して提供されても良い。   The database apparatus 100 is also realized by installing a computer program (software) in a computer (hardware) including a CPU (Central Processing Unit), a memory, an interface, and the like. This is realized by the cooperation of hardware resources and computer programs. Further, the computer program may be provided in a state of being stored in a computer-readable recording medium or a storage device, or may be provided via an electric communication line.

このデータベース装置100は、登録用のキーKrのキー値(宛先アドレス値)を複数格納するN個の索引テーブル2[n] (n=0…N-1)、当該索引テーブル2[n] (n=0…N-1)に格納された複数のキー値(宛先アドレス値)にそれぞれ対応した複数のレコード値(転送先情報)を格納するレコードテーブル3、キー値に対応したレコード値の検索を制御する検索用の索引テーブル制御部110、キー値およびレコード値の登録を制御する登録用の索引テーブル制御部111、キー値に対応したレコード値をレコードテーブル3から取得する制御を行う検索用のレコードテーブル制御部120およびキー値に対応したレコード値をレコードテーブル3に格納する制御を行う登録用のレコードテーブル制御部121により構成されている。 The database apparatus 100 includes N index tables 2 [n] (n = 0... N-1) for storing a plurality of key values (destination address values) of a registration key Kr , and the index table 2 [n]. a record table 3 for storing a plurality of record values (transfer destination information) respectively corresponding to a plurality of key values (destination address values) stored in (n = 0... N-1), and a record value corresponding to the key value Search index table control unit 110 that controls search, index table control unit 111 for registration that controls registration of key values and record values, and search that performs control to acquire record values corresponding to key values from the record table 3 The record table control unit 120 for registration and the record table control unit 121 for registration that performs control to store the record value corresponding to the key value in the record table 3 are configured.

すなわち、第1の実施の形態におけるデータベース装置1との相違点は、当該データベース装置1では、1つの索引テーブル制御部4および1つのレコードテーブル制御部5を用いているが、第2の実施の形態におけるデータベース装置100においては、検索用の索引テーブル制御部110、登録用の索引テーブル制御部111、検索用のレコードテーブル制御部120、登録用のレコードテーブル制御部121に分けられている点である。   That is, the difference from the database device 1 in the first embodiment is that the database device 1 uses one index table control unit 4 and one record table control unit 5, but the second embodiment The database apparatus 100 according to the embodiment is divided into a search index table control unit 110, a registration index table control unit 111, a search record table control unit 120, and a registration record table control unit 121. is there.

N個の索引テーブル2[n] (n=0…N-1)は、第1の実施の形態における索引テーブル2[n] (n=0…N-1)の構成と同じであるが、検索用の索引テーブル制御部110および登録用の索引テーブル制御部111から同時にアクセス可能なメモリが用いられている。ここで、検索用の索引テーブル制御部110および登録用の索引テーブル制御部111については、第1の実施の形態における索引テーブル制御部4のエントリ番号生成部4aと同一の機能を有するエントリ番号生成部110aおよび111aが設けられている。   The N index tables 2 [n] (n = 0... N-1) are the same as the configuration of the index table 2 [n] (n = 0... N-1) in the first embodiment. A memory that can be accessed simultaneously from the index table control unit 110 for search and the index table control unit 111 for registration is used. Here, for the index table control unit 110 for search and the index table control unit 111 for registration, entry number generation having the same function as the entry number generation unit 4a of the index table control unit 4 in the first embodiment. Portions 110a and 111a are provided.

同様に、レコードテーブル3は、第1の実施の形態と同様の構成であるが、N個の索引テーブル2[n] (n=0…N-1)と同様に、検索用のレコードテーブル制御部120および登録用のレコードテーブル制御部121から同時にアクセス可能なメモリが用いられている。   Similarly, the record table 3 has the same configuration as that of the first embodiment, but similarly to the N index tables 2 [n] (n = 0... N−1), the record table control for search is controlled. A memory that can be simultaneously accessed from the unit 120 and the record table control unit 121 for registration is used.

索引テーブル登録部としての登録用の索引テーブル制御部111は、第1の実施の形態における索引テーブル制御部4の登録処理手順(図4)と同様の動作により登録用のキーKrのキー値を索引テーブル2[n] (n=0…N-1)に登録する。索引テーブル検索部としての検索用の索引テーブル制御部110は、第1の実施の形態における索引テーブル制御部4の検索処理手順(図5)と同様の動作により検索用のキーKsに対応したレコードRsのレコード値をレコードテーブル3から取得する。 The index table control unit 111 for registration as the index table registration unit performs the key value of the registration key K r by the same operation as the registration processing procedure (FIG. 4) of the index table control unit 4 in the first embodiment. Are registered in the index table 2 [n] (n = 0... N-1). The search index table control unit 110 as the index table search unit corresponds to the search key K s by the same operation as the search processing procedure (FIG. 5) of the index table control unit 4 in the first embodiment. The record value of the record R s is acquired from the record table 3.

レコードテーブル登録部としての登録用のレコードテーブル制御部121は、第1の実施の形態におけるレコードテーブル制御部5と同様に、登録用のキーKrのキー値を索引テーブル2[n] (n=0…N-1)に登録するのに合わせて、当該キー値に対応したレコードRrのレコード値をレコードテーブル3に登録する。レコードテーブル検索部としての検索用のレコードテーブル制御部120は、第1の実施の形態におけるレコードテーブル制御部5と同様に、検索用のキーKsのキー値に対応したレコードRsのレコード値をレコードテーブル3から検索して取得する。 As with the record table control unit 5 in the first embodiment, the registration record table control unit 121 as the record table registration unit uses the key value of the registration key K r as the index table 2 [n] (n = 0... N−1), the record value of the record R r corresponding to the key value is registered in the record table 3. The record table control unit 120 for search as the record table search unit is the record value of the record R s corresponding to the key value of the search key K s , similarly to the record table control unit 5 in the first embodiment. Is retrieved from the record table 3 and acquired.

データベース装置1(図1)では、登録用および検索用を兼ねた索引テーブル制御部4およびレコードテーブル制御部5により、登録用のキーKrに対する登録動作と検索用のキーKsに基づく検索動作とを同時に行なわず、登録動作と検索動作とを順番に行うため、頻繁な登録処理によって検索処理のスループットが低下する場合がある。 In the database apparatus 1 (FIG. 1), the registration operation for the registration key K r and the search operation based on the search key K s are performed by the index table control unit 4 and the record table control unit 5 that serve both for registration and search. Since the registration operation and the search operation are performed in order without simultaneously performing the above and the search operations, the search processing throughput may be reduced due to frequent registration processing.

これに対してデータベース装置100(図6)では、検索用の索引テーブル制御部110および登録用の索引テーブル制御部111により索引テーブル2[n] (n=0…N-1)に対して同時にキー値の登録処理および検索処理を実行できるとともに、検索用のレコードテーブル制御部120および登録用のレコードテーブル制御部121によりレコードテーブル3に対して同時にレコード値の登録処理および検索処理を実行できるので、キーKrの登録処理によって検索処理のスループットを低下させることがないという効果を得ることができる。 On the other hand, in the database apparatus 100 (FIG. 6), the index table control unit 110 for search and the index table control unit 111 for registration simultaneously apply to the index table 2 [n] (n = 0... N−1). The key value registration process and the search process can be executed, and the record value registration process and the search process can be simultaneously executed for the record table 3 by the record table control unit 120 for search and the record table control unit 121 for registration. Thus, it is possible to obtain an effect that the throughput of the search process is not reduced by the registration process of the key Kr .

<第3の実施の形態>
以下、本発明における第3の実施の形態におけるデータベース装置の構成について図8を用いて説明する。なお、第3の実施の形態におけるデータベース装置200において、図1に示されたデータベース装置1と同一の構成要素には同一の符号を用る。
<Third Embodiment>
Hereinafter, the configuration of the database apparatus according to the third embodiment of the present invention will be described with reference to FIG. Note that, in the database device 200 according to the third embodiment, the same components as those in the database device 1 shown in FIG.

このデータベース装置200においても、CPU(Central Processing Unit)、メモリ、インタフェース等からなるコンピュータ(ハードウェア)にコンピュータプログラム(ソフトウェア)をインストールすることによって実現され、当該データベース装置200の機能は、コンピュータの各種ハードウェア資源とコンピュータプログラムとが協働することによって実現される。また、コンピュータプログラムは、コンピュータ読取可能な記録媒体や記憶装置に格納された状態で提供されても良く、或いは電気通信回線を介して提供されても良い。   The database apparatus 200 is also realized by installing a computer program (software) in a computer (hardware) including a CPU (Central Processing Unit), a memory, an interface, and the like. This is realized by the cooperation of hardware resources and computer programs. Further, the computer program may be provided in a state of being stored in a computer-readable recording medium or a storage device, or may be provided via an electric communication line.

<データベース装置の全体構成>
図8に示すように、第3の実施の形態におけるデータベース装置200は、複数のキーに対応したキー値(宛先アドレス値)を格納するN個の索引テーブル2[n](n=0…N-1)、索引テーブル2[n] (n=0…N-1)に格納された複数のキー値(宛先アドレス値)にそれぞれ対応した複数のレコード値(転送先情報)を格納するN個のレコードテーブル3[n] (n=0…N-1)、索引テーブル2[n] (n=0…N-1)およびレコードテーブル3[n] (n=0…N-1)に対するキー値(宛先アドレス値)およびレコード値の検索動作を制御するN個の索引テーブル検索部210[n] (n=0…N-1)、キー値の索引テーブル2[n] (n=0…N-1)に対する登録動作を制御する索引テーブル登録部211によって構成されている。
<Overall configuration of database device>
As shown in FIG. 8, the database apparatus 200 according to the third embodiment has N index tables 2 [n] (n = 0... N that store key values (destination address values) corresponding to a plurality of keys. -1), N for storing a plurality of record values (transfer destination information) respectively corresponding to a plurality of key values (destination address values) stored in the index table 2 [n] (n = 0... N-1) Keys for record table 3 [n] (n = 0 ... N-1), index table 2 [n] (n = 0 ... N-1) and record table 3 [n] (n = 0 ... N-1) N index table search units 210 [n] (n = 0... N-1) for controlling search operations of values (destination address values) and record values, key value index tables 2 [n] (n = 0. The index table registration unit 211 controls the registration operation for (N-1).

なお、データベース装置200においては、N個の索引テーブル2[n] (n=0…N-1)およびN個のレコードテーブル3[n] (n=0…N-1)がそれぞれ対応付けられた組によって構成されている。また、索引テーブル2[n] (n=0…N-1)およびレコードテーブル3[n] (n=0…N-1)のそれぞれの組に対しては、索引テーブル登録部211および索引テーブル検索部210[n] (n=0…N-1)から同時にアクセス可能となっている。   In the database apparatus 200, N index tables 2 [n] (n = 0... N-1) and N record tables 3 [n] (n = 0... N-1) are associated with each other. It is composed of a set. For each set of the index table 2 [n] (n = 0... N-1) and the record table 3 [n] (n = 0... N-1), the index table registration unit 211 and the index table. Access is possible simultaneously from the search unit 210 [n] (n = 0... N-1).

ところで第3の実施の形態におけるデータベース装置200においても、第1の実施の形態におけるデータベース装置1と同様に、代表的な実装における索引テーブル数Nは「2」であり、第1の実施の形態のように、最少の回路規模でメモリ使用効率を従来のデータベース装置よりも大幅に改善することが可能である。   By the way, also in the database apparatus 200 in the third embodiment, the number N of index tables in the representative implementation is “2” as in the database apparatus 1 in the first embodiment. As described above, it is possible to greatly improve the memory use efficiency as compared with the conventional database apparatus with the minimum circuit scale.

また、データベース装置200においては、索引テーブル数Nを「3」以上に増大させること、すなわち索引テーブル数Nに対応したN個のハッシュ関数f[n](n=0〜3)を用いることが可能である。   In the database apparatus 200, the number N of index tables is increased to “3” or more, that is, N hash functions f [n] (n = 0 to 3) corresponding to the number N of index tables are used. Is possible.

これによりデータベース装置200は、1つのハッシュ関数f[n](n=1)を用いる場合に比べて、複数のハッシュ関数f[n] (n=0〜3) を用いることにより、複数の登録用のキーKrから生成されるエントリ番号11[n] (n=0〜3)が衝突する確率を低減させることができる。かくしてデータベース装置200は、従来のデータベース装置のようにエントリ番号11[i]の衝突が起きたときに、そのエントリ番号11[i]のバケット10[i]にバケットサイズL以上の複数のキー値が格納されることによるオーバーフローを未然に防止することが可能となる。 As a result, the database device 200 uses a plurality of hash functions f [n] (n = 0 to 3) as compared to a case where one hash function f [n] (n = 1) is used, thereby allowing a plurality of registrations. entry number 11 which is generated from the key K r of use [n] (n = 0~3) it is possible to reduce the probability of collision. Thus, the database device 200, when the collision of the entry number 11 [i] occurs as in the conventional database device, a plurality of key values greater than or equal to the bucket size L in the bucket 10 [i] of the entry number 11 [i]. It is possible to prevent overflow due to the storage of.

<索引テーブルの構成>
索引テーブル2[n] (n=0…N-1)の構成は、第1の実施の形態と同一であり、その構成は図2に示された通りである。索引テーブル2[n] (n=0…N-1)はメモリであり、各索引テーブル2[n]はM個のエントリ11[i](i=0…M-1)を有している。このエントリ11[i](i=0…M-1)は、複数のキー値(宛先アドレス値)を格納可能なL個のキー格納位置12[i][j] (i=0…M-1) (j=0…L-1)が設けられたバケット10[i](i=0…M-1)として構成されている。
<Configuration of index table>
The configuration of the index table 2 [n] (n = 0... N-1) is the same as that of the first embodiment, and the configuration is as shown in FIG. The index table 2 [n] (n = 0... N-1) is a memory, and each index table 2 [n] has M entries 11 [i] (i = 0... M-1). . This entry 11 [i] (i = 0... M-1) has L key storage positions 12 [i] [j] (i = 0... M-) that can store a plurality of key values (destination address values). 1) It is configured as a bucket 10 [i] (i = 0... M-1) provided with (j = 0... L-1).

したがって、索引テーブル2[n](n=0…N-1)毎に設けられたキー格納位置12[i][j] (i=0…M-1) (j=0…L-1)の個数は、各索引テーブル2[n] (n=0…N-1)のテーブルサイズM(索引テーブル2[n]のエントリ数(バケット数))×各バケットのバケットサイズL(キー格納位置12[i][j]の個数)により表される。   Therefore, the key storage position 12 [i] [j] (i = 0 ... M-1) (j = 0 ... L-1) provided for each index table 2 [n] (n = 0 ... N-1). Is the table size M of each index table 2 [n] (n = 0... N-1) (number of entries in the index table 2 [n] (number of buckets)) × bucket size L of each bucket (key storage location) 12 [i] [j]).

なお、索引テーブル2[n] (n=0…N-1)のテーブルサイズMやバケットサイズLは、索引テーブル2[n] (n=0…N-1)毎に異なる値とすることが可能であるが、代表的な実装における索引テーブルサイズMやバケットサイズLは、全索引テーブル2[n] (n=0…N-1)において同値とすることができる。   The table size M and bucket size L of the index table 2 [n] (n = 0... N-1) may be different values for each index table 2 [n] (n = 0... N-1). Although possible, the index table size M and bucket size L in a typical implementation can be the same in all index tables 2 [n] (n = 0... N−1).

これによりデータベース装置200では、登録用のキーKrの索引テーブル2[n] (n=0…N-1)に対する登録動作において、各索引テーブル2[n] (n=0…N-1)のバケット[n]のうち最小のバケット長[nr]に基づいて当該キーKrのキー値を格納する索引テーブル2[n] (n=0…N-1)を選択する処理(ステップSP5)を行う。これによりデータベース装置200では、第1の実施の形態と同様に、索引テーブル2[n] (n=0…N-1)およびレコードテーブル3[n] (n=0…N-1)のメモリ使用効率を大幅に改善することが可能となる。 Thus, in the database apparatus 200, in the registration operation for the index table 2 [n] (n = 0... N-1) of the registration key Kr , each index table 2 [n] (n = 0... N-1). index table 2 for storing the key value of the key K r based on the minimum of the bucket length [nr] of the bucket [n] [n] (n = 0 ... n-1) selecting the processing (step SP5) I do. Thereby, in the database apparatus 200, as in the first embodiment, the memory of the index table 2 [n] (n = 0... N-1) and the record table 3 [n] (n = 0... N-1). The usage efficiency can be greatly improved.

<レコードテーブルの構成>
図9には、レコードテーブル3[n] (n=0…N-1)の構成例を示す。ここで、レコードテーブル3[0]、……、3[n]、……、3[N-1]は全て同じ構成であるため、ここでは便宜上、レコードテーブル3[n]について説明する。
<Structure of record table>
FIG. 9 shows a configuration example of the record table 3 [n] (n = 0... N−1). Here, since the record tables 3 [0],..., 3 [n],..., 3 [N-1] all have the same configuration, the record table 3 [n] will be described here for convenience.

レコードテーブル3[n]はメモリであり、索引テーブル2[n]に対応し、当該索引テーブル2[n] のキー格納位置12[i][j] (i=0…M-1) (j=0…L-1)に格納したキー値(宛先アドレス値)の各々に対応したレコード値(転送先情報)を格納可能なレコードエントリ20[k](k=0…K-1)が設けられている。   The record table 3 [n] is a memory and corresponds to the index table 2 [n], and the key storage position 12 [i] [j] (i = 0... M-1) (j) of the index table 2 [n] = 0 ... L-1) is provided with a record entry 20 [k] (k = 0 ... K-1) capable of storing record values (transfer destination information) corresponding to each of the key values (destination address values) stored in It has been.

したがって、索引テーブル2[n](n=0…N-1)毎に設けられたキー格納位置12[i][j] (i=0…M-1) (j=0…L-1)の個数は、上述したように、各索引テーブル2[n] (n=0…N-1)のテーブルサイズM×各バケットのバケットサイズLにより表されるので、レコードテーブル3[n]の各レコードエントリ20[k] (k=0…K-1)に1個のレコード値(転送先情報)を格納する1個のメモリとして構成した場合のレコードテーブル3[n]のレコードテーブルサイズKは、K=M×Lとなる。   Therefore, the key storage position 12 [i] [j] (i = 0 ... M-1) (j = 0 ... L-1) provided for each index table 2 [n] (n = 0 ... N-1). As described above, the number of data is represented by the table size M of each index table 2 [n] (n = 0... N−1) × the bucket size L of each bucket. The record table size K of the record table 3 [n] when configured as one memory for storing one record value (transfer destination information) in the record entry 20 [k] (k = 0... K-1) is , K = M × L.

索引テーブル2[n]のキー格納位置12[i][j] (i=0…M-1) (j=0…L-1)と、レコードテーブル3[n]のレコードエントリ20[k] (k=0…K-1)のレコードエントリ番号[k]との対応付けは、索引テーブル2[n] のキー格納位置12[i][j] (i=0…M-1) (j=0…L-1)に基づいてレコードエントリ20[k] (k=0…K-1)のレコードエントリ番号[k]を一意に算出できる計算方法であればよい。   Key storage position 12 [i] [j] (i = 0 ... M-1) (j = 0 ... L-1) of index table 2 [n] and record entry 20 [k] of record table 3 [n] (k = 0 ... K-1) is associated with the record entry number [k] in the key storage position 12 [i] [j] (i = 0 ... M-1) (j of the index table 2 [n]. = 0... L-1), any calculation method that can uniquely calculate the record entry number [k] of the record entry 20 [k] (k = 0... K-1) may be used.

例えば、1つの計算方法として、索引テーブル2[n]のエントリ11[i]を示すエントリ番号[i] (i=0…M-1)、キー格納位置12[i][j] (i=0…M-1) (j=0…L-1)を示すバケット内キー格納位置番号[j](j=0…L-1)を用いて、レコードエントリ20[k] (k=0…K-1)のレコードエントリ番号[k]を次の(式4)により算出することが可能である。
k=i×L+j…………………………………………………………(式4)
For example, as one calculation method, entry number [i] (i = 0... M-1) indicating entry 11 [i] of index table 2 [n], key storage position 12 [i] [j] (i = 0 ... M-1) Using the in-bucket key storage position number [j] (j = 0 ... L-1) indicating (j = 0 ... L-1), the record entry 20 [k] (k = 0 ... The record entry number [k] of K-1) can be calculated by the following (Equation 4).
k = i × L + j ………………………………………………………… (Formula 4)

<索引テーブル登録部の構成>
索引テーブル登録部およびレコードテーブル登録部としての索引テーブル登録部211は、外部から入力された登録用のキーKrに基づいて各索引テーブル2[n] (n=0…N-1)のエントリ11[i] (i=0…M-1)をそれぞれ特定するエントリ番号[i] (i=0…M-1)を生成するためのN個のハッシュ関数f[n] (n=0…N-1)を備えている。
<Configuration of index table registration unit>
The index table registration unit 211 serving as an index table registration unit and a record table registration unit is configured to enter each index table 2 [n] (n = 0... N-1) based on a registration key K r input from the outside. 11 hash functions f [n] (n = 0... For generating entry numbers [i] (i = 0... M-1) respectively specifying 11 [i] (i = 0... M-1). N-1).

また、索引テーブル登録部211は、登録用のキーKr(宛先アドレス)から当該N個のハッシュ関数f[n] (n=0…N-1)にそれぞれ対応したハッシュ値からなるN個のエントリ番号[n] (n=0…N-1)を生成するエントリ番号生成部211aを有している。 Further, the index table registration unit 211 includes N pieces of hash values each corresponding to the N pieces of hash functions f [n] (n = 0... N−1) from the registration key K r (destination address). An entry number generation unit 211a that generates entry number [n] (n = 0... N−1) is included.

索引テーブル登録部211は、データベース装置1の転送データベース(各索引テーブル2[n] (n=0…N-1)およびレコードテーブル3[n] (n=0…N-1))にキーKrのキー値および当該キーKrに対応したレコードRrのレコード値を登録する場合、登録用のキーKrおよび当該キーKrと対応するレコードRrを外部から入力する。 The index table registration unit 211 stores the key K in the transfer database (each index table 2 [n] (n = 0... N-1) and record table 3 [n] (n = 0... N-1)) of the database device 1. when registering a record value of the record R r corresponding to the r key value and the key K r, and inputs the corresponding record R r key K r and the key K r for registration from the outside.

そして索引テーブル登録部211は、第1の実施の形態における索引テーブル制御部4と同様に、索引テーブル2[n] (n=0…N-1)のうち最少のバケット長[nr]を持つバケット[nr]のキー値が未格納のキー格納位置12[nr][jr]に当該キーKrのキー値を格納するのと併せて、当該索引テーブル2[n] (n=0…N-1)と対応したレコードテーブル3[n] (n=0…N-1)のうち、当該キー格納位置12[nr][jr]に対応したレコードエントリ20[k] (k=0…K-1)に当該レコードRrのレコード値を格納する。 Similarly to the index table control unit 4 in the first embodiment, the index table registration unit 211 has the smallest bucket length [nr] of the index tables 2 [n] (n = 0... N−1). key value of the bucket [nr] is in conjunction with the store a key value of the key K r key storage position of the unstored 12 [nr] [jr], the index table 2 [n] (n = 0 ... n -1) and record entry 20 [k] (k = 0 ... K) corresponding to the key storage position 12 [nr] [jr] in the record table 3 [n] (n = 0 ... N-1). The record value of the record R r is stored in -1).

ところで、索引テーブル登録部211による登録用のキーKrの登録動作において、各索引テーブル2[n] (n=0…N-1)の各エントリ番号[n] (n=0…N-1)により指定した各バケット10[n] (n=0…N-1)について、バケット長(既に格納されているキー値の個数)もしくは空きバケット長(追加で格納可能なキー値の個数)を取得する必要がある。 Incidentally, in the registration operation of the registration key K r by the index table registration unit 211, each entry number [n] (n = 0... N-1) of each index table 2 [n] (n = 0... N-1). ) For each bucket 10 [n] (n = 0 ... N-1) specified by), set the bucket length (number of already stored key values) or empty bucket length (number of additional key values that can be stored) Need to get.

このため索引テーブル登録部211は、索引テーブル2[n] (n=0…N-1)の各々に対応して、当該索引テーブル2[n] (n=0…N-1)の各キー格納位置[i][j] (i=0…M-1) (j=0…L-1) 毎にキー値を格納しているか否かを表すキー格納マップテーブルMP[n] (n=0…N-1)を備える。   For this reason, the index table registration unit 211 corresponds to each index table 2 [n] (n = 0... N-1) and each key of the index table 2 [n] (n = 0... N-1). Key storage map table MP [n] (n = indicating whether or not the key value is stored for each storage position [i] [j] (i = 0 ... M-1) (j = 0 ... L-1) 0 ... N-1).

図10には、キー格納マップテーブルMP[n] (n=0…N-1)の構成例を示す。キー格納マップテーブルMP[n]の実態はメモリであり、当該メモリをM個のエントリ220[i] (i=0…M-1)を有するテーブルとし、さらに、各エントリ220[i] (i=0…M-1)をL個のキー格納フラグ222[i][j] (i=0…M-1) (j=0…L-1)により構成する。ここで、キー格納フラグ222[i][j] (i=0…M-1) (j=0…L-1)は、各エントリ220[i] (i=0…M-1)のエントリ番号[i] (i=0…M-1)と、キー格納位置番号[j](j=0…L-1)によって特定される。   FIG. 10 shows a configuration example of the key storage map table MP [n] (n = 0... N−1). The actual state of the key storage map table MP [n] is a memory. The memory is a table having M entries 220 [i] (i = 0... M-1), and each entry 220 [i] (i = 0... M-1) is constituted by L key storage flags 222 [i] [j] (i = 0... M-1) (j = 0... L-1). Here, the key storage flag 222 [i] [j] (i = 0 ... M-1) (j = 0 ... L-1) is an entry of each entry 220 [i] (i = 0 ... M-1). It is specified by a number [i] (i = 0... M-1) and a key storage position number [j] (j = 0... L-1).

キー格納フラグ222[i][j] (i=0…M-1) (j=0…L-1)は、当該キー格納フラグ222[i][j] (i=0…M-1) (j=0…L-1)と対応した索引テーブル2[n] (n=0…N-1)のキー格納位置[i][j] (i=0…M-1) (j=0…L-1)に登録用のキーKrのキー値が格納されているか否かを表す1ビットの情報である。 The key storage flag 222 [i] [j] (i = 0 ... M-1) (j = 0 ... L-1) is the key storage flag 222 [i] [j] (i = 0 ... M-1). Key storage position [i] [j] (i = 0 ... M-1) of index table 2 [n] (n = 0 ... N-1) corresponding to (j = 0 ... L-1) (j = 0 ... L-1 key values of key K r for registration in) is 1-bit information indicating whether or not it is stored.

索引テーブル登録部211は、キー格納マップテーブルMP[n] (n=0…N-1)のキー格納フラグ222[i][j] (i=0…M-1) (j=0…L-1)にセットされた値を取得することにより、索引テーブル2[n] (n=0…N-1)のキー格納位置[i][j] (i=0…M-1) (j=0…L-1)にキー値が格納されているか否かを知ることができる。   The index table registration unit 211 stores the key storage flag 222 [i] [j] (i = 0 ... M-1) (j = 0 ... L) of the key storage map table MP [n] (n = 0 ... N-1). -1) is obtained, the key storage position [i] [j] (i = 0 ... M-1) (j of the index table 2 [n] (n = 0 ... N-1) is obtained. = 0 ... L-1), it is possible to know whether or not the key value is stored.

また、索引テーブル登録部211は、索引テーブル2[n] (n=0…N-1)のバケット10[i] (i=0…M-1)のバケット長もしくは空きバケット長を取得する場合は、キー格納マップテーブルMP[n] (n=0…N-1)に含まれる全てのキー格納フラグ222[i][j] (i=0…M-1) (j=0…L-1)のうち、バケット10[i] (i=0…M-1)にキー値を格納していることを示す(あるいはキー値を格納していないことを示す)フラグの個数を計数することによって認識することができる。   In addition, the index table registration unit 211 acquires the bucket length or the empty bucket length of the bucket 10 [i] (i = 0 ... M-1) of the index table 2 [n] (n = 0 ... N-1). Are all key storage flags 222 [i] [j] (i = 0 ... M-1) (j = 0 ... L-) included in the key storage map table MP [n] (n = 0 ... N-1). 1), counting the number of flags indicating that key values are stored in bucket 10 [i] (i = 0... M-1) (or indicating that key values are not stored). Can be recognized by.

索引テーブル登録部211は、初期状態(索引テーブル2[n] (n=0…N-1)に対して登録されたキー値が存在しない状態)において、キー格納マップテーブルMP[n] (n=0…N-1)の全フラグをクリアしておき、キーKrのキー値の登録に合わせて、当該登録したキー値のキー格納位置[i][j] (i=0…M-1) (j=0…L-1)に対応するキー格納フラグ222[i][j] (i=0…M-1) (j=0…L-1)のフラグをセットする。 In the initial state (the state in which there is no key value registered for the index table 2 [n] (n = 0... N-1)), the index table registration unit 211 stores the key storage map table MP [n] (n = 0 ... N-1) of the previously clear all flags in accordance with the registration of the key value of the key K r, key storage position of the registration key value [i] [j] (i = 0 ... M- 1) The flag of the key storage flag 222 [i] [j] (i = 0 ... M-1) (j = 0 ... L-1) corresponding to (j = 0 ... L-1) is set.

したがって索引テーブル登録部211は、キーKrのキー値を登録するとき、バケット長の取得のために、各索引テーブル2[n] (n=0…N-1)の1個のバケット10[i] (i=0…M-1)にアクセスし、当該バケット10[i] (i=0…M-1)に格納されているキー値の個数を計数する必要がないので、各索引テーブル2[n] (n=0…N-1)の実態であるメモリに対するアクセスが発生しないのである。 Therefore, when registering the key value of the key K r , the index table registration unit 211 acquires one bucket 10 [[] for each index table 2 [n] (n = 0... N−1) in order to obtain the bucket length. i] (i = 0... M-1) is accessed and there is no need to count the number of key values stored in the bucket 10 [i] (i = 0... M-1). Access to the memory, which is the actual state of 2 [n] (n = 0... N−1), does not occur.

この場合、索引テーブル登録部211では、キー格納マップテーブルMP[n] (n=0…N-1)の実態であるメモリに対するアクセスは発生するが、索引テーブル2[n] (n=0…N-1)の各エントリ11[i] (i=0…M-1)は、キー値を格納できるビット数が必要であるのに対して、キー格納マップテーブルMP[n] (n=0…N-1)の各エントリ220[i] (i=0…M-1)はキー値1個につき1ビットのビット数だけしか必要としない。したがって、索引テーブル2[n] (n=0…N-1)のメモリにアクセスする場合と比較して、キー格納マップテーブルMP[n] (n=0…N-1)に対してアクセスする方が一段と少ない電力消費で済むという効果がある。   In this case, the index table registration unit 211 accesses the memory that is the actual state of the key storage map table MP [n] (n = 0... N−1), but the index table 2 [n] (n = 0. Each entry 11 [i] (i = 0... M-1) of N-1) requires the number of bits that can store the key value, whereas the key storage map table MP [n] (n = 0 ... (N-1) each entry 220 [i] (i = 0... M-1) requires only one bit per key value. Therefore, the key storage map table MP [n] (n = 0... N-1) is accessed as compared to the case of accessing the memory of the index table 2 [n] (n = 0... N-1). This has the effect of consuming less power.

<索引テーブル検索部の構成>
索引テーブル検索部およびレコードテーブル検索部としての各索引テーブル検索部210[n] (n=0…N-1)は、外部から入力する検索用のキーKsを索引テーブル2[n] (n=0…N-1)のエントリ番号[n] (n=0…N-1)に変換するため、索引テーブル2[n] (n=0…N-1)にそれぞれ対応した1個のハッシュ関数f[n] (n=0…N-1)を備えている。すなわち、索引テーブル検索部210[0]はハッシュ関数f[0]を備え、索引テーブル検索部210[n]はハッシュ関数f[n]を備え、索引テーブル検索部210[N-1]はハッシュ関数f[N-1]を備えている。
<Configuration of index table search unit>
Each index table search unit 210 [n] (n = 0... N-1) as an index table search unit and a record table search unit uses a search key K s input from the outside as an index table 2 [n] (n = 0 ... N-1) to convert to entry number [n] (n = 0 ... N-1), one hash corresponding to each index table 2 [n] (n = 0 ... N-1) A function f [n] (n = 0... N-1) is provided. That is, the index table search unit 210 [0] includes a hash function f [0], the index table search unit 210 [n] includes a hash function f [n], and the index table search unit 210 [N−1] The function f [N-1] is provided.

レコードテーブル3[n] (n=0…N-1)から検索用のキーKsのキー値に対応したレコードRsのレコード値を取得する場合、最初に索引テーブル検索部210[0]は、検索用のキーKsを外部から入力し、ハッシュ関数f[0]により生成したエントリ番号[0]により指定される索引テーブル2[0]のバケット10[0]に格納された複数のキー値の中から検索用のキーKsと一致するキー値を探索する。 When acquiring the record value of the record R s corresponding to the key value of the search key K s from the record table 3 [n] (n = 0... N−1), the index table search unit 210 [0] , enter the key K s for the search from the outside, a plurality of keys stored in the bucket 10 [0] of the index table 2 which is designated [0] entry number [0] generated by the hash function f [0] A key value matching the search key K s is searched from the values.

索引テーブル検索部210[0]は、索引テーブル2[0] のバケット10[0]に検索用のキーKsと一致するキー値を見つけた場合、見つけたキー値の索引テーブル2[0]におけるキー格納位置12[i][j] (i=0…M-1) (j=0…L-1)に対応したレコードテーブル[0]のレコードエントリ20[k] (k=0…K-1)から検索対象となるレコードRsのレコード値を取得する。 When the index table search unit 210 [0] finds a key value that matches the search key K s in the bucket 10 [0] of the index table 2 [0], the index table 2 [0] of the found key value is found. Record entry 20 [k] (k = 0 ... K) of record table [0] corresponding to key storage position 12 [i] [j] (i = 0 ... M-1) (j = 0 ... L-1) The record value of the record R s to be searched is acquired from -1).

そして索引テーブル検索部210[0]は、レコードRsのレコード値を含み、かつ、キーKsに対応したレコードRsのレコード値を既に取得済であることを表す検索有効な検索結果H[0]を次の索引テーブル検索部210[1]へ出力する。 Then, the index table search unit 210 [0] includes the record value of the record R s , and the search effective search result H [that indicates that the record value of the record R s corresponding to the key K s has already been acquired. 0] is output to the next index table search unit 210 [1].

一方、索引テーブル検索部210[0]は、索引テーブル2[0]ののバケット10[0]に検索用のキーKsと一致するキー値を見つけられなかった場合、次の 索引テーブル検索部210[1]により索引テーブル2[1]の中から検索用のキーKsと一致するキー値を見つけるため、当該キーKsと、当該キーKsに対応したレコードRsのレコード値が未取得であることを表す検索無効な検索結果H[1]を次の索引テーブル検索部210[2]へ出力する。以下、同様の処理を索引テーブル検索部210[n] (n=0…N-1)は繰り返す。 On the other hand, the index table search unit 210 [0], when not find the key value that matches the key K s for the search in the bucket 10 [0] of the index table 2 [0], the next index table search unit 210 [1] by to find the key value that matches the key K s for searches the index table 2 [1], and the key K s, record value of the record R s corresponding to the key K s is not selected A search invalid search result H [1] indicating acquisition is output to the next index table search unit 210 [2]. Thereafter, the index table search unit 210 [n] (n = 0... N−1) repeats the same processing.

索引テーブル検索部210[n] (n=0…N-1)は、検索有効を意味する検索結果H[n-1]を前段の索引テーブル検索部210[n-1]から受け取った場合、索引テーブル2[n] の中から検索用のキーKsと一致するキー値を探索することなく、その検索有効を意味する検索結果H[n-1]をそのまま検索有効を意味する検索結果H[n]として後段の索引テーブル検索部210[n+1]へ出力する。 When the index table search unit 210 [n] (n = 0... N-1) receives a search result H [n-1] indicating that the search is valid from the previous index table search unit 210 [n-1], without searching for a key value that matches the key K s for searches the index table 2 [n], which means it is a search enable the search enable means result H [n-1] result H [n] is output to the subsequent index table search unit 210 [n + 1].

また、索引テーブル検索部210[n] (n=0…N-1)は、検索無効を意味する検索結果H[n-1]と、検索用のキーKsを前段の索引テーブル検索部210[n-1]から受け取った場合、索引テーブル2[n] の中から検索用のキーKsと一致するキー値を探索する。 Further, the index table search unit 210 [n] (n = 0... N-1) obtains the search result H [n-1] indicating invalid search and the search key K s in the preceding index table search unit 210. When received from [n-1], a key value matching the search key K s is searched from the index table 2 [n].

索引テーブル検索部210[n] (n=0…N-1)は、索引テーブル2[n] の中から検索用のキーKsと一致するキー値を見つけた場合、索引テーブル2[n]のうち、当該キー値が格納されているキー格納位置12[i][j] (i=0…M-1) (j=0…L-1)に対応したレコードテーブル3[n]のレコードエントリ20[k] (k=0…K-1)から当該キー値に対応するレコードRsのレコード値を取得する。 When the index table search unit 210 [n] (n = 0... N-1) finds a key value that matches the search key K s from the index table 2 [n], the index table 2 [n] Among the records in the record table 3 [n] corresponding to the key storage position 12 [i] [j] (i = 0... M-1) (j = 0... L-1) in which the key value is stored. The record value of the record R s corresponding to the key value is acquired from the entry 20 [k] (k = 0... K−1).

索引テーブル検索部210[n]は、レコードRsのレコード値を含み、かつ、キーKsに対応したレコードRsのレコード値を既に取得済であることを表す検索有効な検索結果H[n]を後段に出力する。 The index table search unit 210 [n] includes the record value of the record R s , and the search effective search result H [n indicating that the record value of the record R s corresponding to the key K s has already been acquired. ] Is output to the subsequent stage.

さらに、索引テーブル検索部210[n] (n=0…N-1)は、索引テーブル2[n] の中から検索用のキーKsと一致するキー値を見つけられなかった場合、キーKsと、当該キーKsに対応するレコードRsのレコード値が未取得であることを表す検索無効な検索結果H[n]を後段に出力する。 Furthermore, if the index table search unit 210 [n] (n = 0... N-1) cannot find a key value that matches the search key K s from the index table 2 [n], the key K s and a search invalid search result H [n] indicating that the record value of the record R s corresponding to the key K s has not been acquired are output to the subsequent stage.

なお、索引テーブル検索部210[n] (n=0…N-1)では、検索用のキーKsに対する各索引テーブル検索部210[n] (n=0…N-1)による検索が完了するまで、次のキーKsの検索を保留する必要はない。索引テーブル検索部210[n] (n=0…N-1)の各々が外部または前段から入力した検索用のキーKsに対する検索動作を終えて検索結果H[n]を出力し終えた後は、索引テーブル検索部210[n] (n=0…N-1)は次の検索用のキーKsの入力を受け付けて検索動作を開始する、いわゆるパイプライン処理が可能である。 In the index table search unit 210 [n] (n = 0... N-1), the search by each index table search unit 210 [n] (n = 0... N-1) for the search key K s is completed. Until then, there is no need to defer retrieval of the next key K s . After each of the index table search units 210 [n] (n = 0... N-1) finishes the search operation for the search key K s input from the outside or the previous stage and outputs the search result H [n]. The index table search unit 210 [n] (n = 0... N-1) accepts the input of the next search key K s and starts a search operation, so-called pipeline processing is possible.

また、索引テーブル検索部210[n] (n=0…N-1)では、各索引テーブル検索部210[n] (n=0…N-1)が検索用のキーKsを入力してから検索結果H[n]を出力するまでに要する時間を、検索の有無(入力した検索結果H[n-1]が有効か無効か)や、検索用のキーKsと一致するキー値が索引テーブル[n] (n=0…N-1)の中から見つけられたか否かに係らず一定とする。これにより、索引テーブル検索部210[n-1]と索引テーブル検索部210[n]との間で、検索用のキーKsや検索結果H[n] (n=0…N-1)の滞留がない(すなわちボトルネックのない)パイプライン処理を可能とすることができる。 Also, the index table search unit 210 [n] (n = 0 ... N-1) in each index table search unit 210 [n] (n = 0 ... N-1) is to enter the key K s for the search The time required to output the search result H [n] from whether or not there is a search (whether the input search result H [n-1] is valid or invalid) and the key value that matches the search key K s Regardless of whether or not the index table [n] (n = 0... N-1) is found, it is constant. Thus, between the index table search unit 210 and the [n-1] and the index table search unit 210 [n], key K s and search results for the search H [n] of the (n = 0 ... N-1 ) Pipeline processing without stagnation (ie, no bottlenecks) can be enabled.

<索引テーブル登録部による登録処理>
次に、索引テーブル登録部211が行う登録用のキーKrの登録処理について、図11のフローチャートを参照しながら説明する。
<Registration process by index table registration unit>
Next, registration processing of the key K r for registration index table registering unit 211 performs will be described with reference to a flowchart of FIG. 11.

データベース装置200では、登録用のキーKrおよび当該キーKrに対応する登録対象のレコードRrを登録する場合、索引テーブル制御部211は、外部から登録用のキーKrおよびレコードRrを入力する(ステップSP21)。 In the database unit 200, to register a record R r of the registration object corresponding to the key K r and the key K r for registration, the index table control unit 211, the key K r and records R r for registration from the outside Input (step SP21).

索引テーブル登録部211は、各索引テーブル2[n] (n=0…N-1)にそれぞれ対応したN個のハッシュ関数f[n] (n=0…N-1)を用いて、外部から入力した登録用のキーKrからN個のエントリ番号[n] (n=0…N-1)を同時に生成する(ステップSP22[0]、……、ステップSP22[n]、……、ステップSP22[N-1])。 The index table registration unit 211 uses the N hash functions f [n] (n = 0... N-1) corresponding to the index tables 2 [n] (n = 0. N entry numbers [n] (n = 0... N−1) are generated simultaneously from the registration key K r input from (step SP22 [0],..., Step SP22 [n],. Step SP22 [N-1]).

索引テーブル登録部211は、各エントリ番号[n] (n=0…N-1)に対応した各索引テーブル2[n] (n=0…N-1)の各バケット10[n] (n=0…N-1)のバケット長[n] (n=0…N-1)を取得するに当たり、各キー格納マップテーブルMP[n] (n=0…N-1)のエントリ220[n] (n=0…N-1)に含まれるキー格納フラグ222[n][j] (j=0…L-1)にセットされたフラグの個数を計数することによって、各索引テーブル2[n] (n=0…N-1)のバケット10[n] (n=0…N-1)のバケット長[n] (n=0…N-1)を取得する(ステップSP23[0]、……、ステップSP23[n]、……、ステップSP23[N-1])。ここで、キー格納フラグ222[n][j] (j=0…L-1)における[n]はエントリ番号[n]である。   The index table registration unit 211 stores each bucket 10 [n] (n) of each index table 2 [n] (n = 0 ... N-1) corresponding to each entry number [n] (n = 0 ... N-1). = 0 ... N-1) bucket length [n] (n = 0 ... N-1), the entry 220 [n] of each key storage map table MP [n] (n = 0 ... N-1) ] By counting the number of flags set in the key storage flag 222 [n] [j] (j = 0 ... L-1) included in (n = 0 ... N-1), each index table 2 [ n] The bucket length [n] (n = 0 ... N-1) of the bucket 10 [n] (n = 0 ... N-1) of (n = 0 ... N-1) is acquired (step SP23 [0] , ..., step SP23 [n], ..., step SP23 [N-1]). Here, [n] in the key storage flag 222 [n] [j] (j = 0... L−1) is the entry number [n].

なお、索引テーブル登録部211は、バケット長[n] (n=0…N-1)を取得する代わりに、追加で格納可能なキー値の個数である空きバケット長[n](n=0…N-1)を取得するようにしてもよい。   The index table registration unit 211 obtains the bucket length [n] (n = 0... N−1) instead of obtaining the bucket length [n] (n = 0 (n = 0) that is the number of key values that can be additionally stored. ... N-1) may be acquired.

索引テーブル登録部211は、索引テーブル2[n] (n=0…N-1)の何れかのバケット10[n] (n=0…N-1)に対してキーKrのキー値を格納するため、各バケット長[n] (n=0…N-1)の中から最小値をとるバケット長[nr]を探索し、その最小値のバケット長[nr]に対応した索引テーブル2[nr]を選択する(ステップSP24)。 The index table registration unit 211 assigns the key value of the key K r to any bucket 10 [n] (n = 0 ... N-1) of the index table 2 [n] (n = 0 ... N-1). In order to store, the bucket length [nr] that takes the minimum value is searched from each bucket length [n] (n = 0... N-1), and the index table 2 corresponding to the minimum bucket length [nr] [nr] is selected (step SP24).

索引テーブル登録部211は、索引テーブル2[nr]のキー格納位置12[nr][j] (j=0…L-1)のうち、キー値が未格納のキー格納位置12[nr][jr]を探索する(ステップSP25)。ここで、キー格納位置12[nr][jr] における[nr]は、キー格納位置12を特定する最小値のバケット長[nr]に対応したエントリ番号[nr]であり、[jr]はキー値が未格納のキー格納位置を特定するバケット内キー格納位置番号[jr]である。   The index table registration unit 211 stores the key storage position 12 [nr] [n] in which the key value is not stored among the key storage positions 12 [nr] [j] (j = 0... L-1) of the index table 2 [nr]. jr] is searched (step SP25). Here, [nr] at the key storage position 12 [nr] [jr] is the entry number [nr] corresponding to the minimum bucket length [nr] that identifies the key storage position 12, and [jr] is the key This is the key storage position number [jr] in the bucket that identifies the key storage position whose value is not stored.

具体的には、索引テーブル登録部211は、索引テーブル2[nr]に対応したキー格納マップテーブルMP[nr]のキー格納フラグ222[nr][j] (j=0…L-1)を全て読み出し、その中からキー値が未格納であることを示すキー格納フラグ222[nr][jr]に対応する索引テーブル2[nr]のキー格納位置12[nr][jr]を探索する(ステップSP25)。   Specifically, the index table registration unit 211 sets the key storage flag 222 [nr] [j] (j = 0... L-1) of the key storage map table MP [nr] corresponding to the index table 2 [nr]. All are read, and the key storage position 12 [nr] [jr] of the index table 2 [nr] corresponding to the key storage flag 222 [nr] [jr] indicating that the key value is not stored is searched for ( Step SP25).

索引テーブル登録部211は、キー値が未格納である索引テーブル2[nr]のキー格納位置12[nr][jr]を見つけられたか否かを判定し(ステップSP26)、見つけられた場合には索引テーブル2[nr]のエントリ11[nr](バケット10[nr])におけるキー格納位置12[nr][jr]に対して登録用のキーKrのキー値を格納する(ステップSP27)。 The index table registration unit 211 determines whether or not the key storage position 12 [nr] [jr] of the index table 2 [nr] whose key value is not stored has been found (step SP26). entry 11 [nr] index table 2 [nr] stores the key value of the key K r for registration to (bucket 10 [nr]) key storage location in the 12 [nr] [jr] (step SP27) .

索引テーブル登録部211は、索引テーブル2[nr]のエントリ11[nr] (バケット10[nr])におけるキー格納位置12[nr][jr]に対して登録用のキーKrのキー値を格納したので、エントリ番号[nr]、キー格納位置12[nr][jr]のバケット内キー格納位置番号[jr]を上述した(式4)に代入する。 The index table registration unit 211 assigns the key value of the registration key K r to the key storage position 12 [nr] [jr] in the entry 11 [nr] (bucket 10 [nr]) of the index table 2 [nr]. Since it is stored, the in-bucket key storage position number [jr] of the entry number [nr] and the key storage position 12 [nr] [jr] is substituted into the above-described (Equation 4).

これにより索引テーブル登録部211は、レコードテーブル3[nr]のレコードエントリ20[kr]のレコードエントリ番号[kr]を次の(式5)により算出し、当該エントリ番号[kr]のレコードエントリ20[kr]に対してレコードRrのレコード値を格納し、登録有効を示す登録結果Tkを出力することにより登録処理を終了する(ステップSP28)。
kr=エントリ番号[nr]×L+jr…………………………………………………………(式5)
Accordingly, the index table registration unit 211 calculates the record entry number [kr] of the record entry 20 [kr] of the record table 3 [nr] by the following (Equation 5), and records the record entry 20 of the entry number [kr]. The record value of the record R r is stored for [kr], and the registration result Tk indicating that the registration is valid is output to complete the registration process (step SP28).
kr = entry number [nr] x L + jr ………………………………………………………… (Formula 5)

一方、索引テーブル登録部211は、キー値が未格納である索引テーブル2[nr]のキー格納位置12[nr][jr]を見つけられなかった場合(ステップSP26:No)、すなわち登録用のキーKrのキー値を登録できない場合には、登録不可時の処理として、登録無効を示す登録結果Tfを出力することにより登録処理を終了する(ステップSP29)。 On the other hand, the index table registration unit 211 does not find the key storage position 12 [nr] [jr] of the index table 2 [nr] in which the key value is not stored (step SP26: No), that is, for registration. if you can not register the key value of the key K r, as a process at the time of registration impossible, and terminates the registration process by outputting the registration result Tf indicating an invalid registration (step SP29).

なお索引テーブル登録部211は、登録無効を示す登録結果Tfを出力することと併せて、登録用のキーKrのキー値を登録できない回数をカウンタにより計数し、計数する度に更新し、その計数値を保持することができる。 Incidentally index table registration unit 211, along with outputting the registration result Tf indicating an invalid registration, the number of times that can not register a key value of the key K r for registration counted by the counter, and updates whenever the counting, the A count value can be held.

また索引テーブル登録部211は、登録無効を示す登録結果Tfを出力することと併せて、索引テーブル2[nr]のエントリ11[nr](バケット10[nr])に対して既に格納済のキー値のうち、1個のキー値の登録を抹消し、その抹消したキー格納位置12に対して登録用のキーKrのキー値を登録するとともに、そのキー格納位置12に対応したレコードテーブル3[n]のレコードエントリ20[k]にレコードRrのレコード値を格納することもできる。 In addition, the index table registration unit 211 outputs a registration result Tf indicating registration invalidity and, at the same time, stores the key already stored in the entry 11 [nr] (bucket 10 [nr]) of the index table 2 [nr]. among the values, unregister the one key value, and registers the key value of the key K r for registration for the deletion to the key storage location 12, record table 3 corresponding to the key storage location 12 The record value of the record R r can also be stored in the record entry 20 [k] of [n].

なお索引テーブル登録部211は、キー格納マップテーブルMP[n] (n=0…N-1)に基づいて各バケット長[n] (n=0…N-1)の中から最小値をとるバケット長[nr]を探索し、その最小値のバケット長[nr]に対応した索引テーブル2[nr]を選択するようにしたが(ステップSP24)、これに限るものではなく、登録対象とすべき索引テーブル2[nr]を選択する索引テーブル選択方法としては、それ以外にも以下の3通りが存在する。   The index table registration unit 211 takes the minimum value from the bucket lengths [n] (n = 0... N-1) based on the key storage map table MP [n] (n = 0... N-1). The bucket length [nr] is searched, and the index table 2 [nr] corresponding to the minimum bucket length [nr] is selected (step SP24). As the index table selection method for selecting the power index table 2 [nr], there are the following three other methods.

一つ目の索引テーブル選択方法は、キー格納マップテーブルMP[n] (n=0…N-1)に基づいて空きバケット長[n] (n=0…N-1)が0よりも大きいバケット10[n] (n=0…N-1)の中から索引テーブル番号[n] (n=0…N-1)が最小の索引テーブル番号[nr]を持つ索引テーブル2[nr]を選択する。   In the first index table selection method, the empty bucket length [n] (n = 0... N-1) is larger than 0 based on the key storage map table MP [n] (n = 0... N-1). An index table 2 [nr] having an index table number [nr] having the smallest index table number [n] (n = 0 ... N-1) is selected from the bucket 10 [n] (n = 0 ... N-1). select.

二つ目の索引テーブル選択方法は、キー格納マップテーブルMP[n] (n=0…N-1)に基づいて空きバケット長[n] (n=0…N-1)の中から最大値をとる空きバケット長[nr] となった索引テーブル番号[nr]を持つ索引テーブル2[nr]を選択する。   The second index table selection method is based on the key storage map table MP [n] (n = 0 ... N-1), and the maximum value is selected from the free bucket lengths [n] (n = 0 ... N-1). The index table 2 [nr] having the index table number [nr] that becomes the empty bucket length [nr] is selected.

三つ目の索引テーブル選択方法は、各索引テーブル2[n] (n=0…N-1)が異なるテーブルサイズM(エントリ11[i]の個数)である場合に、キー格納マップテーブルMP[n] (n=0…N-1)に基づいて取得した空きバケット長[n] (n=0…N-1)を索引テーブル2[n] (n=0…N-1)毎に設定された重み係数で重み付けした重み付け空きバケット長[n] (n=0…N-1)のうち、最大値をとる重み付け空きバケット長[nr]となった索引テーブル番号[nr]を持つ索引テーブル2[nr]を選択する。   The third index table selection method is such that when each index table 2 [n] (n = 0... N-1) has a different table size M (number of entries 11 [i]), the key storage map table MP. [n] The empty bucket length [n] (n = 0 ... N-1) acquired based on (n = 0 ... N-1) is obtained for each index table 2 [n] (n = 0 ... N-1). Index with index table number [nr] that has become the maximum weighted free bucket length [nr] out of weighted free bucket length [n] (n = 0 ... N-1) weighted with the set weighting factor Select table 2 [nr].

なお、一つ目乃至三つ目の索引テーブル選択方法においては、各索引テーブル2[n] (n=0…N-1)のバケットサイズL(キー格納位置12[nr][jr] (i=0…M-1) (j=0…L-1)の個数)が異なる場合にも適用することができる。   In the first to third index table selection methods, the bucket size L of each index table 2 [n] (n = 0... N−1) (key storage position 12 [nr] [jr] (i = 0 ... M-1) (number of j = 0 ... L-1)) is also different.

<索引テーブル検索部による検索処理>
次に、各索引テーブル検索部210[n] (n=0…N-1)がそれぞれ行う検索用のキーKsに基づく検索対象のレコードRsの検索処理について、図12のフローチャートを参照しながら説明する。
<Search processing by index table search unit>
Next, with reference to the flowchart of FIG. 12, the search processing of the record R s to be searched based on the search key K s performed by each index table search unit 210 [n] (n = 0... N−1). While explaining.

データベース装置200では、検索用のキーKsおよび当該キーKsに対応して登録されている検索対象のレコードRrを検索する場合、索引テーブル検索部210[n] (n=0…N-1)は、外部または前段の索引テーブル検索部210[n-1]から検索用のキーKsと、前段の索引テーブル検索部210[n-1]からの検索結果H[n-1]を入力する(ステップSP31)。 In the database apparatus 200, when searching for a search key K s and a search target record R r registered corresponding to the key K s , an index table search unit 210 [n] (n = 0... N− 1) The search key K s from the external or previous index table search unit 210 [n-1] and the search result H [n-1] from the previous index table search unit 210 [n-1] Input (step SP31).

ここで、索引テーブル検索部210[n] (n=0…N-1)においては、索引テーブル検索部210[n]が[n]=0の場合には、前段の索引テーブル検索部210[n-1]が存在しないため、検索用のキーKsだけを入力する。しかしながら、索引テーブル検索部210[n]が[n]>0の場合には、前段の索引テーブル検索部210[n-1]が存在するので、検索用のキーksおよび前段からの検索結果H[n-1]の双方を入力する。 Here, in the index table search unit 210 [n] (n = 0... N−1), when the index table search unit 210 [n] is [n] = 0, the index table search unit 210 [ Since n-1] does not exist, only the search key K s is input. However, when the index table search unit 210 [n] is [n]> 0, since the previous index table search unit 210 [n-1] exists, the search key k s and the search result from the previous step are present. Input both H [n-1].

索引テーブル検索部210[n] (n=0…N-1)は、自身が[n]=0の索引テーブル検索部210[0]であるか、または、前段の索引テーブル検索部210[n-1]から検索無効の検索結果H[n-1]を受け取ったか否かを判定する(ステップSP32)。   The index table search unit 210 [n] (n = 0... N-1) itself is the index table search unit 210 [0] with [n] = 0, or the previous index table search unit 210 [n]. -1] is determined whether a search invalid search result H [n-1] is received (step SP32).

索引テーブル検索部210[n] (n=0…N-1)は、自身が[n]=0の索引テーブル検索部210[0]でない場合(ステップSP32:NO)、または、前段の索引テーブル検索部210[n-1]から検索無効の検索結果H[n-1]を受け取っていない場合、すなわち検索有効の検索結果H[n-1]を受け取った場合(ステップSP32:NO)、その検索有効の検索結果H[n-1]をそのまま検索結果H[n]として後段に出力し(ステップSP33)、処理を終了する。   The index table search unit 210 [n] (n = 0... N-1) is not the index table search unit 210 [0] with [n] = 0 (step SP32: NO), or the previous index table When no search invalid search result H [n-1] is received from the search unit 210 [n-1], that is, when a search valid search result H [n-1] is received (step SP32: NO), The search valid search result H [n-1] is output to the subsequent stage as the search result H [n] as it is (step SP33), and the process is terminated.

索引テーブル検索部210[n] (n=0…N-1)は、自身が[n]=0の索引テーブル検索部210[0]である場合(ステップSP32:YES)、または、前段の索引テーブル検索部210[n-1]から無効の検索結果H[n-1]を受け取った場合(ステップSP32:YES)、自身が持つ1つのハッシュ関数f[n] (n=0…N-1)を用いて検索用のキーKsから索引テーブル2[n]の検索対象を指し示すエントリ番号[is]を生成する(ステップSP34)。 The index table search unit 210 [n] (n = 0... N-1) is the index table search unit 210 [0] with [n] = 0 (step SP32: YES) or the previous index. When an invalid search result H [n-1] is received from the table search unit 210 [n-1] (step SP32: YES), one hash function f [n] (n = 0... N-1) possessed by itself ) to generate the entry number [is] to point the search the index table 2 [n] from the key K s for search using (step SP34).

索引テーブル検索部210[n] (n=0…N-1)は、当該索引テーブル検索部210[n] (n=0…N-1)と対応した索引テーブル2[n] (n=0…N-1)におけるエントリ番号[is]のバケット[is]に格納されている最大L個のキー値を取得する(ステップSP35)。   The index table search unit 210 [n] (n = 0... N-1) is an index table 2 [n] (n = 0) corresponding to the index table search unit 210 [n] (n = 0 ... N-1). ... (N-1) The maximum L key values stored in the bucket [is] of the entry number [is] are acquired (step SP35).

索引テーブル検索部210[n] (n=0…N-1)は、索引テーブル2[n] (n=0…N-1)におけるエントリ番号[is]のバケット[is]から取得した最大L個のキー値のうち、検索用のキーKsと一致するキー値の格納されていたキー格納位置12[is][js]を探索する(ステップSP36)。 The index table search unit 210 [n] (n = 0... N-1) obtains the maximum L obtained from the bucket [is] of the entry number [is] in the index table 2 [n] (n = 0 ... N-1). Among the key values, the key storage position 12 [is] [js] in which the key value that matches the search key K s is stored is searched (step SP36).

索引テーブル検索部210[n] (n=0…N-1)は、最大L個のキー値のうち、検索用のキーKsと一致するキー値を見つけられたか否かを判定し(ステップSP37)、見つけられなかった場合には(ステップSP37:NO)、当該検索用のキーKsと検索無効を示す検索結果H[n]を後段に出力し(ステップSP38)、処理を終了する。 The index table search unit 210 [n] (n = 0... N-1) determines whether or not a key value matching the search key K s has been found among the maximum L key values (step S1). SP37), if not found (step SP37: NO), and outputs the search result indicating the invalid search key K s for the search H [n] to the subsequent stage (step SP38), and terminates the process.

索引テーブル検索部210[n] (n=0…N-1)は、最大L個のキー値のうち、検索用のキーKsと一致するキー値が見つけられた場合(ステップSP37:YES)、キー格納位置12[is][js]に対応したレコードテーブル3[n]のレコードエントリ番号[ks]を、エントリ番号[is]、キー格納位置12[is][js]のバケット内キー格納位置番号[js]に基づいて(式6)により算出し、当該レコードエントリ番号[ks]のレコードエントリ20[ks]から検索対象のレコードRsのレコード値を取得する(ステップSP39)。
ks=エントリ番号[is]×L+js…………………………………………………………(式6)
The index table search unit 210 [n] (n = 0... N−1) finds a key value that matches the search key K s among the maximum L key values (step SP37: YES). , The record entry number [ks] of the record table 3 [n] corresponding to the key storage position 12 [is] [js] is stored in the bucket key of the entry number [is] and the key storage position 12 [is] [js]. based on the position number [js] calculated by (equation 6), to obtain the record value of the search target record R s from the record entry 20 [ks] of the record entry number [ks] (step SP39).
ks = entry number [is] × L + js ………………………………………………………… (Formula 6)

索引テーブル検索部210[n] (n=0…N-1)は、検索対象のレコードRsのレコード値を取得したので、当該レコードRsのレコード値を含み、かつ、検索用のキーKsに対応する検索対象のレコードRsを取得済であることを表す検索有効の検索結果H[n]を後段に出力し(ステップSP40)、処理を終了する。 Since the index table search unit 210 [n] (n = 0... N-1) has acquired the record value of the record R s to be searched, it includes the record value of the record R s and includes the search key K. Search effective search results indicating that the search target record R s corresponding to s is already obtained the H [n] is output to the subsequent stage (step SP40), and terminates the process.

<第3の実施の形態における効果>
索引テーブル検索部210[n]は、当該索引テーブル検索部210[n]と対応する索引テーブル2[n] (n=0…N-1)のなかから検索用のキーKsに一致するキー値を見つけることができた場合、検索有効の検索結果H[n]を後段の索引テーブル検索部210[n+1]に出力することができる。
<Effect in the third embodiment>
Index table search unit 210 [n] is the key that matches the key K s for retrieved from the index table 2 corresponding to the index table search unit 210 [n] [n] ( n = 0 ... N-1) If the value can be found, the search effective search result H [n] can be output to the index table search unit 210 [n + 1] at the subsequent stage.

また、索引テーブル検索部210[n] (n=0…N-1)は、前段の索引テーブル検索部210[n-1] から検索有効の検索結果H[n-1]を受け取った場合、索引テーブル2[n] (n=0…N-1)のなかから検索用のキーKsに一致するキー値の探索を行うことなく、当該検索結果H[n-1]をそのまま検索結果H[n]として後段の索引テーブル検索部210[n+1]に出力することができる。 Further, when the index table search unit 210 [n] (n = 0... N-1) receives the search valid search result H [n-1] from the previous index table search unit 210 [n-1], index table 2 [n] without performing the search key value that matches the key K s for the search from among the (n = 0 ... n-1 ), the search result H [n-1] as it results H [n] can be output to the subsequent index table search unit 210 [n + 1].

これにより索引テーブル検索部210[n] (n=0…N-1)は、索引テーブル2[n] (n=0…N-1)のなかから検索用のキーKsに一致するキー値を見つけることができた場合、後段の索引テーブル検索部210[n+1]、索引テーブル検索部210[n+2]、……、索引テーブル検索部210[N-1]については、検索用のキーKsと一致するキー値を探索するための索引テーブル2[n+1]、索引テーブル2[n+2]、……索引テーブル2[N-1]に対するアクセスは行われない。 Thus the index table search unit 210 [n] (n = 0 ... N-1) is an index table 2 [n] key value that matches the key K s for the search from among the (n = 0 ... N-1 ) If the index table search unit 210 [n + 1], the index table search unit 210 [n + 2],... The index table 2 [n + 1], the index table 2 [n + 2],... For searching for a key value that matches the key K s of the index key 2 is not accessed.

したがって、検索用のキーKsを入力したとき、当該索引テーブル検索部210[n] (n=0…N-1)にそれぞれ対応した索引テーブル2[n] (n=0…N-1)に対して一斉にアクセスし、検索用のキーKsに一致するキー値を探索する場合と比較し、索引テーブル検索部210[n] (n=0…N-1)は、索引テーブル2[n] (n=0…N-1)に対するアクセス頻度を低減することができ、その結果、索引テーブル2[n] (n=0…N-1)へのアクセスにより生じる電力消費を低減することができる。 Therefore, when the search key K s is input, the index table 2 [n] (n = 0... N-1) respectively corresponding to the index table search unit 210 [n] (n = 0... N-1). Compared to the case where the key value matching the search key K s is searched, the index table search unit 210 [n] (n = 0... N−1) is compared with the index table 2 [ n] (n = 0 ... N-1) can be reduced in frequency of access, and as a result, power consumption caused by accessing index table 2 [n] (n = 0 ... N-1) can be reduced. Can do.

なお、索引テーブル登録部211による登録用のキーKrの登録動作については、キー格納マップテーブルMP[n] (n=0…N-1)を用いることにより、登録用のキーKrのキー値を格納すべき索引テーブル2[n]のみにアクセスし、その他の索引テーブル2[n]についてはアクセスしない。これにより、各索引テーブル検索部210[n] (n=0…N-1)は検索処理のパイプライン動作を停止する必要がなく、また前段から検索無効の検索結果H[n-1]が与えられたとき検索用のキーKsと一致するキー値の探索を行うための索引テーブル2[n]に対するアクセスを停止する必要がない。 Note that the registration operation of the registration key K r by the index table registration unit 211 is performed by using the key storage map table MP [n] (n = 0... N−1) to register the key K r for registration. Only the index table 2 [n] to store the values is accessed, and the other index tables 2 [n] are not accessed. Thereby, each index table search unit 210 [n] (n = 0... N-1) does not need to stop the pipeline operation of the search process, and the search invalid search result H [n-1] is obtained from the previous stage. it is not necessary to stop the access to the index table 2 [n] for carrying out the search for the key value that matches the key K s for search when given.

さらに、索引テーブル登録部211では、上述した登録処理(図11)におけるステップSP23[0]、…、ステップSP23[n]、…、ステップSP[N-1]のように、全てのキー格納マップテーブルMP[n] (n=0…N-1)に同時にアクセスしている。これに対して、パイプライン処理によって各キー格納マップテーブルMP[n] (n=0…N-1)に順番にアクセスするという構成を用いた場合、全てのキー格納マップテーブルMP[n] (n=0…N-1)に対するアクセスが終わらないとバケット長が最少の索引テーブル2[n] (n=0…N-1)を選出することができない。このため、選出する必要のない無効なキー格納マップテーブルMP[n] (n=0…N-1)に対するアクセスを停止することができず、その分消費電力を削減することができなくなるという問題が生じてしまう。   Further, in the index table registration unit 211, all the key storage maps as in step SP23 [0],..., Step SP23 [n],..., Step SP [N-1] in the above-described registration process (FIG. 11). The table MP [n] (n = 0... N-1) is accessed simultaneously. On the other hand, when a configuration is used in which each key storage map table MP [n] (n = 0... N−1) is sequentially accessed by pipeline processing, all the key storage map tables MP [n] ( If access to n = 0... N-1) is not completed, the index table 2 [n] (n = 0... N-1) with the smallest bucket length cannot be selected. For this reason, the access to the invalid key storage map table MP [n] (n = 0... N-1) that does not need to be selected cannot be stopped, and the power consumption cannot be reduced accordingly. Will occur.

さらに、上述したようなパイプライン処理によって各キー格納マップテーブルMP[n] (n=0…N-1)に順番にアクセスするという構成では、登録用のキーKrの登録開始から登録完了までの時間が長くなるため、登録用のキーKrが登録完了するまでは当該キーKrの検索処理を実行できないという問題も生じてしまう。 Further, in the configuration in which each key storage map table MP [n] (n = 0... N-1) is accessed in order by the pipeline processing as described above, from the registration start of the registration key Kr to the registration completion. Therefore, there is a problem that the search process for the key Kr cannot be executed until the registration key Kr is completely registered.

しかしながら、第3の実施の形態におけるデータベース装置200では、上述したような問題が生じることもなく、第1の実施の形態のように、メモリ使用効率を高めることができると同時に、かつ消費電力効果を向上させることができる。   However, in the database apparatus 200 in the third embodiment, the above-described problems do not occur, and the memory use efficiency can be enhanced as in the first embodiment, and at the same time, the power consumption effect Can be improved.

<他の実施の形態>
なお上述した第2の実施の形態においては、1つのレコードテーブル3(図7)を用いるようにした場合について述べたが、本発明はこれに限るものではなく、第1の実施の形態に対応した他の実施の形態のように、N個のメモリからなるレコードテーブル3[n] (n=0…N-1)を用いるようにしても良い。
<Other embodiments>
In the above-described second embodiment, the case where one record table 3 (FIG. 7) is used has been described. However, the present invention is not limited to this and corresponds to the first embodiment. As in the other embodiments, a record table 3 [n] (n = 0... N-1) made up of N memories may be used.

1、100、200…データベース装置、2[n]…索引テーブル、3、3[n]…レコードテーブル、4…索引テーブル制御部(索引テーブル登録部、索引テーブル検索部)、5…レコードテーブル制御部(レコードテーブル登録部、レコードテーブル検索部)、10[i]…バケット、11[i]…エントリ、12[i][j]…キー格納位置、20[k]…レコードエントリ、110…検索用の索引テーブル制御部(索引テーブル検索部)、111…登録用の索引テーブル制御部(索引テーブル登録部)、120…検索用のレコードテーブル制御部(レコードテーブル検索部)、121…登録用のレコードテーブル制御部(レコードテーブル登録部)、210[n]…索引テーブル検索部(索引テーブル検索部、レコードテーブル検索部)、211…索引テーブル登録部(索引テーブル登録部、レコードテーブル登録部)、222[i][j]…キー格納フラグ、MP…キー格納マップテーブル。   DESCRIPTION OF SYMBOLS 1,100,200 ... Database apparatus, 2 [n] ... Index table, 3, 3 [n] ... Record table, 4 ... Index table control part (index table registration part, index table search part), 5 ... Record table control (Record table registration unit, record table search unit), 10 [i] ... bucket, 11 [i] ... entry, 12 [i] [j] ... key storage location, 20 [k] ... record entry, 110 ... search Index table control unit (index table search unit), 111 ... registration index table control unit (index table registration unit), 120 ... search record table control unit (record table search unit), 121 ... registration Record table control unit (record table registration unit), 210 [n] ... index table search unit (index table search unit, record table search unit), 211 ... index table registration unit Index table registration unit, record table registration unit), 222 [i] [j] ... key storage flag, MP ... key storage map table.

Claims (8)

複数のキー値を格納可能な複数のキー格納位置が設けられ、互いに異なるエントリ番号にそれぞれ対応付けられたバケットを複数有するN(Nは2以上の整数)個の索引テーブルと、
前記N個の索引テーブルのそれぞれに対応した互いに異なるN個のハッシュ関数を備え、当該N個のハッシュ関数を用いて外部から入力されたキーのキー値に基づき前記N個の索引テーブルにそれぞれ対応したN個のエントリ番号を生成するエントリ番号生成部と、
前記バケットのうち前記キー格納位置に対応したレコード格納位置に当該キー値と対応するレコード値を格納するレコードテーブルと、
前記N個のエントリ番号に対応した前記N個の索引テーブルにおけるN個のバケットの中から前記キー値を格納するバケットを選択し、当該バケットに前記キー値を格納する索引テーブル登録部と、
前記キー値を格納したキー格納位置と対応する前記レコードテーブルの前記レコード格納位置に当該キー値と対応したレコード値を格納するレコードテーブル登録部と
を備えることを特徴とするデータベース装置。
A plurality of key storage locations capable of storing a plurality of key values, and N (N is an integer of 2 or more) index tables each having a plurality of buckets respectively associated with different entry numbers;
N hash functions different from each other corresponding to each of the N index tables are provided, and each of the N index tables corresponds to each of the N index tables based on a key value of a key input from the outside using the N hash functions. An entry number generation unit for generating N entry numbers,
A record table storing a record value corresponding to the key value in a record storage position corresponding to the key storage position in the bucket;
An index table registration unit that selects a bucket for storing the key value from N buckets in the N index tables corresponding to the N entry numbers, and stores the key value in the bucket;
A database apparatus comprising: a record table registration unit that stores a record value corresponding to the key value at the record storage position of the record table corresponding to the key storage position where the key value is stored.
請求項1記載のデータベース装置において、
前記N個のエントリ番号に対応した前記N個の索引テーブルにおけるN個のバケットの中から、前記キーと一致するキー値が格納されている前記バケットを検索する索引テーブル検索部と、
前記索引テーブル検索部により検索した前記バケットにおける前記キー値が格納されたキー格納位置と対応した前記レコードテーブルの前記レコード格納位置から前記レコード値を取得するレコードテーブル検索部と
を更に備えることを特徴とするデータベース装置。
The database apparatus according to claim 1, wherein
An index table search unit for searching for the bucket in which a key value matching the key is stored from N buckets in the N index tables corresponding to the N entry numbers;
A record table search unit for acquiring the record value from the record storage position of the record table corresponding to the key storage position in which the key value is stored in the bucket searched by the index table search unit; A database device.
請求項1記載のデータベース装置において、
前記索引テーブル登録部は、前記N個のバケットのうち既に格納されているキー値の個数であるバケット長、または前記N個のバケットのうち追加で格納可能なキー値の個数である空きバケット長に基づいて、前記N個の索引テーブルにおいて前記N個のエントリ番号に対応したN個のバケットの中から前記キー値の格納先となるバケットを選択する
ことを特徴とするデータベース装置。
The database apparatus according to claim 1, wherein
The index table registration unit includes a bucket length that is the number of key values that are already stored among the N buckets, or an empty bucket length that is the number of key values that can be additionally stored among the N buckets. Based on the above, a database device is selected from the N buckets corresponding to the N entry numbers in the N index tables.
請求項1記載のデータベース装置において、
前記N個の索引テーブルは、前記索引テーブル登録部および前記索引テーブル検索部の双方から同時にアクセス可能であり、
前記レコードテーブルは、前記レコードテーブル登録部および前記レコードテーブル検索部の双方から同時にアクセス可能である
ことを特徴とするデータベース装置。
The database apparatus according to claim 1, wherein
The N index tables are accessible simultaneously from both the index table registration unit and the index table search unit,
The database apparatus, wherein the record table is accessible simultaneously from both the record table registration unit and the record table search unit.
請求項1記載のデータベース装置において、
前記レコードテーブルは、複数のレコード値を格納可能な複数のレコード格納位置が設けられ、互いに異なるレコードエントリ番号に対応付けられたバケットをそれぞれ複数有するN個のレコードテーブルである
ことを特徴とするデータベース装置。
The database apparatus according to claim 1, wherein
The record table is N record tables having a plurality of record storage positions capable of storing a plurality of record values and having a plurality of buckets respectively associated with different record entry numbers. apparatus.
請求項1に記載のデータベース装置において、
前記索引テーブル登録部は、前記N個の索引テーブルにおける全ての前記キー格納位置に当該キー値を格納しているか否かを表すキー格納マップテーブルを参照し、前記N個の索引テーブルにおいて前記N個のエントリ番号に対応したN個のバケットの中から前記キー値の格納先となる前記バケットを選択する
ことを特徴とするデータベース装置。
The database apparatus according to claim 1, wherein
The index table registration unit refers to a key storage map table indicating whether or not the key value is stored in all the key storage positions in the N index tables, and the N index tables store the N The database apparatus, wherein the bucket that stores the key value is selected from N buckets corresponding to the entry numbers.
複数のキー値を格納可能な複数のキー格納位置が設けられ、互いに異なるエントリ番号にそれぞれ対応付けられたバケットを複数有するN(Nは2以上の整数)個の索引テーブルのそれぞれに対応した互いに異なるN個のハッシュ関数を備えたエントリ番号生成部が、当該N個のハッシュ関数を用いて外部から入力されたキーのキー値に基づき前記N個の索引テーブルにそれぞれ対応したN個のエントリ番号を生成するエントリ番号生成ステップと、
前記N個の索引テーブルにおいて前記N個のエントリ番号に対応したN個のバケットの中から索引テーブル登録部が前記キー値を格納するバケットを選択し、当該バケットに前記キー値を格納する索引テーブル登録ステップと、
レコードテーブル登録部が前記バケットにおける前記キー値を格納したキー格納位置と対応するレコードテーブルのレコード格納位置に当該キー値と対応したレコード値を格納するレコードテーブル登録ステップと
を備えることを特徴とするデータベース管理方法。
A plurality of key storage positions capable of storing a plurality of key values are provided, and N (N is an integer of 2 or more) index tables each having a plurality of buckets respectively associated with different entry numbers. The entry number generation unit having different N hash functions has N entry numbers respectively corresponding to the N index tables based on key values of keys input from the outside using the N hash functions. An entry number generation step for generating
An index table in which the index table registration unit selects a bucket storing the key value from N buckets corresponding to the N entry numbers in the N index tables, and stores the key value in the bucket. Registration step;
The record table registration unit includes a record table registration step of storing a record value corresponding to the key value at a record storage position of the record table corresponding to the key storage position where the key value is stored in the bucket. Database management method.
コンピュータに対し、
複数のキー値を格納可能な複数のキー格納位置が設けられ、互いに異なるエントリ番号にそれぞれ対応付けられたバケットを複数有するN(Nは2以上の整数)個の索引テーブルのそれぞれに対応した互いに異なるN個のハッシュ関数を用いて、外部から入力されたキーのキー値に基づき前記N個の索引テーブルにそれぞれ対応したN個のエントリ番号を生成するエントリ番号生成ステップと、
前記N個の索引テーブルにおいて前記N個のエントリ番号に対応したN個のバケットの中から前記キー値を格納するバケットを選択し、当該バケットに前記キー値を格納する索引テーブル登録ステップと、
前記バケットにおける前記キー値を格納したキー格納位置と対応するレコードテーブルのレコード格納位置に当該キー値と対応したレコード値を格納するレコードテーブル登録ステップと
を実行させることを特徴とするプログラム。
Against the computer
A plurality of key storage positions capable of storing a plurality of key values are provided, and N (N is an integer of 2 or more) index tables each having a plurality of buckets respectively associated with different entry numbers. An entry number generating step for generating N entry numbers respectively corresponding to the N index tables based on key values of keys input from the outside using different N hash functions;
An index table registration step of selecting a bucket for storing the key value from N buckets corresponding to the N entry numbers in the N index tables, and storing the key value in the bucket;
A record table registration step of executing a record table registration step of storing a record value corresponding to the key value at a record storage position of a record table corresponding to the key storage position storing the key value in the bucket.
JP2014136591A 2014-07-02 2014-07-02 Database device, database management method, and program Pending JP2016015011A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014136591A JP2016015011A (en) 2014-07-02 2014-07-02 Database device, database management method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014136591A JP2016015011A (en) 2014-07-02 2014-07-02 Database device, database management method, and program

Publications (1)

Publication Number Publication Date
JP2016015011A true JP2016015011A (en) 2016-01-28

Family

ID=55231148

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014136591A Pending JP2016015011A (en) 2014-07-02 2014-07-02 Database device, database management method, and program

Country Status (1)

Country Link
JP (1) JP2016015011A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111352931A (en) * 2018-12-21 2020-06-30 中兴通讯股份有限公司 Hash collision processing method and device and computer readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111352931A (en) * 2018-12-21 2020-06-30 中兴通讯股份有限公司 Hash collision processing method and device and computer readable storage medium

Similar Documents

Publication Publication Date Title
Li et al. Packet forwarding in named data networking requirements and survey of solutions
KR102461152B1 (en) Reducing probabilistic filter query latency
JP5996088B2 (en) Cryptographic hash database
JP6356675B2 (en) Aggregation / grouping operation: Hardware implementation of hash table method
US20070168377A1 (en) Method and apparatus for classifying Internet Protocol data packets
US8856203B1 (en) System and method for algorithmic TCAM packet classification
US20200136971A1 (en) Hash-table lookup with controlled latency
US9871727B2 (en) Routing lookup method and device and method for constructing B-tree structure
US11003719B2 (en) Method and apparatus for accessing a storage disk
KR20190113942A (en) Merge Tree Garbage Metrics
CN110928483B (en) Data storage method, data acquisition method and equipment
KR20190117001A (en) Merge Tree Modifications for Maintenance Operations
US20140188893A1 (en) Data retrieval apparatus, data storage method and data retrieval method
JP2012524932A (en) Data structure, method and system for address retrieval
JP6288596B2 (en) Data processing method and apparatus
JP6951846B2 (en) Computer system and task allocation method
JP2016177688A (en) Data processor, data processing method and computer program
CN114253979A (en) Message processing method and device and electronic equipment
CN112817538A (en) Data processing method, device, equipment and storage medium
US11269687B2 (en) Map reduce using coordination namespace hardware acceleration
JP7436712B2 (en) Packet matching methods, apparatus, network devices and media
US8935508B1 (en) Implementing pseudo content access memory
JP2014502756A (en) Apparatus and method for mass data storage based on tree structure
CN113568877B (en) File merging method and device, electronic equipment and storage medium
CN111541617B (en) Data flow table processing method and device for high-speed large-scale concurrent data flow