JPS62290925A - Connection processing system - Google Patents

Connection processing system

Info

Publication number
JPS62290925A
JPS62290925A JP61133646A JP13364686A JPS62290925A JP S62290925 A JPS62290925 A JP S62290925A JP 61133646 A JP61133646 A JP 61133646A JP 13364686 A JP13364686 A JP 13364686A JP S62290925 A JPS62290925 A JP S62290925A
Authority
JP
Japan
Prior art keywords
tuple
join
connection
information
tuples
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP61133646A
Other languages
Japanese (ja)
Inventor
Tadashi Osone
匡 大曽根
Akira Yamamoto
彰 山本
Hiroyuki Kitajima
北嶋 弘行
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP61133646A priority Critical patent/JPS62290925A/en
Publication of JPS62290925A publication Critical patent/JPS62290925A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To ensure the fast connection processing by using the connection information of fixed length. CONSTITUTION:The two-split searching is applied to a tuple to be connected to the head tuple T1 of a table 2 over a connection information table where the connection information on a table 1 are sorted in the order of connection columns. Then an edge tuple S1 of a tuple group of the table 1 having the connection column value coincident with the connection column value 6 of the tuple T1 is detected. The connection is secured between both tuples T1 and S1 with reference to the tuple head pointer of the connection information. When this connection processing is over, the connection information table receives successively accesses as S5-S7 to proceed the connection processing. Then the connection processing is through for the tuple T1 since no coincidence is obtained any more with the connection column value of the T1 in the step S9. Then the connection processing proceeds to a tuple T2. This operation is applied to all tuples of the table 2.

Description

【発明の詳細な説明】 3、発明の詳細な説明 〔産業上の利用分野〕 本発明は、データベースにおける結合処理に係り、特に
タプル長やカラム長が可変長であるテーブル間の結合処
理に好適な結合処理方式に関する。
[Detailed Description of the Invention] 3. Detailed Description of the Invention [Field of Industrial Application] The present invention relates to join processing in a database, and is particularly suitable for join processing between tables with variable tuple lengths and column lengths. Regarding the join processing method.

〔従来の技術〕[Conventional technology]

従来の方式は、たとえば1983年のヴイエルデイービ
−(VLDB)’83.第455頁に記載のように基本
的な結合処理方式については述べられているが、タプル
長やカラム長が可変長であるテーブル間の結合処理につ
いては配慮されていなかった。
A conventional method is, for example, VLDB '83. Although a basic join processing method is described as described on page 455, no consideration was given to join processing between tables with variable tuple lengths and column lengths.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

本発明の目的は、タプル長やカラム長が可変長であるテ
ーブル間の結合処理を高速に実行する方式を提供するこ
とにある。
An object of the present invention is to provide a method for quickly performing join processing between tables whose tuple lengths and column lengths are variable.

〔問題点を解決するための手段〕     ゛本発明で
は、タプル長やカラム長が可変長であるテーブル1のタ
プルから、タプルED、結合カラム値あるいは結合カラ
ム値ポインタ、タプル先頭ポインタなどからなる固定長
の結合情報を作成し、それを結合カラム値順にソーティ
ングした結合情報テーブルを導入することにより、タプ
ル長やカラム長が可変長であるテーブル間の結合処理を
高速に実行することを可能にする。
[Means for solving the problem] [In the present invention, from the tuple of table 1 whose tuple length or column length is variable, fixed By creating join information of length and introducing a join information table that sorts it in order of join column values, it is possible to quickly execute join processing between tables with variable tuple lengths and column lengths. .

〔作用〕[Effect]

例えば一つのテーブルの対象タプルと結合すべき他のテ
ーブルのタプルを高速に見つけるために2分探索を用い
るが、そのためには結合すべきテーブルのタプルをソー
ティングしておく必要がある。この際、比較的長いタプ
ルをソーティングするより、比較的短い結合情報をソー
ティングした方がソーティングが高速に行える。また、
タプル長が固定長とされるため結合情報のテーブルを高
速に2分探索することが容易である。
For example, a binary search is used to quickly find a target tuple in one table and a tuple in another table to be joined, but for this purpose it is necessary to sort the tuples in the tables to be joined. At this time, sorting can be performed faster by sorting relatively short combined information than by sorting relatively long tuples. Also,
Since the tuple length is fixed, it is easy to perform a high-speed binary search on the table of join information.

〔発明の実施例〕[Embodiments of the invention]

以下1本発明を実施例により説明する。 The present invention will be explained below with reference to examples.

データベースにおけるテーブル間の結合処理とは、テー
ブル1のタプルの結合カラム値とテーブル2のタプルの
結合カラム値との関係がある結合条件を満足する時、そ
のタプル同士を結合することである。
The join processing between tables in a database is to join tuples together when a join condition that there is a relationship between the join column values of the tuples of table 1 and the join column values of the tuples of table 2 is satisfied.

第1図は、本発明の処理手順の一実施例を示すフローチ
ャートである。これに基づいて動作を説明する。
FIG. 1 is a flowchart showing an embodiment of the processing procedure of the present invention. The operation will be explained based on this.

タプル数の少ない方のテーブルをテーブル1として、テ
ーブル1のタプル毎にタプルID、結合カラム値あるい
は結合カラム値ポインタ、タプル先頭ポインタからなる
結合情報を作成する(ステップ100)、第2図と第3
図に結合情報の構成を示す。第2図は、結合情報をタプ
ルより、L44合カラム値、タプル先頭ポインタから構
成した場合であり、第3図は結合情報をタプルID、結
合カラム値ポインタ、タプル先頭ポインタから構成した
場合である。第2図の場合、結合カラム値が可変長の時
はその最も長いカラム領民に合わせるなどして固定長と
する。これはハードウェアでは可変長のデータの扱いが
困難であ在ため、可変長のデータを固定長にする必要が
ある。第3図は、結合カラム値ポインタを導入して固定
長とする。このようにして固定長の結合情報を作成する
The table with the smaller number of tuples is set as table 1, and join information consisting of a tuple ID, a join column value or a join column value pointer, and a tuple start pointer is created for each tuple in table 1 (step 100), as shown in FIG. 3
The figure shows the structure of the connection information. Figure 2 shows the case where the join information is composed of tuples, L44 combined column values, and tuple head pointers, and Figure 3 shows the case where the join information consists of tuple IDs, join column value pointers, and tuple head pointers. . In the case of FIG. 2, when the combined column value has a variable length, it is set to a fixed length by matching the length of the longest column. Since it is difficult for hardware to handle variable length data, it is necessary to convert variable length data to a fixed length. FIG. 3 introduces a binding column value pointer to have a fixed length. In this way, fixed length combined information is created.

次に、この結合情報を結合カラム値順にソーティングす
る(101)、比較的長いテーブル1のタプルを結合カ
ラム値順にソーティングするよりも比較的短い結合情報
をソーティングした方がソート時間が短かくて済む。
Next, this join information is sorted in order of join column values (101). Sorting relatively short join information takes less time than sorting relatively long tuples of Table 1 in order of join column values. .

次に、テーブル2のタプルを1つとり上げ(102)、
そのタプルと結合すべきテーブル1のタプルを2分探索
により探す(103)。この時、テーブル2の対象タプ
ルと結合すべきテーブル1のタプルが複数個ある時は、
そのタプル群の最端のタプルを探し出すことにする。ま
た、一般に、2分探索をする時には、可変長のタプルを
2分探索するよりも固定長のタプルを2分探索した方が
高速に処理が行える。本発明では固定長の結合情報テー
ブルを導入し、その上を2分探索することにより、これ
を達成することが可能となる。
Next, pick up one tuple from table 2 (102),
A tuple in table 1 to be combined with that tuple is searched for by binary search (103). At this time, if there are multiple tuples of table 1 to be joined with the target tuple of table 2,
Let's find the most extreme tuple in the group of tuples. Furthermore, in general, when performing a binary search, it is faster to perform a binary search on fixed-length tuples than to perform a binary search on variable-length tuples. In the present invention, this can be achieved by introducing a fixed-length join information table and performing a binary search on it.

結合すべきタプルが探し出されたら、テーブル2の対象
タプルとテーブル1のタプルとの結合を行う。この時、
結合情報のタプル先頭ポインタを用いることにより、テ
ーブル1の結合すべきタプルに高速にアクセスすること
ができるので、高速なタプルとタプルの結合処理が可能
となる(104)。
Once the tuples to be joined are found, the target tuples in table 2 and the tuples in table 1 are joined. At this time,
By using the tuple head pointer of the join information, the tuples to be joined in table 1 can be accessed at high speed, so that high-speed tuple-to-tuple joining processing becomes possible (104).

次に、結合情報テーブル上をシークエンシャルに結合情
報を参照し、結合タプルでなくなるまでステップ104
の処理をくり返す(105)。
Next, sequentially refer to the join information on the join information table until it is no longer a join tuple (step 104).
The process is repeated (105).

このようにして、テーブル2の1つの対象タプルに関す
る結合処理が終了したら、次の対象タプルについて上記
の手順をくり返し、テーブル2の全てのタプルについて
処理を終えたら終了する(106と107)。
In this way, when the join process for one target tuple in table 2 is completed, the above procedure is repeated for the next target tuple, and the process ends when the process is completed for all tuples in table 2 (106 and 107).

第4図は、第2図の結合情報を用いた時の結合処理の説
明図である。この例では、テーブル1の結合情報を結合
カラム類にソーティングした結合情報テーブル上を、テ
ーブル2の先頭タプル(T1)と結合されるべきタプル
を2分探索している。そして、T1の結合カラム値(6
)と一致する結合カラム値をもつテーブル1のタプル群
の最端のタプル(Sl)を探し出す。そして、その結合
情報のタプル先頭ポインタを参照して、タプルT1とタ
プルS1の結合処理を行う。これが終了後、結合情報テ
ーブルを35.S6.S7と順次アクセスし、結合処理
を行い、S9で、TIの結合カラム値と一致しなくなる
のでT1の結合処理を終了し、次にT2の結合処理に移
る。これをテーブル2の全タプルについて実行する。
FIG. 4 is an explanatory diagram of a combination process when using the combination information of FIG. 2. In this example, the join information table in which the join information of table 1 is sorted into join columns is searched for a tuple to be joined with the first tuple (T1) of table 2. Then, the combined column value of T1 (6
) is searched for the endmost tuple (Sl) of the group of tuples in table 1 that has a join column value that matches. Then, with reference to the tuple head pointer of the combination information, the tuple T1 and tuple S1 are combined. After this is completed, create the join information table in 35. S6. S7 is sequentially accessed to perform the join process, and in S9, since the value does not match the join column value of TI, the join process of T1 is ended, and then the process moves to the join process of T2. This is executed for all tuples in table 2.

第5図は、第3図の結合情報を用いた時の結合処理の説
明図であり、その動作は第4図の時とほぼ同じである。
FIG. 5 is an explanatory diagram of the combining process when using the combining information of FIG. 3, and the operation is almost the same as that shown in FIG. 4.

以上のように、第2図や第3図に示したような結合情報
テーブルを導入することにより高速な結合処理が可能と
なる。
As described above, by introducing the join information table as shown in FIGS. 2 and 3, high-speed join processing becomes possible.

この際、テーブル1の情報とテーブル1の結合情報テー
ブルは主記憶とコン1−ローラの中のバッファといった
ように別のバッファに存在していてもかまわない。
At this time, the information of table 1 and the joint information table of table 1 may exist in separate buffers such as the main memory and the buffer in the controller 1-roller.

〔発明の効果〕〔Effect of the invention〕

本発明によれば、固定長の結合情報を導入することによ
り高速な結合処理が可能となる。テーブル2の対象タプ
ルと結合すべきテーブル1のタプルを高速に見つけるた
めに2分探索を用いるが。
According to the present invention, high-speed combining processing is possible by introducing fixed-length combining information. Binary search is used to quickly find the tuples in Table 1 that should be combined with the target tuples in Table 2.

そのためにはテーブル1のタプルをソーティングしてお
く必要がある。この際、比較的長いタプルをソーティン
グするより、比較的短い結合情報をソーティングした方
がソーティングが高速に行える。例えばタプル長を20
0 (B) 、結合情報長を10(B)とすると、20
倍高速にソーティングが行える。また、2分探索を行う
際に、タプル長が可変長であると、2分探索を高速に行
−うことか困難である。一方、固定長の結合情報のテー
ブルを2分探索することは容易である。また、結合情報
としてタプル先頭ポインタを付加させたことにより、タ
プルとタプルの実際の結合処理が高速に行える。
To do this, it is necessary to sort the tuples in table 1. At this time, sorting can be performed faster by sorting relatively short combined information than by sorting relatively long tuples. For example, set the tuple length to 20
0 (B), and the combined information length is 10 (B), then 20
Sorting can be done twice as fast. Furthermore, when performing a binary search, if the tuple length is variable, it is difficult to perform the binary search at high speed. On the other hand, it is easy to perform a binary search on a table of fixed-length binding information. Furthermore, by adding the tuple head pointer as the combination information, the actual process of combining tuples can be performed at high speed.

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

第1図は本発明の一実施例を示すフローチャート、第2
図と第3図は結合情報の説明図、第4図と第5図は結合
処理の説明図で豚る。 200・・・結合情報(結合カラム値を用いた場合)。 201・・・結合情報(結合カラム値ポインタを用いた
場合)。
FIG. 1 is a flowchart showing one embodiment of the present invention, and FIG.
3 and 3 are explanatory diagrams of combined information, and FIGS. 4 and 5 are explanatory diagrams of combined processing. 200...Join information (when using a join column value). 201...Join information (when using a join column value pointer).

Claims (1)

【特許請求の範囲】 1、テーブルとテーブルの結合処理を行う際に、結合カ
ラム値に容易にアクセスできる情報とタプルに容易にア
クセスできる情報を含んだ固定長の結合情報を用いるこ
とを特徴とする結合処理方式。 2、結合カラム値に容易にアクセスできる情報のかわり
に、可変長の結合カラム値を固定長にした結合カラム値
を用いた固定長の結合情報を用いることを特徴とする第
1項記載の結合処理方式。
[Claims] 1. When performing table-to-table join processing, fixed-length join information including information that allows easy access to join column values and information that allows easy access to tuples is used. join processing method. 2. The join according to item 1, characterized in that instead of information that allows easy access to the join column value, fixed-length join information is used using a join column value that is a fixed-length join column value from a variable-length join column value. Processing method.
JP61133646A 1986-06-11 1986-06-11 Connection processing system Pending JPS62290925A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP61133646A JPS62290925A (en) 1986-06-11 1986-06-11 Connection processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61133646A JPS62290925A (en) 1986-06-11 1986-06-11 Connection processing system

Publications (1)

Publication Number Publication Date
JPS62290925A true JPS62290925A (en) 1987-12-17

Family

ID=15109670

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61133646A Pending JPS62290925A (en) 1986-06-11 1986-06-11 Connection processing system

Country Status (1)

Country Link
JP (1) JPS62290925A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0293766A (en) * 1988-09-30 1990-04-04 Hitachi Ltd Table coupling system for relational data base

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0293766A (en) * 1988-09-30 1990-04-04 Hitachi Ltd Table coupling system for relational data base

Similar Documents

Publication Publication Date Title
US5842208A (en) High performance recover/build index system by unloading database files in parallel
JPH08255176A (en) Method and system for comparison of table of database
JPH07104871B2 (en) Join processing method in relational database
JPS62290925A (en) Connection processing system
JPH01163826A (en) Coupling processing system for relational data base
JP3620203B2 (en) Database search processing method
JPS59121436A (en) Sorting method of data group
JPS61141035A (en) Data retrieval system
JP3824091B2 (en) Relational database system
JP2673085B2 (en) Relational database join processing method
JPH0675254B2 (en) Kaiko database operation system
JPH01258125A (en) Key sequential retrieving system for record
JPH0452967A (en) And operation processing system for set file
JPH01288920A (en) Data sorting device
JPH0375869A (en) Character string retrieving method
JPS63282836A (en) Information retrieving device
JPH04155521A (en) Sorting processing system
JPH05108719A (en) Information retrieving device
JPH03288967A (en) Data base processing system
JPH01173229A (en) Data base processor
JPH033263B2 (en)
JPH0991268A (en) Totalization device
JPH03223965A (en) Inequality sign condition connection system for related data base system
JPH02136969A (en) Retrieving system for character string
JPH04195588A (en) Back coincidence retrieving processing system for data base