JP6291435B2 - Program and cluster system - Google Patents

Program and cluster system Download PDF

Info

Publication number
JP6291435B2
JP6291435B2 JP2015032141A JP2015032141A JP6291435B2 JP 6291435 B2 JP6291435 B2 JP 6291435B2 JP 2015032141 A JP2015032141 A JP 2015032141A JP 2015032141 A JP2015032141 A JP 2015032141A JP 6291435 B2 JP6291435 B2 JP 6291435B2
Authority
JP
Japan
Prior art keywords
attribute
hash
value
bit string
index
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.)
Active
Application number
JP2015032141A
Other languages
Japanese (ja)
Other versions
JP2016153976A (en
Inventor
近藤 悟
悟 近藤
岡本 光浩
光浩 岡本
健 福元
健 福元
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2015032141A priority Critical patent/JP6291435B2/en
Publication of JP2016153976A publication Critical patent/JP2016153976A/en
Application granted granted Critical
Publication of JP6291435B2 publication Critical patent/JP6291435B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

本発明は、プログラムおよびクラスタシステムに関する。   The present invention relates to a program and a cluster system.

スケーラビリティの高い効果を得ることを最大目標としたデータベースの技術として、分散データベース(DB)が存在する。スケーラビリティを獲得するための方式としては、KVS(Key Value Store)が代表的である。
現在広く利用されているデータベース(DB)として、RDB(Relational Data Base)が存在する。このRDBの技術は、Row(行)、Column(列)からなる2次元のテーブル構造でデータを表現し、SQL(Structured Query Language)言語等によるクエリに応じて、JOIN(結合)や正規化を実行することで、検索等の処理を実現することができる。様々なアプリケーションは、RDBを用いて作成されることが多く、その理由は多岐に渡るが、特に重要な要素として、単純なkey検索だけでなく、データの属性値(value)でも検索できる機能を有するところが大きいと言える。但し、従来の分散システムでは、単純なkeyを用いたアプリケーションには適用できるが、valueを操作するアプリケーションには適用できないか、できてもスケール変更できない状況のものが多かった。しかも、データの構造を分散プラットフォーム(PF)用に大きく見直す必要もあった。
分散システムの研究分野でも、上記を鑑み、単純key検索用途のNoSQLから、属性値検索を始めとしたRDB並みの操作能力を持つNewSQLへの検討が多くされつつある。
A distributed database (DB) exists as a database technology whose maximum goal is to obtain a highly scalable effect. A representative method for obtaining scalability is KVS (Key Value Store).
An RDB (Relational Data Base) exists as a database (DB) that is currently widely used. This RDB technology expresses data in a two-dimensional table structure consisting of Rows and Columns, and performs JOIN and normalization according to queries in the SQL (Structured Query Language) language. By executing it, it is possible to realize processing such as search. Various applications are often created using RDB for a variety of reasons, but as a particularly important element, not only a simple key search but also a function that can search by data attribute value (value) It can be said that it has a large place. However, in the conventional distributed system, although it can be applied to an application using a simple key, it cannot be applied to an application that manipulates a value, or even if it can, the scale cannot be changed. Moreover, it has been necessary to reexamine the data structure for the distributed platform (PF).
In the field of research on distributed systems, in view of the above, a lot of studies are being made from NoSQL for simple key search to NewSQL having an operation capability similar to that of RDB including attribute value search.

分散システムにおいて属性値検索を可能とする代表的な手法として、Secondary Index等の転置インデックス手法があり、CassandraやMercury等の代表的な分散DBが採用されてきている(非特許文献1,2参照)。但し、それらは、基本的に、複数のhash関数を用い、keyを主のhash関数に適用して得られた出力の場所にマスターデータを置き、検索したい属性値を別のhash関数に適用して得られた出力の場所にレプリカデータを置く仕組みである。
また、レプリカデータをリンクとして、データ容量の効率性を高めたMerDyという手法も存在する。
As a representative method for enabling attribute value search in a distributed system, there is a transposed index method such as Secondary Index, and representative distributed DBs such as Cassandra and Mercury have been adopted (see Non-Patent Documents 1 and 2). ). However, they basically use multiple hash functions, place the master data at the output location obtained by applying the key to the main hash function, and apply the attribute value you want to search to another hash function. This is a mechanism to place replica data at the output location obtained.
There is also a technique called MerDy that uses replica data as a link to improve the efficiency of data capacity.

図13は、MerDyを説明する図である。
MerDyは、転置インデックス(属性検索用)を用いて、属性値による検索を可能にする分散DBにおいて、データの場所を示す識別子(hash値)を付与する。分散DBにおけるデータ配置のサーバへの配置の決定方法としては、データの属性タグや属性値等にhash値をかけて識別子とする。一方、サーバ毎に担当する識別子領域を割り当ててある。
FIG. 13 is a diagram for explaining MerDy.
MerDy assigns an identifier (hash value) indicating the location of data in a distributed DB that enables search by attribute value using an inverted index (for attribute search). As a method for determining the arrangement of the data arrangement in the distributed DB to the server, the hash value is applied to the attribute tag or attribute value of the data to make an identifier. On the other hand, an identifier area for each server is assigned.

図13に示すように、h0(key)を主のhash関数に適用して得られた出力のサーバ(このサーバは、ストレージとしての機能)にマスターデータ(v0,v1,v2)を置き、検索したい属性値を別のhash関数に適用して得られた出力の場所にレプリカデータ(v0,v1,v2)と(v0,v1,v2)とを置く。なお、2つのレプリカデータを置くのは一例であって、冗長化数に従って決定される。   As shown in FIG. 13, the master data (v0, v1, v2) is placed in the output server obtained by applying h0 (key) to the main hash function (this server functions as a storage) and searched. Replica data (v0, v1, v2) and (v0, v1, v2) are placed at the output location obtained by applying the desired attribute value to another hash function. Note that placing two replica data is an example, and is determined according to the number of redundancy.

上記主のhash関数は、keyで検索されるh0(key)であり、MD5(Message Digest Algorithm 5)などの不連続hash関数である。このh0(key)にマスターデータ(v0,v1,v2)を置く。
上記別のhash関数は、「属性値を検索するためのhash関数」であり、検索したい属性値に対して適用される上記主のhash関数とは別の、属性値で検索されるh1(v0),h2(v1),h3(v2)である。例えば、h1(v0)は、文字コード変換などの連続hash関数、h2(v1)は、文字数などの連続hash関数、h3(v2)は、SHA1(Secure Hash Algorithm 1)などの不連続なhash関数である。なお、転置インデックス(属性検索用)のkeyをk1,k2,…で表すことがある。
前記した非特許文献1,2に記載のMercuryやMerDyでは、属性値に対して、keyと同様にhash関数を適用し、そのhash値のコンシステントハッシュ(Consistent Hashing)等の空間上の位置に該当するサーバに、転置インデックスを格納する。
The main hash function is h0 (key) searched by key, and is a discontinuous hash function such as MD5 (Message Digest Algorithm 5). Master data (v0, v1, v2) is placed in this h0 (key).
The other hash function is a “hash function for searching an attribute value”, and h1 (v0) searched by an attribute value different from the main hash function applied to the attribute value to be searched. ), h2 (v1), h3 (v2). For example, h1 (v0) is a continuous hash function such as character code conversion, h2 (v1) is a continuous hash function such as the number of characters, and h3 (v2) is a discontinuous hash function such as SHA1 (Secure Hash Algorithm 1). It is. Note that the key of the inverted index (for attribute search) may be represented by k1, k2,.
In Mercury and MerDy described in Non-Patent Documents 1 and 2 described above, a hash function is applied to an attribute value in the same way as a key, and the hash value is placed in a spatial position such as a consistent hash (Consistent Hashing). Store the inverted index in the corresponding server.

川上 大輔, 他: “範囲検索と複数属性のデータの処理に適応した分散データストア” , 情報処理学会研究報告[システムソフトウェアとオペレーティング・システム] 2010-OS-113(10), 1-8, 2010-01-20.Daisuke Kawakami, et al .: “Distributed data store adapted to range search and multi-attribute data processing”, IPSJ SIG [System Software and Operating System] 2010-OS-113 (10), 1-8, 2010 -01-20. Cassandra secondary index,[online]、[平成26年7月21日検索]、インターネット<URL:http://books.google.co.jp/books?hl=ja&lr=&id=MKGSbCbEdg0C&oi=fnd&pg=PR7&dq=Cassandra+secondary+index&ots=XpPC2yy91A&sig=oCxd9a_Gvrp4cbfpidKEEVVMW6Y#v=onepage&q=Cassandra%20secondary%20index&f=false>Cassandra secondary index, [online], [Search July 21, 2014], Internet <URL: http: //books.google.co.jp/books? Hl = en & lr = & id = MKGSbCbEdg0C & oi = fnd & pg = PR7 & dq = Cassandra + secondary + index & ots = XpPC2yy91A & sig = oCxd9a_Gvrp4cbfpidKEEVVMW6Y # v = onepage & q = Cassandra% 20secondary% 20index & f = false>

KVSに基づいて分散配置されたデータに対してキー値でなく属性値(Value)で検索する場合において、条件を積にして検索する方法はいくつか存在する。例えば、単一の属性条件に適合するインデックスを集めてそれらを突き合わせる突合方式や論理式も含めた文字列でkeyを作成してhash値を算出する条件hash方式である。しかしながら、前者の突合方式では検索時の計算量が大きいという問題がある。また、後者の条件hash方式では、インデックス作成時にあらゆる論理式の組合せに対してhash値を検索する必要があるため、属性数が多くなると、インデックスの量が膨大化し、インデクシングの負荷が大きくなるという問題があった。さらに、後者は、属性値が変更された際に、その属性値を含む全ての論理式のインデックスに影響する等、インデックスの一貫性の観点でも問題があった。   There are several methods for searching by using a product as a condition when searching for data distributed based on KVS using attribute values instead of key values. For example, this is a conditional hash method in which a hash value is calculated by creating a key with a character string including a matching method and a logical expression by collecting indexes that match a single attribute condition and matching them. However, the former matching method has a problem that the amount of calculation at the time of searching is large. In the latter condition hash method, it is necessary to search for hash values for all combinations of logical expressions at the time of index creation. Therefore, if the number of attributes increases, the amount of index increases and the indexing load increases. There was a problem. Furthermore, the latter has a problem in terms of index consistency, for example, when an attribute value is changed, it affects all indexes of logical expressions including the attribute value.

このような背景を鑑みて本発明がなされたのであり、本発明は、検索時の負荷とインデクシングの負荷を小さくできるプログラムおよびクラスタシステムを提供することを課題とする。   The present invention has been made in view of such a background, and an object of the present invention is to provide a program and a cluster system that can reduce the load during search and the load of indexing.

前記した課題を解決するため、請求項1に記載の発明は、KVS(Key Value Store)を用いた分散データベース(DB)において、属性値を検索するためのhash関数を適用し、得られたhash値のhash空間上の位置に該当するサーバに、転置インデックスを格納するクラスタシステム、を構成する各前記サーバとしてのコンピュータを、インデックス作成時には、前記属性値を検索するためのhash関数に基づいて、前記属性値の属性種類分の属性のhash bit列を作成するhash bit列作成手段、前記属性種類分の属性のhash bit列を所定の連結順序で結合する結合手段、として機能させるためのプログラムとした。   In order to solve the above-described problem, the invention described in claim 1 applies a hash function for retrieving attribute values in a distributed database (DB) using KVS (Key Value Store), and hashes obtained. In the server corresponding to the position of the value in the hash space, the computer as each of the servers constituting the cluster system that stores the inverted index, based on the hash function for searching the attribute value when creating the index, A program for functioning as a hash bit string creating means for creating a hash bit string of attributes corresponding to the attribute types of the attribute value, and a combining means for combining the hash bit strings of attributes corresponding to the attribute types in a predetermined connection order; did.

また、請求項6記載の発明は、KVS(Key Value Store)を用いた分散データベース(DB)において、属性値を検索するためのhash関数を適用し、得られたhash値のhash空間上の位置に該当するサーバに、転置インデックスを格納するクラスタシステムであって、前記サーバは、インデックス作成時には、前記属性値を検索するためのhash関数に基づいて、前記属性値の属性種類分の属性のhash bit列を作成するhash bit列作成手段と、前記属性種類分の属性のhash bit列を所定の連結順序で結合する結合手段と、を備えることを特徴とするクラスタシステムとした。   According to the sixth aspect of the present invention, in the distributed database (DB) using KVS (Key Value Store), the hash function for retrieving the attribute value is applied, and the position of the obtained hash value in the hash space In the cluster system that stores the inverted index in the server corresponding to the above, the server, when creating the index, based on the hash function for searching for the attribute value, the hash of the attribute for the attribute type of the attribute value A cluster system comprising: a hash bit string creating unit that creates a bit string; and a coupling unit that joins the hash bit strings of attributes corresponding to the attribute types in a predetermined connection order.

このように、属性値の属性種類分の属性のhash bit列を結合した値を用いることで、検索時の負荷とインデクシングの負荷を小さくすることができる。すなわち、積条件の組合せ数に依存しないのでインデクシング負荷等は小さい。また、データ容量を節約できる上、一貫性も確保でき、データ設計時に何をkeyにするかを気にする必要もなく、柔軟な条件検索を実行することができる。   In this way, by using a value obtained by combining hash bit strings of attributes corresponding to the attribute types of attribute values, it is possible to reduce the load at the time of search and the load of indexing. That is, the indexing load is small because it does not depend on the number of combinations of product conditions. In addition, data capacity can be saved, consistency can be ensured, and flexible conditional search can be performed without having to worry about what is key when designing data.

また、請求項2に記載の発明は、前記結合手段が、前記属性値の属性種類分のすべての属性が少なくとも一回、前記連結順序の先頭に配置して結合することを特徴とする請求項1に記載のプログラムとした。   The invention according to claim 2 is characterized in that the combining means arranges and combines all attributes corresponding to the attribute types of the attribute values at least once at the head of the connection order. 1 as a program.

このようにすることで、登場頻度が高い属性がより先頭にくるので、積条件検索全体の検索速度が向上する。   By doing in this way, since the attribute with high appearance frequency comes first, the search speed of the entire product condition search is improved.

また、請求項3に記載の発明は、前記結合手段が、前記属性値の属性種類を登場頻度の高い順に並び替え、並び替えた属性値から算出されたhash 値をbit列として結合することを特徴とする請求項1に記載のプログラムとした。   The invention according to claim 3 is characterized in that the combining means rearranges the attribute types of the attribute values in descending order of appearance frequency, and combines the hash values calculated from the rearranged attribute values as a bit string. The program according to claim 1, which is characterized.

このようにすることで、よく出現する属性タグを条件式に含む場合の検索速度が向上する。   By doing so, the search speed when an attribute tag that frequently appears is included in the conditional expression is improved.

また、請求項4に記載の発明は、前記結合手段が、積条件の組合せ頻度が高い、前記属性値の属性種類のhash 値を上位にしてbit連結することを特徴とする請求項1に記載のプログラムとした。   The invention according to claim 4 is characterized in that the combination means performs bit concatenation with the hash value of the attribute type of the attribute value having a high combination frequency of product conditions as a higher rank. Program.

このようにすることで、よく出現する属性タグの組合せの条件積における検索速度が向上する。   By doing in this way, the search speed in the conditional product of the combination of the attribute tag which appears frequently is improved.

また、請求項5に記載の発明は、前記サーバが、検索時には、積にされた検索条件の属性を先頭hash bit列にもつインデックスを選択し、該インデックスに対して範囲検索を実行することを特徴とする請求項1に記載のプログラムとした。   Further, the invention according to claim 5 is that the server selects an index having the attribute of the searched search condition in the head hash bit column at the time of searching, and executes a range search on the index. The program according to claim 1, which is characterized.

このようにすることで、検索時には、条件属性の1つを先頭bitに持つインデックスを選択し、それに対して範囲検索を実行することで実現するので、どのような積条件でも、領域が小さな範囲検索となる。膨大なインデックスの突合せがないため検索の負荷は小さいという効果がある。   In this way, when searching, an index having one of the condition attributes as the first bit is selected and a range search is performed on it. Search. Since there is no huge index matching, the search load is small.

本発明によれば、検索時の負荷とインデクシングの負荷を小さくできるプログラムおよびクラスタシステムを提供することができる。   ADVANTAGE OF THE INVENTION According to this invention, the program and cluster system which can make small the load at the time of a search, and the load of indexing can be provided.

本実施形態に係るクラスタシステムを含む全体構成を示す図である。It is a figure which shows the whole structure containing the cluster system which concerns on this embodiment. 本実施形態に係るクラスタシステムを構成するサーバの構成を示す機能ブロック図である。It is a functional block diagram which shows the structure of the server which comprises the cluster system which concerns on this embodiment. (a)は本実施形態に係るクラスタシステムの属性タグ情報格納手段が格納する属性タグ情報の一例を示す図である。(b)は本実施形態に係るクラスタシステムの属性タグ情報格納手段が格納するhash関数の出力bit長の一例を示す図である。(A) is a figure which shows an example of the attribute tag information which the attribute tag information storage means of the cluster system concerning this embodiment stores. (B) is a figure which shows an example of the output bit length of the hash function which the attribute tag information storage means of the cluster system concerning this embodiment stores. 本実施形態に係るクラスタシステムの属性値を検索するためのhash関数のbit列の構成を説明する図である。It is a figure explaining the structure of the bit string of the hash function for searching the attribute value of the cluster system which concerns on this embodiment. 本実施形態に係るクラスタシステムの属性のhash値のbit連結インデクシング方法を説明する図である。It is a figure explaining the bit connection indexing method of the hash value of the attribute of the cluster system concerning this embodiment. 本実施形態に係るクラスタシステムの検索時のbit連結インデクシング方法を説明する図である。It is a figure explaining the bit connection indexing method at the time of the search of the cluster system which concerns on this embodiment. 本実施形態に係るクラスタシステムの検索時のbit連結インデクシング方法を説明する図である。It is a figure explaining the bit connection indexing method at the time of the search of the cluster system which concerns on this embodiment. 本実施形態に係るクラスタシステムの検索における積条件の登場頻度に従って結合するHash値の結合例を示す図である。It is a figure which shows the example of a combination of the Hash value combined according to the appearance frequency of the product conditions in the search of the cluster system which concerns on this embodiment. 本実施形態に係るクラスタシステムの検索における積条件の登場頻度に従って結合するHash値の結合例を示す図である。It is a figure which shows the example of a combination of the Hash value combined according to the appearance frequency of the product conditions in the search of the cluster system which concerns on this embodiment. 本実施形態に係るクラスタシステムの検索における積条件の組合せ頻度に従って結合するHash値の結合例を示す図である。It is a figure which shows the example of a combination of the Hash value combined according to the combination frequency of the product conditions in the search of the cluster system which concerns on this embodiment. 本実施形態に係るクラスタシステムのHash値の結合例を示す図である。It is a figure which shows the example of a combination of the Hash value of the cluster system which concerns on this embodiment. 本実施形態に係るクラスタシステムのHash値の結合例を示す図である。It is a figure which shows the example of a combination of the Hash value of the cluster system which concerns on this embodiment. MerDyを説明する図である。It is a figure explaining MerDy.

次に、本発明を実施するための形態(以下、「本実施形態」という)におけるクラスタシステム1等について説明する。   Next, the cluster system 1 and the like in a mode for carrying out the present invention (hereinafter referred to as “the present embodiment”) will be described.

(本実施形態のシステム構成)
本実施形態に係るクラスタシステム1について具体的に説明する。
図1は、本実施形態に係るクラスタシステムを含む全体構成を示す図である。
本実施形態に係るクラスタシステム1は、図1に示すように、ネットワークを介して、外部システムであるクライアント2等と接続される。そして、クライアント2からの入力データを受け取り、クラスタシステム1内でデータの保存、更新、検索等を行い、その結果を出力データとして、クライアント2に送信する。
(System configuration of this embodiment)
The cluster system 1 according to the present embodiment will be specifically described.
FIG. 1 is a diagram showing an overall configuration including a cluster system according to the present embodiment.
As shown in FIG. 1, the cluster system 1 according to the present embodiment is connected to a client 2 that is an external system via a network. Then, input data from the client 2 is received, data is stored, updated, searched, etc. in the cluster system 1, and the result is transmitted to the client 2 as output data.

図2は、本実施形態に係るクラスタシステム1を構成するサーバ11の構成を示す機能ブロック図である。
図2に示すように、サーバ11は、制御手段110、入出力手段20は、メモリ手段30、および記憶手段40を含んで構成される。
FIG. 2 is a functional block diagram showing the configuration of the server 11 constituting the cluster system 1 according to this embodiment.
As shown in FIG. 2, the server 11 includes a control unit 110, and the input / output unit 20 includes a memory unit 30 and a storage unit 40.

入出力手段20は、クライアント2や、各サーバ11との間の情報の入出力を行う。この入出力手段20は、通信回線を介して情報の送受信を行う通信インタフェースと、不図示のキーボード等の入力手段やモニタ等の出力手段等との間で入出力を行う入出力インタフェースとから構成される。   The input / output means 20 inputs / outputs information between the client 2 and each server 11. The input / output unit 20 includes a communication interface that transmits and receives information via a communication line, and an input / output interface that performs input / output between an input unit such as a keyboard (not shown) and an output unit such as a monitor. Is done.

メモリ手段30は、RAM(Random Access Memory)等の一次記憶装置からなり、制御手段110によるデータ処理に必要な情報を一時的に記憶する。   The memory unit 30 includes a primary storage device such as a RAM (Random Access Memory), and temporarily stores information necessary for data processing by the control unit 110.

記憶手段40は、ハードディスクやフラッシュメモリ等の記憶装置からなり、クラスタシステム1内の各サーバ11のID(IPアドレス)等を記憶する。   The storage unit 40 includes a storage device such as a hard disk or a flash memory, and stores the ID (IP address) and the like of each server 11 in the cluster system 1.

制御手段110は、サーバ11全体の制御を司り、情報受信手段111、構文解析手段112、属性タグ情報格納手段113、hash bit列作成手段114、結合手段115、検索手段116、および情報送信手段117を含んで構成される。なお、この制御手段110は、例えば、記憶手段40に格納されたプログラムをCPU(Central Processing Unit)がメモリ手段30であるRAMに展開し実行することで実現される。   The control unit 110 controls the entire server 11. The information reception unit 111, the syntax analysis unit 112, the attribute tag information storage unit 113, the hash bit string creation unit 114, the combination unit 115, the search unit 116, and the information transmission unit 117. It is comprised including. The control means 110 is realized by, for example, developing a program stored in the storage means 40 in a RAM (memory means 30) by a CPU (Central Processing Unit).

情報受信手段111は、入出力手段20を介して、クライアント2からの入力データ、他のサーバ11等からの出力データを取得する。   The information receiving unit 111 acquires input data from the client 2 and output data from another server 11 or the like via the input / output unit 20.

構文解析手段112は、情報受信手段111から入力データを受け取り、その入力データの内容を構文解析する。例えば、構文解析手段112は、その入力データが、(a)keyの完全一致検索、(b)keyの範囲検索、(c)属性値(value)の完全一致検索、(d)valueの範囲検索(部分文字列検索を含む)のいずれであるかを解析する。そして、構文解析手段112は、その解析結果をhash bit列作成手段114に引き渡す。   The syntax analysis unit 112 receives input data from the information reception unit 111 and parses the contents of the input data. For example, the parsing unit 112 may search the input data for (a) key exact match search, (b) key range search, (c) attribute value (value) complete match search, and (d) value range search. Analyze whether it is (including substring search). Then, the syntax analysis unit 112 passes the analysis result to the hash bit string creation unit 114.

属性タグ情報格納手段113は、属性タグ毎に、属性タグに適用するhash関数、属性値に適用するhash関数、およびkeyに適用するhash関数を記憶手段40に属性タグ情報として格納する(図3(a)参照)。また、各hash関数は、それぞれ何bitのhash値を算出するかを個別に記憶しているものとする。例えば、属性タグ「Location」や「Boolean」毎に、あらかじめ出力bit長が決まったhash関数のセットを格納している(図3(b)参照)。   For each attribute tag, the attribute tag information storage unit 113 stores a hash function applied to the attribute tag, a hash function applied to the attribute value, and a hash function applied to the key as attribute tag information in the storage unit 40 (FIG. 3). (See (a)). Also, each hash function individually stores how many bits of hash values are calculated. For example, for each attribute tag “Location” or “Boolean”, a set of hash functions having a predetermined output bit length is stored (see FIG. 3B).

hash bit列作成手段114は、記憶手段40に記憶された属性タグ情報から取得した属性タグ毎のhash関数及びbit長に基づいて、「属性値から得られたhash bit列」(図4の符号(A)参照)と、「属性タグから得られた不連続hash bit列」(図4の符号(B)参照)と、「keyから得られた連続hash bit列」(図4の符号(C)参照)とを作成する。ここでhash値を2値でみる(2進数で表す)と、hash bit列となる。
hash bit列作成手段114は、インデックス作成時には、属性値を検索するためのhash関数に基づいて、属性値の属性種類分の属性のhash bit列を作成する。
Based on the hash function and bit length for each attribute tag acquired from the attribute tag information stored in the storage unit 40, the hash bit string creating unit 114 generates a “hash bit string obtained from the attribute value” (reference numeral in FIG. 4). (See (A)), “discontinuous hash bit sequence obtained from attribute tag” (see symbol (B) in FIG. 4), and “continuous hash bit sequence obtained from key” (see symbol (C in FIG. 4)). )) And create. Here, when the hash value is viewed in binary (represented in binary), it becomes a hash bit string.
The hash bit string creating unit 114 creates a hash bit string of attributes corresponding to attribute types of attribute values based on a hash function for retrieving attribute values when creating an index.

結合手段115は、hash bit列を結合する。具体的には、結合手段115は、属性種類分の属性のhash bit列を所定の連結順序で結合する。結合手段115は、属性値の属性種類分のすべての属性が少なくとも一回、前記連結順序の先頭に配置して結合する。この場合、結合手段115は、属性の連結順序をサイクリックに入れ替える。   The combining means 115 combines hash bit strings. Specifically, the combining unit 115 combines hash bit strings of attributes corresponding to attribute types in a predetermined connection order. The combining means 115 combines all the attributes corresponding to the attribute types of the attribute values at least once at the head of the connection order. In this case, the combining unit 115 cyclically replaces the attribute connection order.

検索手段116は、検索時、積にされた検索条件の属性を先頭hash bit列にもつインデックスを選択し、該インデックスに対して範囲検索を実行する。   At the time of the search, the search means 116 selects an index having the attribute of the search condition that has been multiplied in the first hash bit string, and performs a range search on the index.

情報送信手段117は、入出力手段20を介して、クライアント2や他のサーバ11に出力データを送信する。   The information transmission unit 117 transmits output data to the client 2 and other servers 11 via the input / output unit 20.

本実施形態は、「属性値を検索するためのhash関数」を、複数のhash bit列の組み合わせにより構成することを特徴とする。例えば、不連続関数(1つの属性値に対して不連続なhash関数(MD5など)を使うこと)、連続関数(文字コード変換で用いる数値化関数連続なhash関数を使うこと)といった排他的(二者択一的)な使用の仕方ではなく、bit列で結合したhash値を使うようにし、転置インデックス(属性検索用)を作成する。   The present embodiment is characterized in that the “hash function for searching attribute values” is configured by a combination of a plurality of hash bit strings. For example, exclusive functions such as discontinuous functions (use discontinuous hash functions (such as MD5) for one attribute value) and continuous functions (use numerical hash functions continuous hash functions used for character code conversion) Instead of using the alternative, use a hash value combined with a bit string and create an inverted index (for attribute search).

以下、「属性値を検索するためのhash関数」の各bit列の構成について説明し、次に各bit列の結合手法について説明する。
図4は、「属性値を検索するためのhash関数」のbit列の構成を説明する図である。
図4に示すように、「属性値を検索するためのhash関数」のbit列は、「属性値から得られた連続hash bit列」(図4の符号(A)参照)と、「属性タグから得られた不連続hash bit列」(図4の符号(B)参照)と、「keyから得られた連続hash bit列」(図4の符号(C)参照)と、から構成される。
なお、図4の符号(A)に示す属性値から得られたhash bit列は、不連続hash bit列であってもよい。また、各hash bit列のビット長については、図5により後記する。
Hereinafter, the configuration of each bit string of the “hash function for retrieving an attribute value” will be described, and then a method for combining the bit strings will be described.
FIG. 4 is a diagram for explaining the configuration of the bit string of “hash function for retrieving attribute values”.
As shown in FIG. 4, the bit string of “hash function for retrieving attribute value” includes “continuous hash bit string obtained from attribute value” (see symbol (A) in FIG. 4) and “attribute tag”. The discontinuous hash bit sequence obtained from (see (B) in FIG. 4) and the “continuous hash bit sequence obtained from the key” (see (C) in FIG. 4).
Note that the hash bit sequence obtained from the attribute value indicated by the symbol (A) in FIG. 4 may be a discontinuous hash bit sequence. The bit length of each hash bit string will be described later with reference to FIG.

<属性値から得られたhash bit列>(図4の符号(A)参照)
図4の符号(A)に示すように、属性値から得られたhash bit列「00000101101101」は、転置インデックス(属性検索用)のhash値である。なお、図4の符号(A)に示す属性値から得られた連続hash bit列は、従来例と同様の転置インデックスのhash値でもある。具体的には、本実施形態では、属性値に対して、keyと同様にhash関数を適用し、そのhash値(図4の符号(A)に示すhash bit列)のコンシステントハッシュ等の空間上の位置に該当するサーバに、転置インデックス(属性検索用)を格納する。
<Hash bit string obtained from the attribute value> (see symbol (A) in FIG. 4)
As shown in FIG. 4A, the hash bit string “00000101101101” obtained from the attribute value is the hash value of the transposed index (for attribute search). Note that the continuous hash bit sequence obtained from the attribute value indicated by the symbol (A) in FIG. 4 is also the hash value of the transposed index similar to the conventional example. Specifically, in the present embodiment, a hash function is applied to the attribute value in the same manner as the key, and a space such as a consistent hash of the hash value (the hash bit string indicated by the symbol (A) in FIG. 4) is used. The inverted index (for attribute search) is stored in the server corresponding to the upper position.

<属性タグから得られた不連続hash bit列>(図4の符号(B)参照)
図4の符号(B)に示すように、属性タグから得られた不連続hash bit列「01001100101101」は、属性タグを不連続なMD5等のhash関数に適用して得られたhash値である。一例を挙げる。「居住地」が「東京」であるとすると、属性値は「東京」、属性タグは「居住地」となる。なお、「居住地」が「東京」であることは「属性」となる。この「属性」とは、key に紐付いたデータの中身である。前記図12を参照して説明すると、図12のマスターデータv0について、v0は属性値(属性)であり、属性値v0がどこのデータかということはkey により関係が紐付けられている。属性値(属性)とkey とは、例えば一対一で関係が紐付けられている。
<Discontinuous hash bit string obtained from the attribute tag> (see symbol (B) in FIG. 4)
As shown in FIG. 4B, the discontinuous hash bit string “01001100101101” obtained from the attribute tag is a hash value obtained by applying the attribute tag to a discontinuous hash function such as MD5. . Take an example. If the “residence” is “Tokyo”, the attribute value is “Tokyo” and the attribute tag is “residence”. Note that “residence” being “Tokyo” is an “attribute”. This “attribute” is the content of the data associated with the key. Referring to FIG. 12, with respect to the master data v0 in FIG. 12, v0 is an attribute value (attribute), and the relationship between the attribute value v0 and the data is associated with the key. The attribute value (attribute) and the key are associated with each other in a one-to-one relationship, for example.

<keyから得られた連続hash bit列>(図4の符号(C)参照)
図4の符号(C)に示すように、keyから得られた連続hash bit列「111010101101000」は、keyを連続なhash関数に適用して得られたhash値である。
<Consecutive hash bit sequence obtained from key> (See reference (C) in FIG. 4)
As shown in FIG. 4C, the continuous hash bit string “111010101101000” obtained from the key is a hash value obtained by applying the key to the continuous hash function.

ここで、一般的には、転置インデックスを作成する場合、属性値は属性値で、keyはkeyで使用し、本実施形態のように、属性値にkeyを組み合わせてhash値とすることはない。当然のことながら、属性値から得られた連続hash bit列と属性タグから得られた不連続hash bit列とを結合させるものもなく、属性値から得られた連続hash bit列とkeyから得られた連続hash bit列とを結合させるものもない。   Here, in general, when creating an inverted index, an attribute value is an attribute value, a key is used as a key, and a key is not combined with an attribute value to create a hash value as in this embodiment. . Naturally, there is nothing to combine the continuous hash bit sequence obtained from the attribute value and the discontinuous hash bit sequence obtained from the attribute tag, and it is obtained from the continuous hash bit sequence and key obtained from the attribute value. There is nothing that combines a continuous hash bit sequence.

次に、bit連結インデクシング方法について説明する。
[概要]
<インデックス作成時>
本bit連結インデクシング方法におけるbit列は、図4の符号(A)の部分に適用される。
本実施形態では、属性タグ、属性値、およびkeyに、コンシステントハッシュ等の空間で位置を決めるためのhash関数をそれぞれ適用した値を結合する。
特に、インデックスを作成する際に、全ての属性値のhash値を算出し、それをbit連結する。
(1)インデックス作成時には、各bit列間において、先頭は、異なる属性種類のhash値を配置するようにする。
(2)各bit列間においては、属性の連結順序をサイクリックに入れ替わるようにbit列の値をセットする。すなわち、bit連結する順序をサイクリックに入れ替え、どの属性も均等に各bit領域に割り当てられるようにする。
Next, a bit connection indexing method will be described.
[Overview]
<When creating an index>
The bit string in this bit concatenated indexing method is applied to the portion indicated by reference numeral (A) in FIG.
In this embodiment, a value obtained by applying a hash function for determining a position in a space such as a consistent hash is combined with an attribute tag, an attribute value, and a key.
In particular, when creating an index, the hash values of all attribute values are calculated and bit-concatenated.
(1) At the time of index creation, hash values of different attribute types are arranged at the beginning between each bit string.
(2) Between each bit string, the value of the bit string is set so that the attribute connection order is cyclically changed. That is, the order of bit connection is cyclically changed so that any attribute is equally assigned to each bit area.

<検索時>
検索時には、積にされた検索条件の一つの属性を先頭bitにもつインデックスを選択し、それに対して範囲検索を実行する。どのような積条件でも、領域が小さな範囲検索となるので、膨大なインデックスの突合せがなく、検索の負荷は小さいという効果がある。
<When searching>
At the time of search, an index having one attribute of the search condition that has been multiplied as the first bit is selected, and a range search is performed on the index. Under any product condition, the region is searched in a small range, so there is no huge index matching and the search load is small.

以下、具体的に説明する。
[インデックス作成時]
図5は、属性のhash値のbit連結インデクシング方法を説明する図である。
図5に示すように、データ50は、key に紐付いたマスターデータ(例えば、前記図12のマスターデータv0)である。図5では、keyは「1234」、その属性値は「山田」(属性タグは「姓」)、「太郎」(属性タグは「名」)、「男」(属性タグは「性別」)、および「東京」(属性タグは「居住地」)の各属性値を有するものとする。
This will be specifically described below.
[When creating an index]
FIG. 5 is a diagram for explaining a bit concatenation indexing method for the hash value of an attribute.
As shown in FIG. 5, the data 50 is master data (for example, master data v0 in FIG. 12) associated with the key. In FIG. 5, the key is “1234”, the attribute value is “Yamada” (the attribute tag is “last name”), “Taro” (the attribute tag is “first name”), “male” (the attribute tag is “sex”), And “Tokyo” (the attribute tag is “residence”).

<hash bit列作成>
インデックスを作成する際に、全ての属性値のhash値を算出する。
各属性値「山田」、「太郎」、「男」、および「東京」を、この順に属性0(姓)、属性1(名)、属性2(性別)、および属性3(居住地)と記述する。属性0(姓)、属性1(名)、属性2(性別)、および属性3(居住地)の下の矩形の中の数値が属性値から得られたhash bit列である。ここでは、8bitで表したがbit数はどのようなものでもよい。例えば、属性0(姓)のhash bit列「11010111」、属性1(名)のhash bit列「01110001」、属性2(性別)のhash bit列「00010100」、および属性3(居住地)のhash bit列「01011000」である。
<Create hash bit sequence>
When creating an index, the hash value of all attribute values is calculated.
Each attribute value “Yamada”, “Taro”, “Men”, and “Tokyo” are described in this order as attribute 0 (last name), attribute 1 (first name), attribute 2 (gender), and attribute 3 (residence). To do. A numerical value in a rectangle below the attribute 0 (last name), attribute 1 (first name), attribute 2 (gender), and attribute 3 (residence) is a hash bit string obtained from the attribute value. In this example, 8 bits are used, but any number of bits may be used. For example, a hash bit string “11010111” of attribute 0 (last name), a hash bit string “01110001” of attribute 1 (first name), a hash bit string “00010100” of attribute 2 (gender), and a hash of attribute 3 (residence) The bit string is “01011000”.

<hash bit列のbit連結>
図5の符号aに示すように、各属性値のhash値をbit連結したhash値を作成する。図5(a)の場合、「11010111」「01110001」「00010100」「01011000」がbit連結される。
そして、複数の属性値から算出されたhash値をbit列として結合した値に基づき、転置インデックスをクラスタ内のサーバ11に格納するようにする。
<bit concatenation of hash bit sequence>
As shown by a symbol a in FIG. 5, a hash value is generated by bit-connecting hash values of attribute values. In the case of FIG. 5A, “11010111”, “01110001”, “00010100”, and “01011000” are bit-connected.
Then, based on a value obtained by combining hash values calculated from a plurality of attribute values as a bit string, the transposed index is stored in the server 11 in the cluster.

<bit連結する順序入れ替え>
bit連結する順序をサイクリックに入れ替えることで、各bit列間において、先頭は、異なる属性種類のhash値を配置するようにする。
例えば、図5(b)に示すように、次の順序では、属性1(名)のhash bit列「01110001」を先頭にくるようにbit連結する順序を入れ替える。この例では、この入れ替えに伴い、いままで先頭であった属性0(姓)のhash bit列「11010111」が最後尾となる。なお、一般的な前方一致の場合、先頭のみが重視される。
bit連結する順序をサイクリックに入れ替えることで、図5(c)に示すように、次の順序では、属性2(性別)のhash bit列「00010100」を先頭にしたhash bit列が連結され、さらにその次の順序では、図5(d)に示すように、属性3(居住地)のhash bit列「01011000」を先頭にしたhash bit列が連結される。
このように、インデックスを作成する際に、bit連結する順序をサイクリックに入れ替え、どの属性も均等に各bit領域に割り当てられるようにする。積条件の組合せ数に依存しないのでインデクシング負荷等は小さいという効果がある。
<Change order of bit concatenation>
By switching the bit connection order cyclically, hash values of different attribute types are arranged at the beginning between each bit string.
For example, as shown in FIG. 5B, in the next order, the order of bit concatenation is changed so that the hash bit string “01110001” of attribute 1 (name) comes first. In this example, with this replacement, the hash bit string “11010111” of attribute 0 (last name), which has been the top so far, becomes the last. In the case of general forward matching, only the top is considered important.
By cyclically changing the bit connection order, as shown in FIG. 5C, in the next order, the hash bit string starting with the hash bit string “00010100” of attribute 2 (gender) is connected, Further, in the next order, as shown in FIG. 5D, the hash bit string starting with the hash bit string “01011000” of attribute 3 (residence) is concatenated.
In this way, when creating an index, the order of bit connection is cyclically changed so that any attribute is evenly assigned to each bit area. Since it does not depend on the number of combinations of product conditions, there is an effect that the indexing load is small.

[検索時]
図6および図7は、検索時のbit連結インデクシング方法を説明する図である。
検索時には、検索条件の一つの属性を先頭bitにもつインデックスを選択し、それに対して範囲検索を実行する。
<例1>
図6は、クラスタ内のサーバ11された転置インデックスに対して、属性2(性別)が男で、属性3(居住地)が東京を検索する場合の例である。属性0(姓)および属性1(名)は、検索対象外であるため「*」(ワイルドカード)となっている。
条件式は、下記で示される。
属性2(性別)=男 ∧ 属性3(居住地)=東京
∧は、積の記号である。なお、∧(積)が実現できれば、∨(和)、¬(否定)、⇒(ならば)などを用いて全てを実現できることが知られている。
[When searching]
6 and 7 are diagrams for explaining a bit concatenation indexing method at the time of search.
At the time of search, an index having one attribute of the search condition in the first bit is selected, and a range search is performed on it.
<Example 1>
FIG. 6 shows an example in which the attribute 2 (gender) is male and the attribute 3 (residence) is Tokyo for the inverted index of the server 11 in the cluster. Attribute 0 (last name) and attribute 1 (first name) are “*” (wildcard) because they are not search targets.
The conditional expression is shown below.
Attribute 2 (gender) = male ∧ Attribute 3 (residence) = Tokyo ∧ is a product symbol. It is known that if ∧ (product) can be realized, all can be realized using ∨ (sum), ¬ (negation), ⇒ (if).

この例1の場合、hash bit列の先頭の8bitが「男」のhash値に、次のhash bit列の8bitが「東京」のhash値で決まる。したがって、図6の符号aに示すように、hash空間上の当該hash領域を担当するインデックスを全て取得する。この例では、key「9876」「5432」「1234」「5678」を有するクラスタ内のサーバ11からインデックスを取得する。そして、下位16bitが全て「00000000」「00000000」から全て「11111111」「11111111」の領域に存在するインデックスを取得する。図6の符号bに示す「00010100」「01011000」「00000000」「00000000」から図6の符号cに示す「00010100」「01011000」「11111111」「11111111」の領域に存在するインデックスを取得することで、「男」∧「東京」の検索が実現される。   In the case of Example 1, the first 8 bits of the hash bit sequence are determined by the hash value of “m”, and the 8 bits of the next hash bit sequence are determined by the hash value of “Tokyo”. Therefore, as shown by the symbol “a” in FIG. 6, all indexes in charge of the hash area in the hash space are acquired. In this example, an index is acquired from the server 11 in the cluster having keys “9876”, “5432”, “1234”, and “5678”. Then, an index existing in the areas of all “11111111” and “11111111” from “00000000” and “00000000” is acquired. By acquiring the indexes existing in the areas “00010100”, “01011000”, “11111111”, “11111111” shown in the code c of FIG. 6 from “00010100” “01011000” “00000000” “00000000” shown in the code b of FIG. , "Men" ∧ "Tokyo" search is realized.

<例2>
図7は、クラスタ内のサーバ11された転置インデックスに対して、属性0(姓)が山田で、属性2(性別)が男を検索する場合の例である。属性1(名)および属性3(居住地)は、検索対象外であるため「*」(ワイルドカード)となっている。
条件式は、下記で示される。
属性0(姓)=山田 ∧属性2(性別)=男
この例2の場合、hash bit列の先頭の8bitが「山田」のhash値に、次のhash bit列の8bitが「男」のhash値で決まる。したがって、図7の符号aに示すように、hash空間上の当該hash領域を担当するインデックスを全て取得する。この例では、key「9876」「5432」「1234」「5678」を有するクラスタ内のサーバ11からインデックスを取得する。そして、「*」(ワイルドカード)の対象8bitが全て「11010111」「00000000」「000010100」「00000000」から「11010111」「11111111」「00010100」「11111111」までの領域に存在するインデックスを取得する。図6の符号b,cと符号d,eに示すhash bit列の領域に存在するインデックスを取得することで、「山田」∧「男」の検索が実現される。
<Example 2>
FIG. 7 shows an example in which the attribute 0 (last name) is Yamada and the attribute 2 (gender) is male with respect to the inverted index of the server 11 in the cluster. Attribute 1 (name) and attribute 3 (residence) are “*” (wild card) because they are not search targets.
The conditional expression is shown below.
Attribute 0 (surname) = Yamada Atsushi Attribute 2 (gender) = male In this example 2, the first 8 bits of the hash bit string is the hash value of “Yamada”, and the next hash bit string is 8 bits of “male”. Determined by value. Therefore, as shown by the symbol a in FIG. 7, all indexes that are in charge of the hash area in the hash space are acquired. In this example, an index is acquired from the server 11 in the cluster having keys “9876”, “5432”, “1234”, and “5678”. Then, an index in which all 8 bits of “*” (wild card) are in the area from “11010111” “00000000” “000010100” “00000000” to “11010111” “11111111” “00010100” “11111111” is acquired. By retrieving an index that exists in the area of the hash bit string indicated by reference symbols b and c and reference symbols d and e in FIG.

次に、Hash値の結合のバリエーションについて説明する。
<結合例1>
図8は、Hash値の結合例を示す図である。図8は、検索における積条件の登場頻度に従って結合する例1である。
属性値の属性種類として、前記図5に示す属性0(姓)、属性1(名)、属性2(性別)、および属性3(居住地)があるものとする。また、これら属性種類の登場頻度は、属性2(性別)>属性0(姓)>属性3(居住地)>属性1(名)であることが分かっているとする。
図8(a)に示すように、登場頻度の高い順に、属性種類を並び替え、並び替えた属性値から算出されたhash 値をbit列として結合する。
また、図8(b)〜(d)に示すように、登場頻度順にサイクリックに入れ替えて、bit連結する。登場頻度が高い属性がより先頭にくるので、積条件検索全体の検索速度が向上する。
Next, variations of combining Hash values will be described.
<Join example 1>
FIG. 8 is a diagram illustrating an example of combining Hash values. FIG. 8 is an example 1 of combining according to the appearance frequency of the product condition in the search.
As attribute types of attribute values, there are attribute 0 (last name), attribute 1 (first name), attribute 2 (gender), and attribute 3 (residence) shown in FIG. Further, it is assumed that the appearance frequency of these attribute types is found to be attribute 2 (gender)> attribute 0 (surname)> attribute 3 (residence)> attribute 1 (first name).
As shown in FIG. 8A, the attribute types are rearranged in the descending order of appearance frequency, and hash values calculated from the rearranged attribute values are combined as a bit string.
Further, as shown in FIGS. 8B to 8D, the bits are connected in a cyclic manner in the order of appearance frequency. Since attributes having a high appearance frequency come to the top, the search speed of the entire product condition search is improved.

<結合例2>
図9は、Hash値の結合例を示す図である。図9は、検索における積条件の登場頻度に従って結合する例2である。
属性値の属性種類として、前記図5に示す属性0(姓)、属性1(名)、属性2(性別)、および属性3(居住地)があるものとする。また、これら属性種類の登場頻度は、属性2(性別)>属性0(姓)>属性3(居住地)>属性1(名)の順に多く、かつ登場確率PがP(性別)=0.5,P(姓)=0.4,P(居住地)=0.3,P(名)=0.2であるとする。
図9の符号aに示すように、それぞれの属性が必ず1回は先頭に来て、かつ、図9の符号bに示すように、結合するbit位置に応じて確率の重みづけ和をとるとともに、図9の符号cに示すように、この確率の重みづけ和が最大となる結合順序を決める。このようにすることで、よく出現する属性タグを条件式に含む場合の検索速度が向上する効果がある。
<Combination example 2>
FIG. 9 is a diagram illustrating an example of combining Hash values. FIG. 9 is an example 2 of combining according to the appearance frequency of the product condition in the search.
As attribute types of attribute values, there are attribute 0 (last name), attribute 1 (first name), attribute 2 (gender), and attribute 3 (residence) shown in FIG. The frequency of appearance of these attribute types is attribute 2 (gender)> attribute 0 (surname)> attribute 3 (residence)> attribute 1 (first name) in order, and the appearance probability P is P (gender) = 0. 5, P (last name) = 0.4, P (residence) = 0.3, and P (first name) = 0.2.
As shown by reference symbol a in FIG. 9, each attribute always comes to the head once, and as shown by reference symbol b in FIG. 9, a weighted sum of probabilities is taken according to the bit positions to be combined. As shown by the symbol c in FIG. 9, the combination order that maximizes the weighted sum of the probabilities is determined. By doing in this way, there is an effect of improving the search speed when an attribute tag that frequently appears is included in the conditional expression.

<結合例3>
図10は、Hash値の結合例を示す図である。図10は、検索における積条件の組合せ頻度に従って結合する例である。
属性値の属性種類として、前記図5に示す属性0(姓)、属性1(名)、属性2(性別)、および属性3(居住地)があるものとする。また、積条件の組合せ頻度が分かっているとする。
例えば、属性2(性別)∧属性3(居住地)、属性0(姓)∧属性3(居住地)、属性0(姓)∧属性2(性別)、および属性0(姓)∧属性1(名)∧属性3(居住地)の積条件の組合せ頻度が高いものとする。
図10(a)に示すように、積条件の組合せ頻度が高い、属性0(姓)および属性2(性別)のhash 値を上位にしてbit連結する。
<Combination example 3>
FIG. 10 is a diagram illustrating an example of combining Hash values. FIG. 10 is an example of combining according to the combination frequency of product conditions in the search.
As attribute types of attribute values, there are attribute 0 (last name), attribute 1 (first name), attribute 2 (gender), and attribute 3 (residence) shown in FIG. Further, it is assumed that the combination frequency of product conditions is known.
For example, attribute 2 (gender) ∧ attribute 3 (residence), attribute 0 (surname) ∧ attribute 3 (residence), attribute 0 (surname) ∧ attribute 2 (gender), and attribute 0 (surname) ∧ attribute 1 ( Name) Assume that the combination frequency of the product condition of ∧ attribute 3 (residence) is high.
As shown in FIG. 10A, bit concatenation is performed with the hash values of attribute 0 (last name) and attribute 2 (gender) having a high combination frequency of product conditions set higher.

同様に、図10(b)に示すように、積条件の組合せ頻度が高い、属性0(姓)および属性3(居住地)を上位にしてbit連結する。また、図8(c)に示すように、積条件の組合せ頻度が高い、属性2(性別)および属性0(姓)のhash 値を上位にしてbit連結する。また、図10(d)に示すように、積条件の組合せ頻度が高い、属性3(居住地)と属性0(姓)と属性1(名)を上位にしてbit連結する。
ここで、積条件の組合せ頻度の検索が多い場合は、上記サイクリックな入れ替えはしないようにする。
なお、上記登場頻度(図9参照)、および上記組合せ頻度(図10参照)に関して、それを利用するために、検索の際に検索条件に含まれる属性種類を検索履歴として記録しておくようにする。このようにすることで、よく出現する属性タグの組合せの条件積における検索速度が向上する効果がある。
Similarly, as shown in FIG. 10 (b), bit connection is performed with attribute 0 (surname) and attribute 3 (residence) having higher combination frequency of product conditions being higher. Also, as shown in FIG. 8C, bit concatenation is performed with the hash values of attribute 2 (gender) and attribute 0 (surname) having a high combination frequency of product conditions being higher. Further, as shown in FIG. 10 (d), bit connection is performed with attribute 3 (residence), attribute 0 (surname), and attribute 1 (first name) having higher frequency of combination of product conditions.
Here, when there are many searches for the combination frequency of product conditions, the cyclic replacement is not performed.
In order to use the appearance frequency (see FIG. 9) and the combination frequency (see FIG. 10), the attribute type included in the search condition is recorded as a search history when searching. To do. By doing so, there is an effect of improving the search speed in the conditional product of combinations of attribute tags that often appear.

次に、インデックス数の増減について説明する。
これまでの例では、属性数分だけのインデックスを作成していたが、固定数であれば属性数以上のインデックスを作成してもよい。また、同様な理由で属性数以下のインデックスでもよい。
<結合例4>
図11は、Hash値の結合例を示す図である。図11は、インデックス数を増減させて結合する例である。
前記図5の場合、属性数は、属性0(姓)、属性1(名)、属性2(性別)、および属性3(居住地)の4つであり、図5(a)〜(d)に示すように属性数分だけのインデックスを作成していた。属性値が固定数であれば属性数以上のインデックスを作成してもよい。
例えば、図11(a)〜(d)に示すように、図5(a)〜(d)の場合と同様に属性数は、属性0(姓)、属性1(名)、属性2(性別)、および属性3(居住地)の4つである。なお、図11(a)〜(d)については、図10(a)〜(d)の場合と同様の例を準用した。
図11(a)〜(d)に示すように、元の属性数は、4つであり、属性1(名)から始まるものは出現しない。そこで、図11(e)の符号aに示すように、属性1(名)から始まるものを追加する。
Next, increase / decrease in the number of indexes will be described.
In the examples so far, the index for the number of attributes is created, but an index greater than the number of attributes may be created if the number is fixed. For the same reason, the number of attributes may be less than the number of attributes.
<Combination example 4>
FIG. 11 is a diagram illustrating an example of combining Hash values. FIG. 11 shows an example of combining by increasing or decreasing the number of indexes.
In the case of FIG. 5, the number of attributes is four, ie, attribute 0 (last name), attribute 1 (first name), attribute 2 (gender), and attribute 3 (residence), and FIGS. As shown in the figure, only the number of attributes were created. If the attribute value is a fixed number, more indexes than the number of attributes may be created.
For example, as shown in FIGS. 11A to 11D, as in FIGS. 5A to 5D, the number of attributes is attribute 0 (last name), attribute 1 (first name), attribute 2 (gender). ) And attribute 3 (residence). In addition, about FIG. 11 (a)-(d), the example similar to the case of FIG. 10 (a)-(d) was applied mutatis mutandis.
As shown in FIGS. 11A to 11D, the original number of attributes is four, and those starting from attribute 1 (name) do not appear. Therefore, as shown by the symbol a in FIG. 11 (e), the one starting from the attribute 1 (name) is added.

<結合例5>
図12は、Hash値の結合例を示す図である。図12は、積条件として用いない属性があるならば結合しない例である。
これまでの例1〜3では、属性数分だけのhash値を結合していた。積条件として用いない属性があるならばそれは結合しなくてもよいものとする。
前記図5の場合、属性数は、属性0(姓)、属性1(名)、属性2(性別)、および属性3(居住地)の4つであり、図5(a)〜(d)に示すように属性数分だけのインデックスを作成していた。
仮に、属性1(名)が積条件として用いない属性であることが分かっている場合、属性1(名)は結合しなくてもよいものとする。
例えば、図12(a)〜(c)に示すように、属性1(名)が積条件として用いない属性である場合、属性1(名)を結合しない。属性数は3つとなる。その結果、この例では、重複を避けるためインデックスの数も3つとなる。
<Combination Example 5>
FIG. 12 is a diagram illustrating an example of combining Hash values. FIG. 12 shows an example in which there is no combination if there is an attribute that is not used as a product condition.
In Examples 1 to 3 so far, hash values corresponding to the number of attributes are combined. If there is an attribute that is not used as a product condition, it does not have to be combined.
In the case of FIG. 5, the number of attributes is four, ie, attribute 0 (last name), attribute 1 (first name), attribute 2 (gender), and attribute 3 (residence), and FIGS. As shown in the figure, only the number of attributes were created.
If it is known that attribute 1 (name) is an attribute that is not used as a product condition, attribute 1 (name) may not be combined.
For example, as shown in FIGS. 12A to 12C, when attribute 1 (name) is an attribute that is not used as a product condition, attribute 1 (name) is not combined. The number of attributes is three. As a result, in this example, the number of indexes is three in order to avoid duplication.

以上説明したように、本実施形態のサーバ11は、インデックス作成時、属性値を検索するためのhash関数に基づいて、属性値の属性種類分の属性のhash bit列を作成するhash bit列作成手段114と、属性種類分の属性のhash bit列を所定の連結順序で結合する結合手段115と、検索時、積にされた検索条件の属性を先頭hash bit列にもつインデックスを選択し、該インデックスに対して範囲検索を実行する検索手段116と、を備える。   As described above, the server 11 of the present embodiment creates a hash bit string that creates a hash bit string of attributes corresponding to the attribute types of attribute values based on the hash function for retrieving attribute values when creating an index. Means 114, combining means 115 for combining the hash bit strings of attributes corresponding to the attribute types in a predetermined concatenation order, and selecting an index having the attribute of the search condition that has been multiplied in the head hash bit string at the time of the search, Search means 116 for performing a range search on the index.

これにより、属性値の属性種類分の属性のhash bit列を結合した値を用いることで、検索時の負荷とインデクシングの負荷を小さくすることができる。すなわち、積条件の組合せ数に依存しないのでインデクシング負荷等は小さい。また、データ容量を節約できる上、一貫性も確保でき、データ設計時に何をkeyにするかを気にする必要もなく、柔軟な条件検索を実行することができる。   As a result, by using a value obtained by combining the hash bit strings of attributes corresponding to the attribute types of the attribute values, it is possible to reduce the load at the time of searching and the load of indexing. That is, the indexing load is small because it does not depend on the number of combinations of product conditions. In addition, data capacity can be saved, consistency can be ensured, and flexible conditional search can be performed without having to worry about what is key when designing data.

1 クラスタシステム
2 クライアント
11 サーバ
20 入出力手段
30 メモリ手段
40 記憶手段
110 制御手段
111 情報受信手段
112 構文解析手段
113 属性タグ情報格納手段
114 hash bit列作成手段
115 結合手段
116 検索手段
117 情報送信手段
DESCRIPTION OF SYMBOLS 1 Cluster system 2 Client 11 Server 20 Input / output means 30 Memory means 40 Storage means 110 Control means 111 Information reception means 112 Syntax analysis means 113 Attribute tag information storage means 114 Hash bit string creation means 115 Combination means 116 Search means 117 Information transmission means

Claims (6)

KVS(Key Value Store)を用いた分散データベース(DB)において、属性値を検索するためのhash関数を適用し、得られたhash値のhash空間上の位置に該当するサーバに、転置インデックスを格納するクラスタシステム、を構成する各前記サーバとしてのコンピュータを、
インデックス作成時には、
前記属性値を検索するためのhash関数に基づいて、前記属性値の属性種類分の属性のhash bit列を作成するhash bit列作成手段、
前記属性種類分の属性のhash bit列を所定の連結順序で結合する結合手段、として機能させるためのプログラム。
In a distributed database (DB) using KVS (Key Value Store), a hash function for searching attribute values is applied, and the transposed index is stored in the server corresponding to the position in the hash space of the obtained hash value A computer as each of the servers constituting the cluster system,
When creating an index,
A hash bit string creating means for creating a hash bit string of attributes corresponding to the attribute types of the attribute value, based on a hash function for retrieving the attribute value;
A program for causing a hash bit string of attributes corresponding to the attribute types to function as a coupling means for coupling in a predetermined connection order.
前記結合手段は、
前記属性値の属性種類分のすべての属性が少なくとも一回、前記連結順序の先頭に配置して結合すること
を特徴とする請求項1に記載のプログラム。
The coupling means includes
The program according to claim 1, wherein all attributes corresponding to attribute types of the attribute value are arranged and combined at least once at the head of the connection order.
前記結合手段は、
前記属性値の属性種類を登場頻度の高い順に並び替え、並び替えた属性値から算出されたhash 値をbit列として結合すること
を特徴とする請求項1に記載のプログラム。
The coupling means includes
The program according to claim 1, wherein the attribute types of the attribute values are rearranged in descending order of appearance frequency, and hash values calculated from the rearranged attribute values are combined as a bit string.
前記結合手段は、
積条件の組合せ頻度が高い、前記属性値の属性種類のhash 値を上位にしてbit連結すること
を特徴とする請求項1に記載のプログラム。
The coupling means includes
The program according to claim 1, wherein bit concatenation is performed with a hash value of the attribute type of the attribute value having a high combination frequency of product conditions as a higher rank.
前記サーバは、
検索時には、積にされた検索条件の属性を先頭hash bit列にもつインデックスを選択し、該インデックスに対して範囲検索を実行すること
を特徴とする請求項1に記載のプログラム。
The server
2. The program according to claim 1, wherein at the time of searching, an index having the attribute of the searched search condition in the head hash bit string is selected, and a range search is executed on the index.
KVS(Key Value Store)を用いた分散データベース(DB)において、属性値を検索するためのhash関数を適用し、得られたhash値のhash空間上の位置に該当するサーバに、転置インデックスを格納するクラスタシステムであって、
前記サーバは、
インデックス作成時には、
前記属性値を検索するためのhash関数に基づいて、前記属性値の属性種類分の属性のhash bit列を作成するhash bit列作成手段と、
前記属性種類分の属性のhash bit列を所定の連結順序で結合する結合手段と、を備えること
を特徴とするクラスタシステム。
In a distributed database (DB) using KVS (Key Value Store), a hash function for searching attribute values is applied, and the transposed index is stored in the server corresponding to the position in the hash space of the obtained hash value A cluster system that
The server
When creating an index,
A hash bit string creating means for creating a hash bit string of attributes corresponding to the attribute types of the attribute value, based on a hash function for retrieving the attribute value;
A cluster system comprising: coupling means for coupling hash bit strings of attributes corresponding to the attribute types in a predetermined connection order.
JP2015032141A 2015-02-20 2015-02-20 Program and cluster system Active JP6291435B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015032141A JP6291435B2 (en) 2015-02-20 2015-02-20 Program and cluster system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015032141A JP6291435B2 (en) 2015-02-20 2015-02-20 Program and cluster system

Publications (2)

Publication Number Publication Date
JP2016153976A JP2016153976A (en) 2016-08-25
JP6291435B2 true JP6291435B2 (en) 2018-03-14

Family

ID=56761023

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015032141A Active JP6291435B2 (en) 2015-02-20 2015-02-20 Program and cluster system

Country Status (1)

Country Link
JP (1) JP6291435B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI720123B (en) 2016-03-11 2021-03-01 日商日本碍子股份有限公司 Connecting the substrate

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5477139B2 (en) * 2010-04-19 2014-04-23 日本電気株式会社 Information search system, information search method and program
CN103229163B (en) * 2010-12-17 2016-08-10 英派尔科技开发有限公司 Equipment in general calculation entironment finds
JP5597666B2 (en) * 2012-03-26 2014-10-01 株式会社東芝 Semiconductor memory device, information processing system, and control method
US9280570B2 (en) * 2013-03-28 2016-03-08 Avaya Inc. System and method for deletion compactor for large static data in NoSQL database

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI720123B (en) 2016-03-11 2021-03-01 日商日本碍子股份有限公司 Connecting the substrate

Also Published As

Publication number Publication date
JP2016153976A (en) 2016-08-25

Similar Documents

Publication Publication Date Title
Afrati et al. Fuzzy joins using mapreduce
US20190384747A1 (en) System and method for investigating large amounts of data
US9025892B1 (en) Data record compression with progressive and/or selective decomposition
US9805079B2 (en) Executing constant time relational queries against structured and semi-structured data
US8175875B1 (en) Efficient indexing of documents with similar content
JP6119421B2 (en) Database, control unit, method and system for storing encoded triples
KR20130062889A (en) Method and system for data compression
Urbani et al. Scalable RDF data compression with MapReduce
US20140214838A1 (en) Method and system for processing large amounts of data
Siddiqui et al. Pseudo-cache-based IoT small files management framework in HDFS cluster
US11070231B2 (en) Reducing storage of blockchain metadata via dictionary-style compression
CN109271487A (en) A kind of Similar Text analysis method
US10902069B2 (en) Distributed indexing and aggregation
Um et al. Distributed RDF store for efficient searching billions of triples based on Hadoop
Guzun et al. Hybrid query optimization for hard-to-compress bit-vectors
US10990627B1 (en) Sharing character data across lookups to identify matches to a regular expression
WO2017072890A1 (en) Data management system, data management method, and program
JP5194856B2 (en) Efficient indexing using compact decision diagrams
JP6291435B2 (en) Program and cluster system
JP5684671B2 (en) Condition retrieval data storage method, condition retrieval database cluster system, dispatcher, and program
US11036762B1 (en) Compound partition and clustering keys
Fang et al. Towards a Latin-square search engine
CN105426519A (en) Small-scale index data storage method for off-line searching
JP6192171B2 (en) Program and cluster system
Guzun et al. Scalable preference queries for high-dimensional data using map-reduce

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170224

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180126

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20180206

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180209

R150 Certificate of patent or registration of utility model

Ref document number: 6291435

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150