[go: up one dir, main page]

JPS63286931A - Index generating method - Google Patents

Index generating method

Info

Publication number
JPS63286931A
JPS63286931A JP62121364A JP12136487A JPS63286931A JP S63286931 A JPS63286931 A JP S63286931A JP 62121364 A JP62121364 A JP 62121364A JP 12136487 A JP12136487 A JP 12136487A JP S63286931 A JPS63286931 A JP S63286931A
Authority
JP
Japan
Prior art keywords
index
value
attribute
relation
record
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.)
Granted
Application number
JP62121364A
Other languages
Japanese (ja)
Other versions
JPH0658643B2 (en
Inventor
Mitsunori Wada
光教 和田
Shoji Yamashita
祥司 山下
Haruaki Yamazaki
晴明 山崎
Kazue Miyazaki
宮崎 収兄
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.)
National Institute of Advanced Industrial Science and Technology AIST
Original Assignee
Agency of Industrial Science and Technology
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 Agency of Industrial Science and Technology filed Critical Agency of Industrial Science and Technology
Priority to JP62121364A priority Critical patent/JPH0658643B2/en
Publication of JPS63286931A publication Critical patent/JPS63286931A/en
Publication of JPH0658643B2 publication Critical patent/JPH0658643B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To shorten time consumed for the generation processing of an index by performing the OR operation of the index value of a record for the index of a relation to be operated after shifting it by proper number of bits, and obtaining the index concerning the operated result at the tie of the operation. CONSTITUTION:It is assumed that a query to retrieve all taples whose age attribute is 17 and sex distinction attribute is female is issued. For generating a query mask, an age and a sex distinction-binary value conversion procedure is applied to the age (e.g., 17) and the sex distinction (e.g., female), and the binary values 1001 and 10 are obtained. Besides, a person's name attribute is assumed to be 0000 if it is not designated, and these three binary values are shifted by one bit, and the OR operation is executed. Regarding all positions, in which the bits of the query mask 13 obtained by such a way are set, the index records 8, 10, in which all the bits are set at the same bit positions are selected out of the index records 7-12 and the taples 2, 5 are extracted. The extracted contents are checked and the taple 2, the age attribute which is 17 and the sex distinction attribute which is female is extracted and the retrieval is finished.

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は、重ね合せ符号を索引に持つリレーションの間
でタプルの結合に係わる演算(例えば直積演算または結
合演算)を実行する際に、その索引を利用して実行結果
であるリレーションに対して索引を得る索引の作成方式
に関するものである。
Detailed Description of the Invention (Industrial Field of Application) The present invention provides a method for performing an operation (for example, a cartesian product operation or a join operation) related to the combination of tuples between relations having superposition codes as indexes. This invention relates to an index creation method that uses an index to obtain an index for a relation that is an execution result.

(従来の技術) 従来、リレーショナル・データベース・システムにおい
ては、リレーションのタプルの高速な検索を実現するた
めに、各リレーションのキー属性ごとにB”tree等
の索引を用意しておく方法と、ハシュ関数およびハシュ
・テーブルを用意しておく方法とが用いられる。B+t
ree等の索引を用いた検索では、検索要求で指定され
た属性についての索引をなぞっていきやがて要求を満足
するタプルを得る。一方、ハシュ関数およびハシゴ・テ
ーブルを用いた検索は、検索要求で指定された属性値に
ハシュ関数を施した結果をもとにハシゴ・テーブルを検
索し要求を満足するタプルの候補を得るという手法であ
る。B”tree等の索引またはハシュ関数およびハシ
ゴ・テーブルを用いた検索手段を有する2つのりレーシ
ョンの間で直積演算を実行し、その実行結果であるリレ
ーションに対しても検索手段が必要となる場合には、実
行結果のタプルを吟味して、キーとなる属性についての
索引レコードを作成するか、もしくはハシュ値を計算す
るという処理を結果リレーションの全タプルについて実
行し、索引やハシゴ・テーブルを作成していた。
(Prior Art) Conventionally, in relational database systems, in order to achieve high-speed searches of relation tuples, there have been two methods: preparing an index such as a B"tree for each key attribute of each relation, and a hashing method. A method of preparing a function and a hash table is used.B+t
In a search using an index such as ree, the index for the attribute specified in the search request is traced, and eventually a tuple that satisfies the request is obtained. On the other hand, a search using a hash function and a ladder table is a method in which the ladder table is searched based on the result of applying a hash function to the attribute value specified in the search request to obtain candidate tuples that satisfy the request. It is. When a direct product operation is executed between two relations that has a search means using an index such as B"tree or a hash function and a ladder table, and a search means is also required for the relation that is the execution result. examines the tuples resulting from the execution and creates an index record for the key attribute, or calculates the hash value for all tuples in the result relation to create an index or ladder table. was.

(発明が解決しようとする問題点) しかし以上の方法では、直積演算の結果となるリレーシ
ョンのキー属性についての索引やハシゴ・テーブルは全
て新たに作成する必要があり、演算を適用されるリレー
ションが予め有していた索引やハシゴ・テーブルは全く
利用されていない。
(Problem to be solved by the invention) However, in the above method, it is necessary to create all new indexes and ladder tables for the key attributes of the relation that is the result of the Cartesian product operation, and the relation to which the operation is applied must be created. Pre-existing indexes and ladder tables are not used at all.

実用に供されるリレーシミ1ンでは数百〜数万件のタプ
ルを有しており、1リレーシヨンの各キー属性について
の索引やハシゴ・テーブルを全て新たに作成するとなる
と膨大な時間を費やすこととなる。
A relay system used in practical use has hundreds to tens of thousands of tuples, and it would take an enormous amount of time to create all new indexes, ladder tables, and tables for each key attribute of a single relation. becomes.

このように直積演算の結果となるリレーションに対し全
て新たに索引を作ろうとすると、システムはその索引や
ハシゴ・テーブルの作成にかかりきりとなり、システム
全体としての処理速度が著しく低下する欠点があった。
If an attempt was made to create all new indexes for the relations that result from the Cartesian product operation, the system would be forced to create the indexes and ladder tables, which had the disadvantage of significantly slowing down the processing speed of the system as a whole. .

本発明はこのような従来技術の欠点を解消するためにな
されたものであって、リレーションのタプルを高速に検
索できる索引を有するリレーションの間で直積演算等を
実行する際に結果リレーションに対する索引を作成する
処理に消費される時間を短縮する索引の作成方式を提供
することを目的とする。
The present invention has been made in order to eliminate such drawbacks of the prior art, and it is possible to use an index for a resultant relation when performing a direct product operation, etc. between relations that have an index that can quickly search for tuples of relations. The purpose of the present invention is to provide an index creation method that reduces the time consumed in index creation processing.

(問題点を解決するための手段) 本発明は、2つの索引付リレーションに演算を施して得
られた結果リレーションについての索引を作成する方式
を対象とし、前記従来技術の問題点を解決するため、被
演算リレーションの属性の種類に応じて属性値を予め指
定された長さの2進値に変換する変換手段と、ファイル
の各レコードについて前記変換手段によりレコード中の
各属性値について得た2進値の最上位ビットもしくは最
下位ビットについて一定のビット数だけずらしてビット
ごとにオア演算するオア演算手段を設け、該オア演算手
段により得た2進値を索引値としたものと、その値を生
成したレコードを指定するポインタとを対としたものを
そのレコードについての索引用レコードとして構成し、
演算時に被演算リレーションの索引用レコードの索引値
を適切なビット数だけずらしてオア演算を行って演算結
果についての索引を得るようにしたもめである。
(Means for Solving the Problems) The present invention is directed to a method of creating an index for a resultant relation obtained by performing an operation on two indexed relations, and aims to solve the problems of the prior art. , a conversion means for converting an attribute value into a binary value of a predetermined length according to the type of attribute of the operand relation; An OR operation means is provided for performing an OR operation on a bit-by-bit basis by shifting the most significant bit or the least significant bit of a decimal value by a certain number of bits, and the binary value obtained by the OR operation means is used as an index value, and its value. and a pointer that specifies the record that generated it, and configure it as an index record for that record,
This is a dispute in which the index value of the index record of the operand relation is shifted by an appropriate number of bits during the operation, and an OR operation is performed to obtain an index for the result of the operation.

(作 用) 本発明はりレーションに対して索引を与え、そのタプル
を高速に検索できると共に、このような索引を有するリ
レーションの間での直積演算等を実行する際に演算を適
用したりレーションの索引を用いて演算の実行結果とな
るリレーションについての索引を容易に得るものである
(Function) The present invention can provide an index to a relation and search its tuples at high speed, and can also apply operations when performing a direct product operation, etc. between relations having such an index, and Using an index, it is possible to easily obtain an index for a relation that is the result of an operation.

索引を作成するために、属性の種類に応じて属性値をp
め指定された長さの2進値に変換する手続きを用意して
おく。この手続きは変換手段が遂行する。索引を作成す
るには、先ずリレーション中のタプルの各キー属性につ
いて前記変換手段による変換手続きを属性の種類に応じ
て適用し2進値を得る。次にオア演算手段により、1つ
のタプルの全てのキー属性について得た2進値を、その
タプルの属性の順番と対応づけて一定のビットずつずら
してビットごとにオア演算した結果前た2進値(以下、
重ね合せ符号と呼ぶ)を索引値とする。そして索引値と
その値を生成したタプルを指定するポインタとを対とし
てそのタプルについての索引レコードとする。リレーシ
ョンのすべてのタプルに対して用意した索引レコードの
集りがそのリレーションに対する索引となる。
To create an index, attribute values are p
Prepare a procedure to convert the data into a binary value of the specified length. This procedure is performed by the conversion means. To create an index, first, the conversion procedure by the conversion means is applied to each key attribute of the tuples in the relation according to the type of attribute to obtain a binary value. Next, using the OR operation means, the binary values obtained for all key attributes of one tuple are shifted by a certain bit in correspondence with the order of the attributes of that tuple, and the OR operation is performed for each bit. value (hereinafter,
(referred to as a superposition code) is used as an index value. Then, the index value and the pointer specifying the tuple that generated the value are paired to form an index record for that tuple. A collection of index records prepared for all tuples of a relation becomes the index for that relation.

この索引を用いて、1つ以上の属性値についてANDの
条件で指定してその値を持つタプルをすベて検索するに
は、索引を作成する際に用いた変換手続きと同一の手続
きを用いて指定された属性の値を2進値に変換し、指定
されていない属性についてはすべてのビットがリセット
されている2進値を作成し、索引での2進値のオア演算
と対応させて、対応する属性の順番を同一とし、同一の
ビット数だけずらして2進値のビットごとにオア演算を
とり、この結果において、セットされているビット位置
と同じビット位置かセットされている索引レコードに対
応するタプルはすべて抽出すると条件を満足するタプル
はすべてここに含まれており、このタプルを吟味するこ
とで条件を満たすタプルだけを検索できる。
To use this index to search for all tuples that have one or more attribute values by specifying an AND condition, use the same conversion procedure that was used to create the index. Converts the value of the specified attribute to a binary value, creates a binary value with all bits reset for unspecified attributes, and corresponds to the OR operation of the binary value in the index , with the corresponding attributes in the same order and shifted by the same number of bits, OR operation is performed on each bit of the binary value, and in this result, the index record that is set at the same bit position as the set bit position is When all the tuples corresponding to are extracted, all the tuples that satisfy the condition are included here, and by examining these tuples, it is possible to search for only the tuples that satisfy the condition.

この索引を持つ2つのりレーションの間で直積演算を行
い、その結果に対して索引を与えるために、演算におい
てタプルの組み合せを作成する際に、対応する索引レコ
ード値どうしでの組み合せも作成し、直積演算の結果か
ら上記の手順によって索引値を作成した場合と同一な2
進値が作成できるように索引値の組み合せを各々を少し
ずらしてオア演算を行うことにより11#た2進値を対
応するタプルについての索引値とし、その索引値と対応
するタプルへのポインタを対として索引レコードか作成
できる。
In order to perform a Cartesian product operation between two relations with this index and provide an index to the result, when creating a combination of tuples in the operation, a combination of corresponding index record values is also created, 2, which is the same as when creating an index value using the above procedure from the result of the Cartesian product operation.
By slightly shifting the combination of index values and performing an OR operation so that a binary value can be created, the binary value obtained by 11# is used as the index value for the corresponding tuple, and the index value and the pointer to the corresponding tuple are You can create index records as pairs.

(実/ih例) 以下、本発明の一実施例を図面を参照して詳細に説明す
る。
(Actual/Ih Example) Hereinafter, one embodiment of the present invention will be described in detail with reference to the drawings.

第1図は本発明によるリレーションの索引を作成する手
順の一例を示したものである。人物リレーションは「人
名」属性および「年齢」属性および「性別」属性から構
成され、6つのタプル1゜2.3,4,5.6を持つ。
FIG. 1 shows an example of a procedure for creating a relation index according to the present invention. The person relation is composed of a "person name" attribute, an "age" attribute, and a "gender" attribute, and has six tuples 1°2.3, 4, and 5.6.

「人名−2進値変換手続き」では「人名」属性を、「年
齢−2進値変換下続き」では「年齢」属性を共に4ビツ
ト長の2進値に、「性別−2進値変換手続き」では「性
別」属性を2ビツト長の2進値に変換する。タプル1の
「人名」属性は人名−2進値変換毛続きにより2進値“
0100”に変換され、「年齢」属性は年齢−2進値変
換手続きにより2進値“001O”に変換され、「性別
」属性は性別−2進値変換手続きにより2進値“01”
に変換され、この3つの2進値を1ビツトずらしてオア
演算を施した結果“01010”がタプル1に対する索
引レコード7の索引値となる。同様にタプル2の「人名
」属性は2進値“1100”に変換され、「年齢」属性
は2進値“1001”に変換され、「性別」属性は2進
値“10”に変換され、この3つの2進値にオア演算を
施した結果“11101”がタプル2に対する索引レコ
ード8の索引値となる。更に、2進値“10110”が
タプル3に対する索引レコード9の索引値、2進値“1
0011”がタプル4に対する索引レコードlOの索引
値、2進値“Of 101”がタプル5に対する索引レ
コード11の索引値、2進値“01110”がタプル6
に対する索引レコード12の索引値となる。また、索引
レコード7はタプル1を、索引レコード8はタプル2を
、索引レコード9はタプル3を、索引レコード10はタ
プル4を、索引レコード11はタプル5を索引レコード
12はタプル6をそれぞれポインタによって指しており
、索引レコードからタプルをアクセスすることができる
ようになっている。
``Person name - binary value conversion procedure'' converts the ``person name'' attribute into a 4-bit binary value, and ``Age - binary value conversion procedure'' converts the ``age'' attribute into a 4-bit binary value. ” converts the “gender” attribute into a 2-bit binary value. The "person name" attribute of tuple 1 is a binary value "
0100”, the “age” attribute is converted to the binary value “001O” by the age-binary value conversion procedure, and the “gender” attribute is converted to the binary value “01” by the gender-binary value conversion procedure.
After shifting these three binary values by 1 bit and performing an OR operation, "01010" becomes the index value of index record 7 for tuple 1. Similarly, the "person name" attribute of tuple 2 is converted to the binary value "1100", the "age" attribute is converted to the binary value "1001", the "gender" attribute is converted to the binary value "10", As a result of performing an OR operation on these three binary values, "11101" becomes the index value of index record 8 for tuple 2. Furthermore, the binary value “10110” is the index value of index record 9 for tuple 3, and the binary value “1”
0011" is the index value of index record lO for tuple 4, the binary value "Of 101" is the index value of index record 11 for tuple 5, and the binary value "01110" is the index value of index record 11 for tuple 6.
This becomes the index value of index record 12 for . Also, index record 7 points to tuple 1, index record 8 points to tuple 2, index record 9 points to tuple 3, index record 10 points to tuple 4, index record 11 points to tuple 5, and index record 12 points to tuple 6. , and the tuple can be accessed from the index record.

第2図は本発明による索引を用いた検索を第1図に基づ
いて実行した例を示す。人物リレーションのうちで「年
齢」属性が“17’でありかつ「性別」属性が°女性′
であるタプルをすべて検索するキュエリが出されたもの
とする。キュエリマスクを生成するために「年齢」属性
に対しては年齢−2進値変換手続きを適用し2進値“1
001”を得、「性別」属性に対しては性別−2進値変
換手続きを適用し2進値“lO”を得、「人名」属性は
指定されていないため2進値“0000”とし、これら
の2進値を索引を作成した際と同じ順番で配置し同じビ
ット数だけずらしてオア演算を行う。このようにして得
られたキュエリマスク13において、ビットがセットさ
れている位置すべてについて、索引レコード7〜12中
から同一のビット位置についてすべてのビットがセット
されている索引レコード8.11を選び出し、その索引
レコードが指すタプル2.5を抽出する。抽出したタプ
ル2.5の内容を調べ、「年齢」属性が°17’で「性
別」属性が゛女性。
FIG. 2 shows an example in which a search using the index according to the present invention is executed based on FIG. In the person relation, the “age” attribute is “17” and the “gender” attribute is °female’
Suppose that a query is issued that searches for all tuples with . To generate the Query mask, the age-to-binary value conversion procedure is applied to the “age” attribute, and the binary value “1” is
001" is obtained, and the gender-binary value conversion procedure is applied to the "gender" attribute to obtain the binary value "lO". Since the "person name" attribute is not specified, the binary value is "0000". These binary values are arranged in the same order as when the index was created, shifted by the same number of bits, and an OR operation is performed. In the query mask 13 obtained in this way, index records 8.11 in which all bits are set in the same bit position are selected from index records 7 to 12 for all positions in which bits are set, and Extract tuple 2.5 pointed to by the index record. Examining the contents of the extracted tuple 2.5, we find that the "age" attribute is °17' and the "gender" attribute is "female."

であるタプル2を取り出すことで検索は終了する。The search ends by retrieving tuple 2, which is .

第3図に本発明による直積演算の実行結果についての索
引の作成例を示す。リレーション「人物1」とす°レー
ション「人物2」との間で直積演算を実行した結果とし
てリレーション「人物3」が作成される。リレーション
「人物1」は「人名」属性および「性別」属性および「
血液型」属性とから構成されており、このリレーション
に対しては重ね合せ符号を用いた索引として「インデク
ス1」が与えらている。「インデクス1」の各索引値は
対応するタプルの各属性値についてハシュを施して得た
2進値を最上位ビットについて1ビツトずつずらしてオ
ア演算をとったものである。リレーション「人物2」は
「人名」属性および「年齢」属性とから構成されており
、このリレーションに対しては重ね合せ符号を用いた索
引として「インデクス2」が与えられている。「インデ
クス2」の各索引値は対応するタプルの外属性値につい
てハシュを施して得た2進値を最−L位ビットについて
1ビツトずつずらしてオア演算をとったものである。リ
レーション「人物3」は「人物1」と「人物2」の直積
演算の結果であるから、2つの「人名」属性および「年
齢」属性および「性別」属性および「血液型」属性とか
ら構成されており、このリレーションに対しての索引「
インデクス3」は先の「インデクス1」および「インデ
クス2」の内容を利用して作成されたものである。「人
物1」と「人物2」との間で直積演算を実行すると「人
物1」のタプルtl、t2と「人物2」のタプルt3〜
t5を結合させたタプルt6〜tllを作る。この際、
t2とt3を結合させた結果としてt9を得たものとす
る。ここで、t2に対応する索引レコード12の索引値
は、各属性値にハシュを施した結果得た2進値″01”
、“t oooo”、 ”01001”について、左端
を先頭として1ビツトずつずらしてオア演算した結果得
た2進値“010110”である。さらに、t3に対応
する索引レコードi3の索引値は、各属性値にハシュを
施した結果得た2進値“01001”、00011″に
ついて、左端を先頭として1ビツトずつずらしてオア演
算した結果得た2進値“010011”である。
FIG. 3 shows an example of creating an index for the execution results of the Cartesian product operation according to the present invention. A relation "Person 3" is created as a result of performing a direct product operation between the relation "Person 1" and the relation "Person 2". The relation “Person 1” has the “Person name” attribute, “Gender” attribute, and “
"Blood type" attribute, and "Index 1" is given to this relation as an index using a superposition code. Each index value of "Index 1" is obtained by hashing each attribute value of the corresponding tuple, shifting the binary value by one bit, and performing an OR operation on the most significant bit. The relation "Person 2" is composed of the "Person Name" attribute and the "Age" attribute, and "Index 2" is given to this relation as an index using a superimposition code. Each index value of "Index 2" is obtained by performing an OR operation on a binary value obtained by hashing the external attribute value of the corresponding tuple by shifting the -L-most bit by one bit. Since the relation "Person 3" is the result of the direct product operation of "Person 1" and "Person 2", it is composed of two "Person name" attributes, "Age" attributes, "Gender" attributes, and "Blood type" attributes. and the index for this relation is '
``Index 3'' is created using the contents of ``Index 1'' and ``Index 2''. When performing a direct product operation between "Person 1" and "Person 2", the tuple tl of "Person 1", t2 and tuple t3 of "Person 2"
Create tuples t6 to tll that combine t5. On this occasion,
Assume that t9 is obtained as a result of combining t2 and t3. Here, the index value of the index record 12 corresponding to t2 is the binary value "01" obtained as a result of hashing each attribute value.
, "toooo", and "01001", the binary value "010110" is obtained as a result of performing an OR operation by shifting one bit at a time starting from the left end. Furthermore, the index value of index record i3 corresponding to t3 is obtained by performing an OR operation on the binary values “01001” and 00011″ obtained as a result of hashing each attribute value, by shifting the left end by 1 bit. The binary value is "010011".

タプルを結合させる際に各タプルを指す索引レコードの
索引値を取り出し、最上位ビットについて適切なビット
数だけずらしてオア演算を行う。
When tuples are combined, the index value of the index record pointing to each tuple is taken out, the most significant bit is shifted by an appropriate number of bits, and an OR operation is performed.

これにより結合後のタプルから索引値を生成した場合と
等価な索引値を生成できる。つまり、t2の索引レコー
ド12の索引値“010110″とt3の索引レコード
i3の索引値″otootl”について、12の索引値
を13の索引値よりも左にもってきたならば各々の左端
のビットを先頭として3ビツトずらして、オア演“算し
た結果の索引レコード19の値は“010110011
”であり、t9に変換手続きを施して生成した索引値1
9°と同一の値となる。
This makes it possible to generate an index value that is equivalent to the case where the index value is generated from the tuples after the combination. In other words, for the index value "010110" of index record 12 of t2 and the index value "otootl" of index record i3 of t3, if the index value of 12 is brought to the left of the index value of 13, the leftmost bit of each The value of index record 19 as a result of the OR operation by shifting 3 bits at the beginning is "010110011".
”, and the index value 1 generated by applying the conversion procedure to t9
The value is the same as 9°.

第4図に本発明による結合演算の実行結果についての索
引の作成23例を示す。リレーション[人物1」は「人
名」属性および「性別」属性および「血液型」属性とか
ら構成されており、このリレーションに対しては重ね合
せ符号を用いた索引として「インデクス1」が与えられ
ている。「インデクス1」の各索引値は対応するタプル
の各属性値についてハシュを施して得た2進値を最上位
ビットについて1ビツトずつずらしてオア演算をとった
ものである。リレーション「人物2」は「人名」属性お
よび「年齢」属性とから構成されており、このリレーシ
ョンに対しては重ね合せ符号を用いた索引として「イン
デクス2」が与えられている。「インデクス2」の各索
引値は対応するタプルの各属性値についてハシュを施し
て得た2進値を最上位ビットについて1ビツトずつずら
してオア演算をとったものである。リレーション「人物
1」とりレーション「人物2」との間で「人名」属性が
等しいことを条件として結合演算を実行すると結果とし
てリレーション「人物3」が作成される。リレーション
「人物3」は「人物1」と「人物2」の結合演算の結果
であるから、2つの「人名」属性および「年齢」属性お
よび「性別」属性および「血液型」属性とから構成され
ており、このリレーションに対しての索引「インデクス
3」は先の「インデクス1」および「インデクス2」の
内容を利用して作成されたものである。「人物1」と「
人物2」との間で結合演算を実行することにより「人物
1」のタプルt1゜tlと「人物2」のタプルt3〜t
5を結合させたタプルt6、tlを作る。この際、tl
とt3を結合させた結果としてt6を得たものとする。
FIG. 4 shows 23 examples of index creation for the execution results of join operations according to the present invention. The relation [Person 1] is composed of the attributes ``Person Name'', ``Gender'', and ``Blood Type'', and ``Index 1'' is given to this relation as an index using a superposition code. There is. Each index value of "Index 1" is obtained by hashing each attribute value of the corresponding tuple, shifting the binary value by one bit, and performing an OR operation on the most significant bit. The relation "Person 2" is composed of the "Person Name" attribute and the "Age" attribute, and "Index 2" is given to this relation as an index using a superimposition code. Each index value of "Index 2" is a binary value obtained by hashing each attribute value of the corresponding tuple, shifting the most significant bit by one bit, and performing an OR operation. When a join operation is performed between the relation "Person 1" and the relation "Person 2" on the condition that the "person name" attribute is the same, the relation "Person 3" is created as a result. Since the relation "Person 3" is the result of the join operation of "Person 1" and "Person 2", it is composed of two "Person name" attributes, "Age" attributes, "Gender" attributes, and "Blood type" attributes. The index "Index 3" for this relation is created using the contents of the previous "Index 1" and "Index 2". “Person 1” and “
By performing a join operation between "Person 2", the tuple t1゜tl of "Person 1" and the tuples t3 to t of "Person 2" are created.
Create tuples t6 and tl that combine 5. At this time, tl
Assume that t6 is obtained as a result of combining and t3.

ここで、tlに対応する索引レコード12の索引値“o
totto”は各属性値にハシュを施して得た2進値“
01”、”10000”、′01001”について、左
端を先頭として1ビツトずつずらしてオア演算した結果
である。さらに、t3に対応する索引レコードi3の索
引値“010011”は各属性値にハシュを施して得た
2進値“01001”、“00011”について、左端
を先頭として1ビツトずつずらしてオア演算した結果で
ある。タプルを結合させる際に各タプルを指1−索引レ
コー[・の索引値を取り出し、最り位ビットについて適
切なビット数だけずらしてオア演算を行う。こねにより
結合後のタプルから索引値を生成した場合と等価な索引
値を生成できる。つまり、tlの索引レコード12の索
引値“010110”とt3の索引レコードi3の索引
値“010011”について、12の索引値をi3の索
引値よりも左にもってきたならば各々の左端のビットを
先頭として3ビツトずらして、オア演算した結果の索引
レコードi6の値は“010110011”であり、t
6に変換手続きを施して生成した索引値i6゛ と同一
の値となる。
Here, the index value “o” of the index record 12 corresponding to tl
totto” is a binary value obtained by hashing each attribute value.
This is the result of performing an OR operation on ``01'', ``10000'', and ``01001'' by shifting them one bit at a time, starting from the left end. Furthermore, the index value "010011" of index record i3 corresponding to t3 is obtained by performing an OR operation on the binary values "01001" and "00011" obtained by hashing each attribute value, by shifting the left end by 1 bit. This is the result. When tuples are combined, the index value of finger 1 - index record [. By kneading, it is possible to generate an index value that is equivalent to the case where the index value is generated from the tuples after the combination. In other words, for the index value "010110" of index record 12 of tl and the index value "010011" of index record i3 of t3, if the index value of 12 is brought to the left of the index value of i3, the leftmost bit of each The value of index record i6 as a result of the OR operation with a shift of 3 bits at the beginning is "010110011", and t
This value is the same as the index value i6' generated by applying the conversion procedure to 6.

(発明の効果) 以上、詳細に説明したように本発明によれば、多数のタ
プルを有するリレーションにおいて、複数個の属性につ
いてANDをとったものを条件として検索を実行する際
に、条件を満足するすべてのタプルを高速に検索するこ
とが可能となる。更に、重ね合せ符号を用いた索引を有
するリレーションの間で直積演算または結合演算を実行
した結果に対して、演算の実行に伴って演算を適用した
りレーションの索引を利用して、重ね合せ符号を用いた
索引を作成することができる。従って、他の索引を仔す
るリレーション間で演算を実行し′た結果に対して索引
を与えるために、実行結果の内容を吟味して索引を作成
する方式に比べ、本発明による方式では既存の索引にき
わめて簡mな演算を施して作成するために索引の作成時
間が遥かに短時間ですむ。
(Effects of the Invention) As described above in detail, according to the present invention, in a relation having a large number of tuples, when performing a search using an AND of multiple attributes as a condition, the condition is satisfied. This makes it possible to quickly search all tuples for which Furthermore, to the result of performing a direct product operation or a join operation between relations that have indexes using superposition codes, we can apply operations as the operation is performed or use the index of the ration to obtain superposition codes. It is possible to create an index using . Therefore, compared to a method in which an index is created by carefully examining the contents of the execution result in order to provide an index for the result of executing an operation between relations that have other indexes, the method according to the present invention is more effective than the existing method. Since the index is created by performing very simple calculations, the time required to create the index is much shorter.

【図面の簡単な説明】[Brief explanation of drawings]

第1図は本発明による索引の作成方法の説明図、第2図
は本発明による索引を用いた検索の説明図、第3図は直
積演算の実行結果についての索引の作成例を示す図、第
4図は結合演算の実行結果についての索引の作成例を示
す図である。 1〜6.t1〜t 11−・・タプル 7〜12.il〜ill・・・索引レコード13−・・
キュエリマスク
FIG. 1 is an explanatory diagram of a method for creating an index according to the present invention, FIG. 2 is an explanatory diagram of a search using an index according to the present invention, and FIG. 3 is a diagram illustrating an example of creating an index for the execution result of a Cartesian product operation. FIG. 4 is a diagram showing an example of creating an index for the execution result of a join operation. 1-6. t1-t11-...Tuples 7-12. ill~ill...index record 13-...
cueri mask

Claims (1)

【特許請求の範囲】 2つの索引付リレーションに演算を施して得られた結果
リレーションについての索引を作成する方式において、 被演算リレーションの属性の種類に応じて属性値を予め
指定された長さの2進値に変換する変換手段と、 ファイルの各レコードについて前記変換手段によりレコ
ード中の各属性値について得た2進値の最上位ビットも
しくは最下位ビットについて一定のビット数だけずらし
てビットごとにオア演算するオア演算手段を設け、 該オア演算手段により得た2進値を索引値としたものと
、その値を生成したレコードを指定するポインタとを対
としたものをそのレコードについての索引用レコードと
して構成し、 演算時に被演算リレーションの索引用レコードの索引値
を適切なビット数だけずらしてオア演算を行って演算結
果についての索引を得ることを特徴とする索引の作成方
式。
[Claims] In a method of creating an index for a resultant relation obtained by performing an operation on two indexed relations, the attribute value is set to a predetermined length according to the type of attribute of the operated relation. a conversion means for converting each record of the file into a binary value; An OR operation means for performing an OR operation is provided, and a binary value obtained by the OR operation means is used as an index value, and a pair of a pointer specifying the record that generated that value is used as an index value for that record. An index creation method characterized by configuring the index as a record, shifting the index value of the index record of the operand relation by an appropriate number of bits during operation, and performing an OR operation to obtain an index for the operation result.
JP62121364A 1987-05-20 1987-05-20 How to create an index Expired - Lifetime JPH0658643B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62121364A JPH0658643B2 (en) 1987-05-20 1987-05-20 How to create an index

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62121364A JPH0658643B2 (en) 1987-05-20 1987-05-20 How to create an index

Publications (2)

Publication Number Publication Date
JPS63286931A true JPS63286931A (en) 1988-11-24
JPH0658643B2 JPH0658643B2 (en) 1994-08-03

Family

ID=14809417

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62121364A Expired - Lifetime JPH0658643B2 (en) 1987-05-20 1987-05-20 How to create an index

Country Status (1)

Country Link
JP (1) JPH0658643B2 (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6449627B1 (en) 2000-01-21 2002-09-10 International Business Machines Corp. Volume management method and system for a compilation of content
US6611840B1 (en) 2000-01-21 2003-08-26 International Business Machines Corporation Method and system for removing content entity object in a hierarchically structured content object stored in a database
US6839701B1 (en) 2000-01-21 2005-01-04 International Business Machines Hitmask for querying hierarchically related content entities
US6986102B1 (en) 2000-01-21 2006-01-10 International Business Machines Corporation Method and configurable model for storing hierarchical data in a non-hierarchical data repository
US7043488B1 (en) 2000-01-21 2006-05-09 International Business Machines Corporation Method and system for storing hierarchical content objects in a data repository
US7076494B1 (en) 2000-01-21 2006-07-11 International Business Machines Corporation Providing a functional layer for facilitating creation and manipulation of compilations of content
US7089239B1 (en) 2000-01-21 2006-08-08 International Business Machines Corporation Method and system for preventing mutually exclusive content entities stored in a data repository to be included in the same compilation of content
US7340481B1 (en) 2000-01-21 2008-03-04 International Business Machines Corp. Method and system for adding user-provided content to a content object stored in a data repository
US7346844B1 (en) 2000-01-21 2008-03-18 International Business Machines, Corporation Method and system for moving content in a content object stored in a data repository
US7356766B1 (en) 2000-01-21 2008-04-08 International Business Machines Corp. Method and system for adding content to a content object stored in a data repository
US7401097B1 (en) 2000-01-21 2008-07-15 International Business Machines Corporation System and method for creating compilations of content
WO2014109109A1 (en) * 2013-01-11 2014-07-17 日本電気株式会社 Index key generating device and index key generating method and search method
US9003282B2 (en) 2000-01-21 2015-04-07 International Business Machines Corporation Method and system for managing volumes within a compilation of content

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
IEEE COMPUTER=1987 *

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7346844B1 (en) 2000-01-21 2008-03-18 International Business Machines, Corporation Method and system for moving content in a content object stored in a data repository
US7356766B1 (en) 2000-01-21 2008-04-08 International Business Machines Corp. Method and system for adding content to a content object stored in a data repository
US6839701B1 (en) 2000-01-21 2005-01-04 International Business Machines Hitmask for querying hierarchically related content entities
US6986102B1 (en) 2000-01-21 2006-01-10 International Business Machines Corporation Method and configurable model for storing hierarchical data in a non-hierarchical data repository
US7043488B1 (en) 2000-01-21 2006-05-09 International Business Machines Corporation Method and system for storing hierarchical content objects in a data repository
US7076494B1 (en) 2000-01-21 2006-07-11 International Business Machines Corporation Providing a functional layer for facilitating creation and manipulation of compilations of content
US6611840B1 (en) 2000-01-21 2003-08-26 International Business Machines Corporation Method and system for removing content entity object in a hierarchically structured content object stored in a database
US7089239B1 (en) 2000-01-21 2006-08-08 International Business Machines Corporation Method and system for preventing mutually exclusive content entities stored in a data repository to be included in the same compilation of content
US6449627B1 (en) 2000-01-21 2002-09-10 International Business Machines Corp. Volume management method and system for a compilation of content
US7340481B1 (en) 2000-01-21 2008-03-04 International Business Machines Corp. Method and system for adding user-provided content to a content object stored in a data repository
US7401097B1 (en) 2000-01-21 2008-07-15 International Business Machines Corporation System and method for creating compilations of content
US7895243B1 (en) 2000-01-21 2011-02-22 International Business Machines Corporation Method and system for moving content in a content object stored in a data repository
US9003282B2 (en) 2000-01-21 2015-04-07 International Business Machines Corporation Method and system for managing volumes within a compilation of content
WO2014109109A1 (en) * 2013-01-11 2014-07-17 日本電気株式会社 Index key generating device and index key generating method and search method
JPWO2014109109A1 (en) * 2013-01-11 2017-01-19 日本電気株式会社 Index key generation device, index key generation method, and search method
US10496624B2 (en) 2013-01-11 2019-12-03 Nec Corporation Index key generating device, index key generating method, and search method

Also Published As

Publication number Publication date
JPH0658643B2 (en) 1994-08-03

Similar Documents

Publication Publication Date Title
US10606834B2 (en) Methods and apparatus of shared expression evaluation across RDBMS and storage layer
US7657570B2 (en) Optimizing aggregate processing
JPS63286931A (en) Index generating method
JPH04213765A (en) How to join tables in relational database systems
JP3914662B2 (en) Database processing method and apparatus, and medium storing the processing program
US20200226130A1 (en) Vertical union of feature-based datasets
TW202004526A (en) Method and device for establishing index based on mobile terminal NoSQL database
Elamparithi et al. A review on database migration strategies, techniques and tools
Slavov et al. Fast processing of SPARQL queries on RDF quadruples
WO2024082881A2 (en) Database query method and apparatus
JPH08235033A (en) Joint arithmetic system for object-oriented data base management system
JPH0658644B2 (en) Natural combination processing unit
Gillenson Physical design equivalencies in database conversion
Russo et al. VEBO: Validation of ER diagrams through ontologies and WordNet
TWI405089B (en) Method for creating index in database, computer system thereof, and computer program product thereof
US5819277A (en) Method for generating SQL commands to create an integrated global schema
Lin et al. Querying Templatized Document Collections with Large Language Models
JPH0644309A (en) Data base managing system
US11880362B2 (en) Generating debugging information for query plan steps
Kuo et al. Partitioning and scheduling of asynchronous pipelines
Danubianu et al. Mining association rules inside a relational database–a case study
Ivanov et al. Improving SQL Query Readability Through Refactoring
Papadakis et al. Navigational queries as property path queries employing the kleene star operator
JPH03108063A (en) System and method for retrieving backward coincidence
CN115033572A (en) Method and device for automatic index recommendation

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term