JPS61170840A - Join processing system by partial convolution joining method - Google Patents

Join processing system by partial convolution joining method

Info

Publication number
JPS61170840A
JPS61170840A JP60012159A JP1215985A JPS61170840A JP S61170840 A JPS61170840 A JP S61170840A JP 60012159 A JP60012159 A JP 60012159A JP 1215985 A JP1215985 A JP 1215985A JP S61170840 A JPS61170840 A JP S61170840A
Authority
JP
Japan
Prior art keywords
join
data
column
columns
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.)
Granted
Application number
JP60012159A
Other languages
Japanese (ja)
Other versions
JPH0512739B2 (en
Inventor
Takuji Ishii
石井 卓二
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP60012159A priority Critical patent/JPS61170840A/en
Publication of JPS61170840A publication Critical patent/JPS61170840A/en
Publication of JPH0512739B2 publication Critical patent/JPH0512739B2/ja
Granted legal-status Critical Current

Links

Abstract

PURPOSE:To perform the processing in a high speed by providing a means which generates an intermediate table A' with respect to a table A and a means which generates an index from a table B and accessing the table just after the table A' is generated. CONSTITUTION:In a data processor provided with the processing function for relational data bases on a file memory 4, the join agreement condition which a channel processor 3 reads out from a main storage device 2 by the input/ output instruction of a CPU1 is used to join tables A and B. In this case, an index 22 and a column list 23 are provided on the main storage device 2 to perform the join processing and the generation processing of an intermediate table 21 in a high speed. Pairs of data of columns of a table B42 and their record address are generated preliminarily as the index 22 to fetch directly record addresses of column data. The intermediate table A'21 is generated, and the column list 23 or the like is set to obtain data items.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 リレーショナルデータベース(RDB)の処理機構を備
えた計算機システムにおいて、問い合わせコマンドが指
定する同値結合条件から、テーブルAとテーブルBを検
索して、該コマンドが指定するレコードを高速に検索す
る偏繰り込み結合手法によるJOIN処理方式に関する
[Detailed Description of the Invention] [Industrial Application Field] In a computer system equipped with a relational database (RDB) processing mechanism, tables A and B are searched based on equivalence join conditions specified by an inquiry command, and the corresponding The present invention relates to a JOIN processing method using a biased join method to quickly search for records specified by a command.

最近の計算機の利用技術の進展に伴い、データ処理に対
するユーザの要求は、益々多様化、複雑化してきている
BACKGROUND OF THE INVENTION With recent advances in computer utilization technology, user requests for data processing have become increasingly diverse and complex.

このような状況に対して、従来のデータベースにおいて
は、多くの専門知識を必要とすることと、情報をタイム
リに活用できない等の問題があり、これらの問題を解決
するものとして、リレーショナルデータベース(RDB
) システムが知られている。
In response to this situation, conventional databases have problems such as requiring a lot of specialized knowledge and not being able to utilize information in a timely manner.Relational databases (RDBs) have been proposed as a solution to these problems.
) system is known.

該リレーショナルデータベース(RDB)システムには
、 ■ 初期の段階からデータベースを簡単に導入でき、最
小限の知識でデータを扱える他、導入後の設計変更も簡
単にできると云う構築の容易性、拡張性、柔軟性がある
The relational database (RDB) system has the following features: ■ Ease of construction and expandability, such as the ability to easily introduce the database from the initial stage, handle data with minimal knowledge, and easily change the design after introduction. , flexible.

■ 業務内容に応じた最適なデータベースの運用が可能
である。
■ It is possible to operate the database optimally according to the business content.

■ データベースの生成、操作、保守と言った一連の作
業が、ユーザ端末から簡単にできる。
■ A series of tasks such as database creation, operation, and maintenance can be easily performed from the user terminal.

等の特徴がある。It has the following characteristics.

又、リレーショナルデータベース(RDB)システムを
ユーザが扱う操作言語側から見ると、(11ユーザはデ
ータがどのように記憶されているか、どのような手順で
アクセスするかを知らなくとも、単に何が欲しいかにつ
いて、データの名前(カラム名)を指示すれば良い。
Furthermore, when we look at relational database (RDB) systems from the perspective of the operating language used by users, (11) users do not need to know how data is stored or how to access it, they just want to know what they want. All you have to do is specify the name of the data (column name).

(2)  レコード単位の操作ではなく、一度に条件を
満足するレコードの集合操作が可能である。
(2) Instead of operating on a record-by-record basis, it is possible to operate on a set of records that satisfy a condition at once.

等の特徴がある。It has the following characteristics.

このようなデータ操作言語(問い合わせコマンド)の中
で、最も基本的なものとして、5ELECT :検索対
象(カラム名)を指定する。(何を) FROM :結合する各テーブルを指定する。(何処か
ら) Wl(BRI! :結合条件、制約条件を指定する。(
どう云う条件で) があり、これは、r FROMで示されるテーブル群の
直積(総ての組み合わせからなるテーブル)の集合中、
WHt!REの制約条件を満足するものを処理対−象と
する」ことを意味している。            
−このように、リレーショナルデータベース(RDB)
システムの操作上の大きな特徴は、操作対象のテーブル
を、問い合わせコマンドが指定する条件で動的に結合す
る機能、即ちJOIN機能がある所にある。
Among these data manipulation languages (inquiry commands), the most basic one is 5ELECT: Specifies the search target (column name). (What) FROM: Specify each table to be joined. (From where) Wl (BRI!: Specify join conditions and constraint conditions. (
Under what conditions is there a
WHt! This means that the object that satisfies the RE constraints is to be processed.
-In this way, relational database (RDB)
A major operational feature of the system is that it has a function to dynamically join tables to be operated on under conditions specified by an inquiry command, that is, a JOIN function.

上記テーブルの結合を行う方法には、 (a)繰り込み結合手法: これは、テーブルAとテーブルBを結合する時に、AX
B (直積)を求める結合手法であって、テーブルAの
1レコードをスキャンし、これに対して、テーブルBを
全件スキャンする。
The methods for joining the above tables include: (a) Renormalization join method: This method uses AX
This is a join method to obtain B (direct product), in which one record of table A is scanned, and in contrast, all records of table B are scanned.

この処理をテーブルAの全レコードに対して行う、従っ
て、テーブルAのスキャン回数は1回。
This process is performed on all records of table A. Therefore, the number of scans of table A is once.

テーブルBのスキャン回数はテーブルAの全レコード分
となる。
The number of scans for table B is for all records in table A.

(b)突き合わせ結合手法: これは、テーブルAとテーブルBを結合するのに、問い
合わせコマンドが指定する同値結合条件、例えばal・
biを用いて結合する手法であって、予め、結合テーブ
ルは、各々の同値結合条件のキーカラムでソーティング
して置き、テーブルAとテーブルBを並列に各1回宛ス
キャンする。
(b) Match join method: This method joins table A and table B using the equivalence join conditions specified by the query command, such as al.
This is a join method using bi, in which the join table is sorted in advance by the key column of each equivalence join condition, and tables A and B are scanned in parallel once each.

があり、何れの手法においても、必要とするデータ(レ
コード)の検索に時間がかかる問題を内蔵している。
Both methods have the problem that it takes time to search for the required data (records).

然して、最近の業界におけるデータ処理業務の多様化に
伴って、多少性能は落ちても導入が容易で、運用上の柔
軟性が大きい、上記リレーショナルデータベース(RD
B)システムが求められており、かかるデータベースシ
ステムでの性能向上が要求されている。
However, with the recent diversification of data processing operations in the industry, the above-mentioned relational database (RD
B) systems are required, and performance improvements in such database systems are required.

(従来の技術〕 第3図は、ファイルメモリ(PM) 4上に構築されて
いるリレーショナルデータベース(RDB)に対する処
理機能を備えたデータ処理装置において、中央処理装置
(CPtl) 1が発行する入出力命令に基づき、チャ
ネル処理装置(CHP) 3が主記憶装置(MSU)2
から読み出した問い合わせコマンドが指示する同値結合
条件からのJOIN時の結合手法を模式的。
(Prior Art) FIG. 3 shows input/output issued by a central processing unit (CPtl) 1 in a data processing device equipped with a processing function for a relational database (RDB) built on a file memory (PM) 4. Based on the instructions, the channel processing unit (CHP) 3 stores the main storage unit (MSU) 2.
A schematic diagram of the join method when performing a JOIN from the equivalence join condition indicated by the inquiry command read from .

に示したものである。This is shown in .

先ず、必要とするデータに対する問い合わせコマンドを
、 5ELIIICT :カラムal、b2FROM :テ
ーブルA、 B WHERE  : al=bl AND a2=10と
する。
First, the inquiry command for the required data is set as follows: 5ELIIICT: column al, b2FROM: table A, B WHERE: al=bl AND a2=10.

この場合、 ■ 先ず、最適な検索のアクセスバスを取る為に、テー
ブルA 41を同一テーブル内のカラムに関する条件(
具体的には、a2=10)で絞り込む、所謂5ELEC
T IONを行い、中間テーブルA°21を主記憶装置
(MSU) 2上に生成する。
In this case, ■ First, in order to obtain the optimal search access bus, table A41 is set to conditions (
Specifically, the so-called 5ELEC is narrowed down by a2=10).
TION is performed and an intermediate table A°21 is generated on the main storage unit (MSU) 2.

■ 該テーブルA°21とテーブルB 42について、
上記問い合わせコマンドが指示する同値結合条件(al
=bl)を用いて、前記繰り込み結合手法により、互い
に主記憶装置(MSU) 2.ファイルメモリ(FM)
 4上を順方向に走査して、上記条件に合ったデータを
求める。
■ Regarding the table A°21 and table B42,
The equivalence join condition (al
=bl), the main storage unit (MSU) 2. File memory (FM)
4. Scan in the forward direction to find data that meets the above conditions.

と云う手法を採っていた。The method was adopted.

又、例えば、上記中間テーブルA゛21を生成する場合
、上記問い合わせコマンド中に表現されているカラム部
分を総て走査し、未評価のカラムを該中間テーブルA’
21のデータ項目としていた。
For example, when generating the intermediate table A'21, all the column parts expressed in the inquiry command are scanned, and unevaluated columns are generated in the intermediate table A'.
There were 21 data items.

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

従って、従来方式においては、中間テーブルA゛21と
テーブルB 42とを、同値結合条件(al=bl)を
用いて結合(JOIN) L、必要なデータを求める場
合、テーブルA゛21は、前記WHERE条件を絞り込
み条件として、最適な検索条件に絞り込まれているが、
テーブルB 42については、最悪総てのレコードを走
査する必要があり、キーデータ値のバラツキにより、平
均的なレスポンスが得られないと云う問題があった。
Therefore, in the conventional method, when intermediate table A'21 and table B42 are joined (JOIN) L using the equivalence join condition (al=bl), and necessary data is obtained, table A'21 is The search has been narrowed down to the optimal search conditions using the WHERE condition as the narrowing condition, but
Regarding table B 42, there was a problem in that in the worst case, it was necessary to scan all the records, and an average response could not be obtained due to variations in key data values.

又、上記中間テーブルA′21を生成する場合にも、問
い合わせコマンド中に表現されているカラム部分を総て
走査していた為、複雑なコマンド程、中間テーブルの数
も増大し、この中間テーブルの数に比例して、該問い合
わせコマンド部分を走査する回数が増大すると云う問題
があった。
Also, when generating the intermediate table A'21, all the columns expressed in the query command were scanned, so the more complex the command, the larger the number of intermediate tables. There is a problem in that the number of times the inquiry command portion is scanned increases in proportion to the number of questions.

*arq′−z″′E″、iai*o*、+、cm、b
・”7”z6’l>4    。
*arq′-z″′E″, iai*o*, +, cm, b
・"7"z6'l>4.

テーブルの結合処理方法、即ち、 (a)繰り込み結合手法 (b)突き合わせ結合手法 の、それぞれの利点を組み合わせた、偏繰り込み結合手
法を用いて、同値結合条件によるJOINの高速化を図
る方法と、中間テーブルを生成するのに、問い合わせコ
マンド中に記述されたカラムの参照回数をカウントダウ
ンすることにより、該中間テーブルの項目決定処理の簡
素化と、該処理の高速化を図る方法を提供することを目
的とするものである。
A table join processing method, that is, a method of speeding up JOINs based on equivalence join conditions by using a biased join method that combines the advantages of (a) renormalization join method and (b) matched join method; To provide a method for simplifying the process of determining items in an intermediate table and speeding up the process by counting down the number of times a column described in an inquiry command is referenced when generating an intermediate table. This is the purpose.

〔問題点を解決する為の手段〕[Means for solving problems]

この目的は、 (1)  リレーショナルデータベース(RDB)のテ
ーブルAと、テーブルBを結合(JOIN)するのに、
該テーブルAについて、問い合わせコマンドが指示する
条件のレコードのみを選択して、中間テーブルA゛を生
成する第1の手段と、テーブルBのカラムデータから該
データのレコードアドレスを検索する為のインデックス
を生成する第2の手段とを設け、上記第1の手段でテー
ブルA゛を生成後、該テーブルA°の1レコードを検索
し、該レコードのカラムデータを、上記第2の手段で生
成したインデックスの検索範囲として得られるレコード
アドレスで、直接にテーブルBをアクセスする。
The purpose of this is: (1) To join (JOIN) table A and table B in a relational database (RDB),
A first means for generating an intermediate table A' by selecting only the records meeting the conditions specified by the inquiry command for the table A, and an index for searching the record address of the data from the column data of the table B. After generating the table A' by the first means, one record of the table A is searched, and the column data of the record is indexed by the index generated by the second means. Table B is directly accessed using the record address obtained as the search range.

(2)上記中間テーブルA′を生成するのに、上記問い
合わせコマンド中に記述されたカラムの数と。
(2) The number of columns described in the inquiry command to generate the intermediate table A'.

該カラムの参照回数を予めテーブルとして設定し、上記
問い合わせコマンドの実行に際して評価した条件式で使
用したカラムの数を、上記テーブル内の参照回数からカ
ウントダウンするようにし、該テーブルの参照回数が1
回以上のものを未評価カラムとして、該中間テーブルA
゛のデータ項目とする。
The number of references to the column is set in advance as a table, and the number of columns used in the conditional expression evaluated when executing the above inquiry command is counted down from the number of references in the table, so that the number of references to the table is 1.
times or more as unevaluated columns, the intermediate table A
Let it be the data item of ゛.

本発明の偏繰り込み結合手法によるJOIN処理方式に
よって達成される。
This is achieved by the JOIN processing method using the biased join method of the present invention.

〔作用〕[Effect]

即ち、本発明によれば、 ■ 中間テーブルA′と、テーブルBを問い合わせコマ
ンドが指示する同値結合条件を用いてJOINするのに
、予めテーブルBのカラムのデータと、該データのレコ
ードアドレスとの対をインデックスとして生成しておき
、上記テーブルA゛の1レコードを検索した後、該テー
ブルA’ のカラムのデータを用いて、該インデックス
を検索し、該カラムデータに対するレコードアドレスを
直接フェッチする。
That is, according to the present invention, (1) In order to JOIN intermediate table A' and table B using the equivalence join condition specified by the inquiry command, the data in the columns of table B and the record address of the data must be A pair is generated as an index, and after one record of the table A' is searched, the index is searched using the column data of the table A', and the record address for the column data is directly fetched.

■ 又、上記中間テーブルA゛を生成するのに、予め上
記問い合わせコマンド中に記述されたカラムの一覧表と
、そのカラムの参照回数を設定しておき、該問い合わせ
コマンドの実行手順毎に評価した条件式等で使用したカ
ラムの数を、上記カラム一覧表の参照回数からカウント
ダウンし、該参照回数が1以上のカラムを未評価として
、該中間テーフ゛ルA”のデータ項目とするものである
■ In addition, to generate the above intermediate table A, a list of columns described in the above inquiry command and the number of times the columns are referenced are set in advance, and evaluated for each execution procedure of the inquiry command. The number of columns used in conditional expressions, etc. is counted down from the number of references in the column list, and columns with a reference number of 1 or more are treated as unevaluated and set as data items in the intermediate table A''.

従って、■のJOIN処理においては、テーブルBへの
アクセスを、テーブルA゛のレコード数分で検索結果を
得ることができ、従来の「突き合わせ手法」の約20〜
50%のレスポンス、及びアクセス回数で検索できる。
Therefore, in the JOIN process (■), it is possible to access table B and obtain search results in as many records as table A', which is about 20 times faster than the conventional "matching method".
You can search by 50% response and number of accesses.

又、■の中間テーブル作成処理においては、問い合わせ
コマンドのカラム部分のスキャンは、中間テーブルの数
に関係なく1回のみとなり、該中間テーブルの作成が高
速化できる効果がある。
Furthermore, in the intermediate table creation process (2), the column portion of the inquiry command is scanned only once regardless of the number of intermediate tables, which has the effect of speeding up the creation of the intermediate table.

〔実施例〕〔Example〕

以下本発明の実施例を図面によって詳述する。 Embodiments of the present invention will be described in detail below with reference to the drawings.

第1図はJOIN処理に関する本発明の一実施例を模式
的に示した図であり、第2図は中間テーブルの作成方法
を説明する図であって、第3図と同じ符号は同じ対象物
を示している。
FIG. 1 is a diagram schematically showing an embodiment of the present invention regarding JOIN processing, and FIG. 2 is a diagram illustrating a method for creating an intermediate table. The same reference numerals as in FIG. It shows.

第1図において、主記憶装置(MSU) 2上に設けら
れているインデックス22が、該JOIN処理の高速化
に必要な手段であり、同じ主記憶装置(MSU)2上の
カラム一覧表23が中間テーブルの作成処理の高速化に
必要な手段である。
In FIG. 1, an index 22 provided on the main storage unit (MSU) 2 is a means necessary for speeding up the JOIN process, and a column list 23 on the same main storage unit (MSU) 2 is This is a necessary means to speed up the process of creating intermediate tables.

先ず、第1図によって、問い合わせコマンド、5ELI
ECT :カラムal、b2 FROM :テーブルA、 B W)IERE : al=bl AND a2=10が
指示する同値結合条件(al=bl)に基ゞいて・リ 
    −レーショナルデータベース(RDB)のテー
ブルA41、テーブルB 42を高速にJOINする場
合の手順を説明する。
First, according to FIG. 1, the inquiry command, 5ELI
ECT: Column al, b2 FROM: Table A, B W) IERE: al=bl AND Based on the equivalence join condition (al=bl) indicated by a2=10
- The procedure for high-speed JOIN of table A41 and table B42 of a relational database (RDB) will be explained.

(a)本発明を実施するに際しては、上記問い合わせコ
マンドが指示するテーブルA41.テーブルB 42の
同値結合条件(al・bl)から、テーブルB42のカ
ラムb1に対して、各データをキーとして、そのデータ
が格納されているレコードアドレスをポインタ値とする
インデックス22を主記憶装置(MSU) 2上に生成
しておく。
(a) When implementing the present invention, table A41. From the equivalence join condition (al, bl) of table B 42, for column b1 of table B 42, an index 22 with each data as a key and a record address where the data is stored as a pointer value is set in the main storage ( MSU) 2.

(b)テーブルA 41がら、後述する中間テーブル作
成処理手順によって、上記問い合わせコマンドが指示す
るテーブルAに関する絞り込み条件、例えば、rWHE
Rt!  : a2=10 Jに基づいて、中間テーブ
ルA”21を主記憶装置(MSU) 2上に生成する。
(b) From table A 41, by using the intermediate table creation processing procedure described later, the narrowing conditions regarding table A specified by the above inquiry command, for example, rWHE.
Rt! : Based on a2=10J, an intermediate table A''21 is generated on the main storage unit (MSU) 2.

(C)中間テーブルA゛21の1レコードを検索した後
、そのalカラムのデータ、例えば“1′、“1000
0′で、上記テーブルB 42のインデックス22を検
索して、択一的に該データに関するレコードアドレスを
読み出し、ファイルメモリ(FM) 4上のテーフ゛ル
B 42をアクセスして、当言亥データをダイレクトに
フェッチする。
(C) After searching one record of intermediate table A21, the data in the al column, for example "1', "1000"
0', searches the index 22 of the table B 42, alternatively reads the record address related to the data, accesses the table B 42 on the file memory (FM) 4, and directly directs the data. to fetch.

この結果、テーブルB 42へのフェッチアクセスは、
テーブルA’21のレコード数(本例においては、2レ
コード)分で、求める検索データを得ることができる。
As a result, a fetch access to table B 42 is
The desired search data can be obtained using the number of records in table A'21 (two records in this example).

中間テーブルA゛21のa1カラムのデータ °1゛。Data in column a1 of intermediate table A21 °1.

又は°1oooo’でインデックス22を検索して、択
一的に該データに対するレコードアドレスを得る手法に
ついては、例えば特願昭53−137650に開示され
ている。
Or, a method of searching the index 22 for .degree.1oooo' and alternatively obtaining a record address for the data is disclosed in Japanese Patent Application No. 53-137650, for example.

本手法は、キー値とポインタ値との対情報を、予め定め
られた順序に配列し、該配列に基づいて、索引用インデ
ックスを階層構造に抽出したインバーテツドファイルを
備え、検索すべきデータ(キー)を上記対情報のインデ
ックスで与えて、該インバーテツドファイルを索引し、
8亥索引インデツクスをたどって検索すべきデータ(ポ
インタ)を抽出するようにしたもので、求めるデータが
高速に、且つ均一化して得られる特徴がある。
This method arranges pair information of key values and pointer values in a predetermined order, and has an inverted file in which indexes for indexing are extracted in a hierarchical structure based on the arrangement, and retrieves the data to be searched. (key) as the index of the above pair information, index the inverted file,
This system extracts the data (pointer) to be searched by following the 8-point index, and has the feature that the desired data can be obtained quickly and uniformly.

次に、第1図を参照しながら第2図によって、中間テー
ブルA°21の作成方法を説明する。
Next, a method for creating the intermediate table A°21 will be explained with reference to FIG. 2 while referring to FIG.

(d)先ず、第2図の「初期設定」欄に示したように、
上記問い合わせコマンド中に記述された、カラム一覧と
、そのカラムの参照回数を、カラム一覧表テーブル23
として、予め主記憶装置(MSU)2上に設定しておく
(d) First, as shown in the "Initial Settings" column in Figure 2,
The column list and the number of references to that column written in the above inquiry command are stored in the column list table 23.
is set in advance on the main storage unit (MSU) 2.

具体的に説明すると、上記問い合わせコマンドを見た時
、カラムa1は2回、カラムa2は1回、カラムb1は
1回、カラムb2は1回の参照されるようになっている
ので、第2図の初期設定値は、上記の値に設定される。
To be more specific, when looking at the above inquiry command, column a1 is referenced twice, column a2 is referenced once, column b1 is referenced once, and column b2 is referenced once, so the second The initial setting values in the figure are set to the above values.

(e)次に、テーブルAを絞り込み条件ra2=10」
で、5ELECTIONする。この実行手順で評価した
条件式等で使用したカラムの数を、上記一覧表23の参
照回数からカウントダウンする。この結果、該実行段階
での中間データ構成は、カラム一覧表23中の参照回数
が1以上のものを未評価項目として、その時の中間デー
タ項目とする。
(e) Next, narrow down table A with condition ra2=10.”
So, do 5 ELECTION. The number of columns used in the conditional expressions etc. evaluated in this execution procedure is counted down from the number of references in the list 23 above. As a result, in the intermediate data structure at the execution stage, items that have been referenced 1 or more in the column list 23 are treated as unevaluated items and are used as intermediate data items at that time.

本例においては、ra2=10 Jで5ELECTIO
N しているので、カラムa2の値のみを、1=OOに
カウントダウンする。
In this example, ra2=10 J and 5ELECTIO
N, so only the value of column a2 is counted down to 1=OO.

この時、テーブルAについて見れば、カラム一覧表23
中の参照回数が、1以上のものは「al」のみであるの
で、テーブルAに関する中間テーブルは、第1図のテー
ブルA゛21となる。
At this time, if you look at table A, column list 23
Since only "al" has a reference count of 1 or more, the intermediate table related to table A is table A'21 in FIG.

(f)中間テーブルA”21とテーブルBをJOINし
た場合には、ral=bl Jが評価条件式となるので
、カラムal、blの値が、それぞれ、 カラムal:2=+1 カラムbl:1=00 にカウントダウンされ、この段階での中間テーブルを作
成する場合のデータ項目は、第2図から明らかな如く、
カラムal、b2となる。
(f) When intermediate table A"21 and table B are JOINed, ral=bl J becomes the evaluation condition expression, so the values of columns al and bl are, respectively, column al:2=+1 column bl:1 =00, and the data items when creating the intermediate table at this stage are as clear from Figure 2.
The columns are al and b2.

このように、本中間テーブル作成方法では、問い合わせ
コマンドを実行する毎に、カラム参照回数をカウントダ
ウンするだけで中間データ項目が得られるので、簡単に
、且つ高速に中間データの構造を決定することができる
と云う特徴がある。
In this way, with this intermediate table creation method, intermediate data items can be obtained by simply counting down the number of column references each time an inquiry command is executed, making it possible to easily and quickly determine the structure of intermediate data. There is a characteristic that it can be done.

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

以上、詳細に説明したように、本発明の偏繰り    
  I込み結合手法によるJOIN処理方式は、■ 中
間テーブルA゛と、テーブルBを問い合わせコマンドが
指示する同値結合条件を用いてJOINするのに、予め
テーブルBのカラムのデータと、該データのレコードア
ドレスとの対をインデックスとして生成しておき、上記
中間テーブルA゛の1レコードを検索した後、該テーブ
ルA゛のカラムのデータを用いて、該インデックスを検
索し、該カラムデータに対するレコードアドレスを直接
フェッチする。
As explained in detail above, the bias of the present invention
The JOIN processing method using the I-included join method is as follows: ■ To JOIN intermediate table A' and table B using the equivalence join condition specified by the inquiry command, the column data of table B and the record address of the data must be specified in advance. After searching one record of the above intermediate table A', search the index using the column data of the table A', and directly write the record address for the column data. fetch

■ 又、上記中間テーブル八゛を生成するのに、予め上
記問い合わせコマンド中に記述されたカラムの一覧表と
、そのカラムの参照回数を設定しておき、該問い合わせ
コマンドの実行手順毎に評価した条件式等で使用したカ
ラムの数を、上記カラム一覧表の参照回数からカウント
ダウンし、該参照回数が1以上のカラムを未評価として
、該中間テーフ゛ルA゛のデータ項目とするようにした
ものである。
■ In order to generate the above intermediate table 8, a list of columns described in the above inquiry command and the number of times the columns are referenced are set in advance, and evaluated for each execution procedure of the inquiry command. The number of columns used in conditional expressions, etc. is counted down from the number of references in the column list above, and columns with a reference number of 1 or more are treated as unevaluated and set as data items in the intermediate table A. be.

従って、■のJOIN処理においては、テーブルBへの
アクセスを、テーブルA’ のレコード数分で検索結果
を得ることができ、従来の「突き合わせ手法」の約20
〜50%のレスポンス、及びアクセス回数で検索できる
。又、■の中間テーブル作成処理においては、問い合わ
せコマンドのカラム部分のスキャンは、中間テーブルの
数に関係なく1回のみとなり、該中間テーブルの作成が
高速化できる効果がある。
Therefore, in the JOIN process (■), it is possible to obtain search results in as many accesses to table B as there are records in table A'.
You can search by ~50% response and number of accesses. Furthermore, in the intermediate table creation process (2), the column portion of the inquiry command is scanned only once regardless of the number of intermediate tables, which has the effect of speeding up the creation of the intermediate table.

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

第1図は本発明の一実施例を模式的に示した図。 第2図は中間テーブルを作成する方法を説明する図。 第3図は従来技術によるJOIN処理方式を模式的に示
した図。 である。 図面において、 ■は中央処理装置(CPtl) 、 2は主記憶装置(
MSU) 。 21は中間テーブルA I 、  92はインデックス
。 23はカラム一覧表。 3はチャネル処理装置(CHP) 。 4はファイルメモリ(FM) 。 41はテーブルA、   42はテーブルB。 をそれぞれ示す。
FIG. 1 is a diagram schematically showing an embodiment of the present invention. FIG. 2 is a diagram explaining a method of creating an intermediate table. FIG. 3 is a diagram schematically showing a JOIN processing method according to the prior art. It is. In the drawing, ① is the central processing unit (CPtl), 2 is the main memory (
MSU). 21 is an intermediate table A I, and 92 is an index. 23 is a column list. 3 is a channel processing unit (CHP). 4 is file memory (FM). 41 is table A, 42 is table B. are shown respectively.

Claims (2)

【特許請求の範囲】[Claims] (1)リレーショナルデータベース(RDB)処理機構
を備えた計算機システムにおいて、上記リレーショナル
データベース(RDB)のテーブルAと、テーブルBを
結合(JOIN)するのに、該テーブルAについて、問
い合わせコマンドが指定する条件のレコードのみを選択
して、中間テーブルA′を生成する第1の手段と、テー
ブルBのカラムデータから該データのレコードアドレス
を検索する為のインデックスを生成する第2の手段とを
設け、上記第1の手段でテーブルA′を生成後、該テー
ブルA′の1レコードを検索し、該レコードのカラムデ
ータを、上記第2の手段で生成したインデックスの検索
範囲として得られるレコードアドレスで、直接にテーブ
ルBをアクセスすることを特徴とする偏繰り込み結合手
法によるJOIN処理方式。
(1) In a computer system equipped with a relational database (RDB) processing mechanism, conditions specified by an inquiry command for table A to join (JOIN) table A and table B of the relational database (RDB). A first means for selecting only the records of , and generating an intermediate table A′, and a second means for generating an index for searching the record address of the data from the column data of table B, After generating table A' by the first means, search one record of table A', and directly search the column data of this record using the record address obtained as the search range of the index generated by the second means. A JOIN processing method using a biased join method characterized by accessing table B.
(2)上記中間テーブルA′を生成するのに、上記問い
合わせコマンド中に記述されたカラムの数と、該カラム
の参照回数を予めテーブルとして設定し、上記問い合わ
せコマンドの実行に際して評価した条件式で使用したカ
ラムの数を、上記テーブル内の参照回数からカウントダ
ウンするようにし、該テーブルの参照回数が1回以上の
ものを未評価カラムとして、該中間テーブルA′のデー
タ項目とするごとを特徴とする特許請求の範囲第1項に
記載の偏繰り込み結合手法によるJOIN処理方式。
(2) To generate the above intermediate table A', the number of columns described in the above inquiry command and the number of times the columns are referenced are set in advance as a table, and the conditional expression evaluated when executing the above inquiry command is used. The number of used columns is counted down from the number of references in the table, and columns that are referenced once or more in the table are treated as unevaluated columns and as data items in the intermediate table A'. A JOIN processing method using a biased join method according to claim 1.
JP60012159A 1985-01-25 1985-01-25 Join processing system by partial convolution joining method Granted JPS61170840A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60012159A JPS61170840A (en) 1985-01-25 1985-01-25 Join processing system by partial convolution joining method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60012159A JPS61170840A (en) 1985-01-25 1985-01-25 Join processing system by partial convolution joining method

Publications (2)

Publication Number Publication Date
JPS61170840A true JPS61170840A (en) 1986-08-01
JPH0512739B2 JPH0512739B2 (en) 1993-02-18

Family

ID=11797671

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60012159A Granted JPS61170840A (en) 1985-01-25 1985-01-25 Join processing system by partial convolution joining method

Country Status (1)

Country Link
JP (1) JPS61170840A (en)

Cited By (2)

* 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
JPH04213765A (en) * 1990-02-13 1992-08-04 Internatl Business Mach Corp <Ibm> Method for combining tables of associated database controlling apparatus and computer system therefor

Cited By (2)

* 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
JPH04213765A (en) * 1990-02-13 1992-08-04 Internatl Business Mach Corp <Ibm> Method for combining tables of associated database controlling apparatus and computer system therefor

Also Published As

Publication number Publication date
JPH0512739B2 (en) 1993-02-18

Similar Documents

Publication Publication Date Title
US8332389B2 (en) Join order for a database query
JP2510004B2 (en) Query processing method for release database system
US7945561B1 (en) Methods and apparatus for processing a query joining tables stored at different data sources
US6122644A (en) System for halloween protection in a database system
US6343286B1 (en) Efficient technique to defer large object access with intermediate results
US5465352A (en) Table-and-cache-based database assist method
US8442971B2 (en) Execution plans with different driver sources in multiple threads
US6353819B1 (en) Method and system for using dynamically generated code to perform record management layer functions in a relational database manager
US5732258A (en) Method and apparatus for efficiently evaluating exists and not exists equivalent subqueries
US7089249B2 (en) Method and system for managing database having a capability of passing data, and medium relevant thereto
WO2023086322A1 (en) Late materialization of queried data in database cache
JPS61170840A (en) Join processing system by partial convolution joining method
JP2780996B2 (en) Query optimization processing method
JPH10269225A (en) Data base dividing method
JP3066836B2 (en) High-speed access method in knowledge base system
US20220100730A1 (en) Function-based indexes in database systems
JP2906638B2 (en) Database search system
JPH04215185A (en) Condition retrieval processing system
JPH04174071A (en) Hash processor
JPH0795300B2 (en) Name management method in database
Palvia Heuristic Optimization of Physical Data Bases: Using a Generic and Abstract Design Model
JPS61165146A (en) Dynamic changing and processing system of data item in record type data
JP2001155028A (en) Aggregate calculation processing method and device for relational database, and computer readable recording medium recorded with aggregate arithmetic processing program
JPH0259861A (en) Preparation, storage, and retrieval device for indexed document
JPH03263267A (en) Optimizing method for condition retrieval

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees