JPS61110234A - Data processor - Google Patents

Data processor

Info

Publication number
JPS61110234A
JPS61110234A JP59231253A JP23125384A JPS61110234A JP S61110234 A JPS61110234 A JP S61110234A JP 59231253 A JP59231253 A JP 59231253A JP 23125384 A JP23125384 A JP 23125384A JP S61110234 A JPS61110234 A JP S61110234A
Authority
JP
Japan
Prior art keywords
record
records
relation
relations
read
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
JP59231253A
Other languages
Japanese (ja)
Other versions
JPH0373021B2 (en
Inventor
Shigeo Kamiya
神谷 茂雄
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 JP59231253A priority Critical patent/JPS61110234A/en
Publication of JPS61110234A publication Critical patent/JPS61110234A/en
Publication of JPH0373021B2 publication Critical patent/JPH0373021B2/ja
Granted legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To easily execute restricting calculation at a high speed, by detecting and comparing overlap of records of the 1st and 2nd relations and controlling next read out records in accordance with the compared results and overlap detected results added to the records. CONSTITUTION:Records and overlap detected results added to the records read out from the 1st and 2nd record buffer memories 16 and 17 are respectively set in data registers 22 and 23. A comparator circuit 24 compares the record data with each other and outputs the compared results to control circuits 18 and 19 and, at the same time, to the output controlling circuit 25 of the next stage. Record buffer memories 26 and 27, each of which has a storage capacity which is able to store one record, once store each record from the buffer memories 16 and 17 and preserves each record word until the comparing process is performed to all words of records. The records respectively stored in the buffer memories 26 and 27 in such a way are read out under the control (restricting calculation) of the output controlling circuit 25 and outputted from a selection circuit 28 through an output register 29.

Description

【発明の詳細な説明】 〔発明の技術分野〕 本発明は、ソート処理された2つのリレーション間にお
ける制約演算を、マーシー・ソート処理を基本とした関
係演算によって高速に実行することができるデータ処理
装置に関する。
DETAILED DESCRIPTION OF THE INVENTION [Technical Field of the Invention] The present invention provides data processing in which constraint operations between two sorted relations can be executed at high speed by relational operations based on Mercy sort processing. Regarding equipment.

(発明の技術的背景とその問題点) 大容量記憶装置の進歩に伴い、その大容量記憶装置上で
大規模なデータベースを構築する計算機システムが増え
てきている。ところが、データベースが大規模になる程
、該データベースから必要なデータを検索するに必要な
時間が長くなるという開題が生じている。これを解決す
る方法の1つとして、検索に必要な処理、つまり関係演
算を専用ハードウェアで実行することが種々提唱されて
いる。
(Technical background of the invention and its problems) With the advancement of mass storage devices, the number of computer systems that construct large-scale databases on the mass storage devices is increasing. However, as the database becomes larger, the time required to search for necessary data from the database becomes longer. As one method to solve this problem, various proposals have been made to execute the processing necessary for the search, that is, the relational calculations, using dedicated hardware.

ところで、この種の関係演算の1つに制約演算(res
triction )がある。この制約演算は、例えば
次に示すような2つのリレーション(R1)(−条件)
、リレーション(R2) から、そのキイ〈属性Aと、属性B)の値が制約条件(
例えばイコール)に合うレコードのみを選択して、次の
ような新しいリレーション(R3)を得るものである。
By the way, one of these types of relational operations is the constraint operation (res
triction). This constraint operation, for example, uses two relations (R1) (-condition) as shown below.
, relation (R2), the values of its keys (attribute A and attribute B) satisfy the constraint condition (
For example, by selecting only the records that match (equal), the following new relation (R3) is obtained.

しかして従来この制約演算は、上記2つのリレーション
をそれぞれ昇順でソート処理した後、その間でマージ・
ソート処理を行うことにより実行されている。つまり、
最初に両リレーションの先頭レコードにポインタを置き
、このポインタが指すレコードの間でキイの値を相互に
比較し、その比較結果に従って上記キイの値の小さいレ
コードしている。ところが、キイの値が等しい時を含め
て、常にいずれか一方のポインタだけを進めてレコード
の比較を行って上記制約演算処理しているので、その演
算処理時間が長いと云う不具合を有していた。
However, conventionally, this constraint operation involves sorting the above two relations in ascending order, and then merging between them.
This is done by performing a sorting process. In other words,
First, a pointer is placed at the first record of both relations, and the key values are compared between the records pointed to by this pointer, and the record with the smaller key value is selected according to the comparison result. However, since the above constraint calculations are processed by always advancing only one pointer and comparing records, including when the key values are equal, there is a problem that the calculation processing time is long. Ta.

〔発明の目的〕[Purpose of the invention]

本発明はこのような事情を考慮してなされたもので、そ
の目的とするところは、ソート処理された2つのリレー
ション間のマージ・ソート処理を基本とした制約演算を
簡易に、且つ高速に実行することができるデータ処理装
置を提供することにある。
The present invention has been made in consideration of these circumstances, and its purpose is to easily and quickly execute constraint operations based on merge/sort processing between two sorted relations. The object of the present invention is to provide a data processing device that can perform the following tasks.

(発明の概要〕 本発明は、所定の規則に従ってソート処理が施された痩
数のレコードからなる第1および第2のリレーションを
それぞれ入力して第1および第2のレコードバッファメ
モリに格納する時、上記各リレーションにおけるレコー
ドの重複を検出して、その重複検出結果を上記各レコー
ドに対応させて前記第1および第2のレコードバッファ
メモリに格納する。そして関係演算に必要なレコードを
前で次に読出すレコードを制御するようにしたものであ
る。そして特にこのレコードの読出し制御を■ 前記比
較結果が等しくない場合には前記ソート処理方向に若い
値のレコードを格納したレコードバッファメモリから次
のレコードを読出すと共に、他方のレコードバッファメ
モリからは同じレコードを読出し、 ■ 前記比較結果が等しいときであって、上記第1のリ
レーションのレコードの重複検出結果が重複レコードで
ないことを示しており、且つ第2のリレーションのレコ
ードの11検出結果が重複レコードであることを示して
いる場合には、上記第1のレコードバッファメモリから
読出すレコードをそのまま維持し、他方第2のレコード
バッファメモリから読出すレコードを次のレコードに進
め、■ 前記比較結果が等しいときであって、各レコー
ドの重複検出結果が上記■以外の場合には前記各レコー
ドバッファメモリからそれぞれ読出すレコードを次のレ
コードに進める ようにしたことを特徴とするものである。
(Summary of the Invention) The present invention provides a method for inputting first and second relations consisting of lean records that have been sorted according to predetermined rules and storing them in first and second record buffer memories, respectively. , detects duplicate records in each of the above relations, and stores the duplicate detection results in the first and second record buffer memories in correspondence with each record.Then, records necessary for the relational operation are stored in the first and second record buffer memories. In particular, the read control for this record is as follows: ■ If the comparison results are not equal, the next record is read from the record buffer memory storing the record with the smaller value in the direction of the sorting process. At the same time as reading the record, the same record is read from the other record buffer memory; (i) When the comparison results are equal, and the result of detecting duplicate records in the first relation indicates that the record is not a duplicate record; In addition, if the detection result of the record 11 of the second relation indicates that it is a duplicate record, the record to be read from the first record buffer memory is maintained as it is, and the record read from the second record buffer memory is continued. Advance the record to be output to the next record, and ■ When the comparison results are equal and the duplicate detection result for each record is other than ■, advance the record to be read from each record buffer memory to the next record. It is characterized by the following.

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

かくして本発明によれば、2つのリレーションの各レコ
ードに付された重複検出結果に従って、比較結果の等し
いレコードであって、且つ制約対象となる第2のリレー
ションのレコードが重複している場合を除いて、前記各
リレーションからのレコードの読出しを順に先に進める
ことができるので、ソート処理された2つのリレーショ
ンをそれぞれほぼ1回スキャンニングするだけで制約演
算に必要なレコードの比較処理の全てを行うことが可能
となる。つまり各リレーションにおけるレコードの選択
をほぼ同時に進行させることができるので、その処理所
要時間の大幅な短縮化を図ることが可能となる。しかも
各リレーションのレコードの重複を調べておき、そのレ
コードm複情報を利用して各レコードの読出し制御を行
うので、その制御アルゴリズムが簡単であり、構成の複
雑化を招来することなしにデータ処理装置を構築するこ
とができる等の実用上多大なる効果が奏せられる。
Thus, according to the present invention, according to the duplicate detection results attached to each record of two relations, the records with the same comparison result and the record of the second relation subject to the restriction are duplicated. As a result, records can be read from each relation one after the other, so all the record comparison processing required for constraint calculations can be performed by scanning each of the two sorted relations almost once. becomes possible. In other words, records in each relation can be selected almost simultaneously, making it possible to significantly shorten the time required for the process. Moreover, since the duplication of records in each relation is checked and the readout of each record is controlled using the record m-multiple information, the control algorithm is simple and data processing can be performed without complicating the configuration. There are great practical effects such as being able to construct a device.

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

以下、図面を参照して本発明の一実施例につき説明する
Hereinafter, one embodiment of the present invention will be described with reference to the drawings.

図は、本発明の実施例に係るデータ処理装置の所定の規
則に従ってソート処理が施された複数のレコードからな
る第1および第2のリレーションがそれぞれ入力される
演算部の入力段には、各リレーション中のレコードの重
複を検出する重複検出回路が設けられている。この重複
検出回路は、順次入力されるレコードの1語をセットす
る入力レジスタ11と、ルコード分の記憶容量を持ち、
且つFIFO(ファーストイン・)7ストアウト)曙能
を有するレコードバッファメモリ12と、このレコード
バッファメモリ12から読出されるレコードの値と前記
入力レジスタ11にセットされた次のレコードの値とを
比較する比較回路13と、上記レコードバッファメモリ
12から読出されるレコードを1語分づつセットして次
段の回路に転送するデータレジスタ14と、前記比較回
路13が出力するイコール信号Eから前記レコードバッ
ファメモリ12にセットされていたレコードが、現入力
レコードと重複しているか否かを判定し、重複している
゛場合に重複フラグFをセットするフラグ回路15とを
備えて構成される。
The figure shows that the input stage of the arithmetic unit to which the first and second relations each consisting of a plurality of records that have been sorted according to a predetermined rule of the data processing device according to the embodiment of the present invention is inputted. A duplication detection circuit is provided to detect duplication of records in the relation. This duplication detection circuit has an input register 11 for setting one word of a record that is input sequentially, and a storage capacity for the record code.
A record buffer memory 12 having a FIFO (first in/)7 strike out) function compares the value of the record read from this record buffer memory 12 with the value of the next record set in the input register 11. A comparison circuit 13, a data register 14 that sets the record read out from the record buffer memory 12 one word at a time and transfers it to the next stage circuit, and an equal signal E output from the comparison circuit 13 to the record buffer memory. 12, and a flag circuit 15 for determining whether or not the record set in No. 12 overlaps with the current input record, and setting a duplication flag F if the record is overlapping.

尚、前記各レコードが複数の語によって構成される場合
、比較回路13は各倍電に比較処理していることから、
入力リレーション中の相前後するレコードのキイ(属性
)の値が重複しているか否かが決定されるタイミングは
、そのレコードの最後重複フラグFは、前記レコードの
最後の1詔が前記データレジスタ15を介して次段に転
送されるときに有効となる。
In addition, when each record is composed of a plurality of words, since the comparison circuit 13 performs comparison processing on each double voltage,
The timing at which it is determined whether or not the key (attribute) values of successive records in the input relation are duplicated is that the last duplicate flag F of the record indicates that the last edict of the record is in the data register 15. It becomes valid when the data is transferred to the next stage via .

しかしてこのような重複検出回路を介して入力される第
1のリレーションの各レコードは、第1のレコードバッ
ファメモリ16に入力されて格納される。この時、前記
重複検出回路にて検出された各レコードについての重複
検出結果(重複フラグF)が、そのレコードに対応して
該第1のレコードバッファメモリ16に格納される。同
様にして第2のリレーションのレコードが入力されたと
き、そのレコードは前記重複検出回路を介して第2のレ
コードバッファメモリ17に格納され、各レコードにつ
いて検出された重複検出結果(重複フラグF)が、その
レコードに対応して該第2のレコードバッファメモリ1
7に格納される。
Therefore, each record of the first relation inputted through such a duplication detection circuit is inputted to the first record buffer memory 16 and stored therein. At this time, the duplication detection result (duplication flag F) for each record detected by the duplication detection circuit is stored in the first record buffer memory 16 in correspondence with that record. Similarly, when a record of the second relation is input, the record is stored in the second record buffer memory 17 via the duplication detection circuit, and the duplication detection result (duplication flag F) detected for each record is is stored in the second record buffer memory 1 corresponding to that record.
7 is stored.

これらの第1および第2のレコードバッファメモリ16
.17は、1つのリレーションのレコードを記憶できる
容量をそれぞれ持ち、レコード読出し制御回路18.1
9の制御を受けて格納レコードおよびそのレコードに付
加された重複検出結果の読出11(重複フラグF)とに
従って、前記アドレスレジスタ20の値をセーブしたり
、或いは該バックアラ717−、) ス9211.:格
納している値を前記アドレスレジスタ20にロードする
ものである。これらのアドレスレジスタ20およびバッ
クアップレジスタ21にセットされる値の、前記比較結
果と重複検出結果(Ii複フラグF)とに基づく更新l
ll1によって、前記第1および第2のレコードバッフ
ァメモ1月6゜11から読出される各リレーションのレ
コードが制−される。
These first and second record buffer memories 16
.. 17 each has a capacity capable of storing a record of one relation, and a record read control circuit 18.1
9211.9, the value of the address register 20 is saved, or the value of the address register 20 is saved, or the value of the backer 717-,) is read out 11 (duplication flag F) of the stored record and the duplicate detection result added to the record under the control of 9211.9. : Loads the stored value into the address register 20. The values set in these address registers 20 and backup registers 21 are updated based on the comparison results and the duplicate detection results (Ii double flag F).
ll1 controls the records of each relation read from the first and second record buffer memos January 6.11.

この他にも、本発明の要旨とは直接関係しないことから
図示していないが、レコード読出しIIIII回路18
.19には書き込み用のレジスタや、これらのレジスタ
を制御する制御回路が設けられていることは云うまでも
ない。
In addition to this, although not shown because it is not directly related to the gist of the present invention, there is also a record readout III circuit 18.
.. It goes without saying that 19 is provided with write registers and a control circuit for controlling these registers.

しかして前記第1および第−JDJO−ドバッファメモ
リ16.17からそれぞれ読出されるレコードれぞれセ
ットされたレコードデータを相互に比較し、その比較結
果を前記レコード読出しIll I11回路18、19
に出力すると共に、次段の出力III m回路25に出
力している。前記レコード読出し制御回路18゜19は
、このような比較回路24によるレコードの比較結果と
、上記データレジスタ22.23にセットされた重複検
出結果の情報とを入力して、前記各レジスタ20.21
のセットデータを更新制御している。
The record data set in the records read from the first and second JDJO buffer memories 16 and 17, respectively, are compared with each other, and the comparison results are sent to the record reading circuits 18 and 19.
At the same time, it is output to the output III m circuit 25 at the next stage. The record read control circuits 18 and 19 input the record comparison result by the comparison circuit 24 and the information of the duplication detection result set in the data registers 22.23, and read the data in each of the registers 20.21.
Update control of the set data.

ルコード分の記憶容量を持ち、且つFIFO機能を有す
る第3および第4のレコードバッファメモリ26.27
は、前記データレジスタ22.23を介して前記レコー
ドバックアメモリ16.17からそれぞれ転送されてき
た各レコードを、一旦格納するものである。これらのレ
コードバックアメモリ26゜27は、前記レコードの比
較処理が語単位で行われ、その比較結果が得られるタイ
ミングがレコードの最後の藷を処理した時点であること
から、該レコードの全ての語に対する比較処理が終了す
るまで、そのレコードの多倍を保存する為に設けられる
ものである。そして、このようにして上記各レコー尚、
このレコードの出力は、第3のレコードバックアメモリ
26に格納されたレコードと、第4のレコードバッファ
メモリ27に格納されたレコードとを結合して行ったり
、′或いは上記第4のレコードバッファメモリ27に格
納されたレコードだけを出力する等して行われる。上記
結合出力処理を行う場合には、例えば第3のレコードバ
ッファメモ926に格納されているレコードを選択回路
28を介して出力した後、第4のレコードバッファメモ
リ27に格納されているレコードを上記選択回路28を
介して出力することによって行われる。ここで、2つの
レコードを結合して出力する場合、前述した比較演算が
2つのレコードの語数の多いレコードの語長分によって
規定されるのに対し、その出力所要時局は両レコードの
語長の「和」に相当した時間となる。この為、一般にレ
コードの比較演算時間より、レコードの出力処理時間の
方が多くかかる。これに対処するべく、例えば前記演一
部ではその比較演算を1サイクルの前半で実行し、出力
する回路等が設けられることは勿論のことである。
3rd and 4th record buffer memories 26 and 27 that have a storage capacity for 1 code and also have a FIFO function.
are for temporarily storing each record transferred from the record backup memory 16.17 via the data register 22.23. These record backup memories 26 and 27 store all words of the record because the record comparison process is performed word by word and the comparison result is obtained at the time when the last line of the record is processed. This is provided to store multiple copies of that record until the comparison process for that record is completed. And in this way, each of the above records,
This record output is performed by combining the record stored in the third record backup memory 26 and the record stored in the fourth record buffer memory 27; This is done by outputting only the records stored in . When performing the above-mentioned combined output process, for example, after outputting the record stored in the third record buffer memory 926 via the selection circuit 28, the record stored in the fourth record buffer memory 27 is outputted as described above. This is done by outputting through the selection circuit 28. Here, when combining two records and outputting them, the comparison operation described above is determined by the word length of the record with the largest number of words, whereas the output requirement is determined by the word length of both records. The time corresponds to the ``wa'' of . For this reason, record output processing time generally takes longer than record comparison calculation time. In order to cope with this, it goes without saying that, for example, the performance section is provided with a circuit or the like that executes and outputs the comparison operation in the first half of one cycle.

次に、実施例装置における併合演算処理の基本的な流れ
について説明する。
Next, the basic flow of the merging operation process in the embodiment device will be explained.

CI)先ずリレーション(Rx)をそのキイの値に対し
昇順(小さい順)にソート処理し、レコードの重複検出
を行って重複フラグFを付加した後、第1のレコードバ
ッファメモリ16に格納する。同様にリレーション(R
y)をそのキイの値に対し昇順にソート処理し、レコー
ドの重複検出を行って重複フラグFを付加した後、第2
のレコードバッファメモリ17に格納する。
CI) First, relations (Rx) are sorted in ascending order (smallest to smallest) according to their key values, duplicate records are detected and a duplicate flag F is added, and then stored in the first record buffer memory 16. Similarly, relation (R
y) in ascending order according to the key value, detect duplicate records, add a duplicate flag F, and then
The data is stored in the record buffer memory 17 of.

(II)次に上記各リレーション(Rx)CF?V)の
先頭のレコードに、それぞれポインタ(以降、これを単
にポインタと称する)と、バックアップ用のポインタ(
以降、これをバックアップポインタと称する)を置く。
(II) Next, each of the above relations (Rx) CF? V), a pointer (hereinafter simply referred to as a pointer) and a backup pointer (
Hereinafter, this will be referred to as a backup pointer).

(I)そして上記ポインタが示すレコードを前記レコー
ドバッファメモリ16.17からそれぞれ読出して、そ
のキイの値を相互に比較する。
(I) The records indicated by the pointers are read from the record buffer memories 16 and 17, and the values of their keys are compared with each other.

しかして上記各レコードのキイの値が等しい場された重
複フラグFがO″であり、且つリレーション(Ry)の
レコードに付された重複フラグFがM1″ならば、上記
リレーション(Rx)のポインタをそのままにし、リレ
ーション(RY)のポインタを次のレコードに進める。
Therefore, if the key values of the above records are equal, the duplicate flag F set is O'', and the duplicate flag F attached to the record of the relation (Ry) is M1'', then the pointer of the above relation (Rx) , and advance the relation (RY) pointer to the next record.

■ そして各レコードにそれぞれ付された!?!フラグ
Fの関係が上記■に示される関係以外の場合には、各リ
レーション(Rx)(Ry)のポインタをそれぞれ次に
進める。
■ And it was attached to each record! ? ! If the relationship of flag F is other than the relationship shown in (2) above, the pointers of each relation (Rx) (Ry) are advanced to the next one.

■ 尚、上記レコードのキイの値が等しくない場合には
、レコードの出力は行われない。そして前記キイの値の
小さい方のリレーション、つまり前記ソート処理方向に
若い値のキイを持つリレーションのポインタを次のレコ
ードまで進める。尚、この場合には、前記重複フラグF
はポインタの制御には利用されない。
■ Note that if the key values of the above records are not equal, the record is not output. Then, the pointer of the relation having the smaller key value, that is, the relation having the smaller key value in the sorting direction, is advanced to the next record. In this case, the duplication flag F
is not used to control pointers.

(mV)Lかる後、前記各リレーションに次に比較する
レコードがあれば、前述した([[)の処理に戻り、−
与のリレーションにおいて次に比較するレコードがなく
なれば、上述した処理を終了する。
After calculating (mV)L, if there is a record to be compared next in each relation, return to the process of ([[) described above, and −
When there is no record to be compared next in a given relation, the above-described process ends.

ところで上記(Ill)に示される処理において、2つ
のレコードのキイの値が等しい場合について検討すると
、各リレーションにおけるレコードが重複しているか否
かによって、次の4通りの状態、実貢的に無意味である
が、その場合も考えて、上;:記各状態についてリレー
ション(R4)とリレー1! (1)両レコード共に重複していない場合のリレーショ
ン(R4) (R5)は、例えば次のようになしかして
この場合には、仮にサイクル■の最後でリレーション(
R4)、或いはリレーション(R5)のポインタが指し
ているレコードが残されたとしても、先に進んだ方のポ
インタが指すレコードのキイの値が、残されたレコード
のキイの値より大きいことが明らかであることから、両
リレーションのポインタをそれぞれ同時に更新すること
ができる。
By the way, in the process shown in (Ill) above, if we consider the case where the key values of two records are equal, depending on whether the records in each relation are duplicated or not, there are the following four situations, which are actually ineffective. This is the meaning, but considering that case, the relation (R4) and relay 1 for each state above! (1) The relation (R4) (R5) when both records are not duplicated is, for example, as follows. In this case, if at the end of cycle ■, the relation (
R4), or even if the record pointed to by the relation (R5) pointer remains, the key value of the record pointed to by the pointer to which the pointer went earlier may be greater than the key value of the remaining record. As is obvious, the pointers of both relations can be updated simultaneously.

(2リレーション(R4)のレコードが重複しており、
リレーション(R5)のレコードが重複していない場合
の例は、次のように示される。
(Records of 2 relations (R4) are duplicated,
An example of a case where records of relation (R5) are not duplicated is shown as follows.

この場合には、制約条件を規定するリレーションのみが
重複しているので、サイクル■で両リレーションのポイ
ンタを同時に更新しても、制約演算のレコード比較に不
具合を招来することがない。
In this case, only the relations that define the constraint conditions are duplicated, so even if the pointers of both relations are updated simultaneously in cycle (2), no problem will occur in record comparison for constraint calculations.

(3リレーション(R4)のレコードが重複せず、リレ
ーション(R5)のレコードだけがは重複している場合
には、次のようになる。
(3) If the records of relation (R4) do not overlap and only the records of relation (R5) overlap, the following will occur.

この場合、サイクル■では両リレーションのポインタの
同時が更新ができない。即ち、ポインタの同時更新を行
うと、リレーション(R5)の次のレコード[2/ll
が残されているのに対して、リレーション(R4)が次
のレコード[5]に進み、この結果レコード[2/l]
が出力されなくなる。従って、このサイクル■で示され
るように制約処理される側のリレーションのレコードだ
けが重複している場合には、両ポインタの同時更新はせ
ず、リレーション(R5)側のポインタだけを更新する
In this case, in cycle (2), the pointers of both relations cannot be updated simultaneously. In other words, when the pointers are updated simultaneously, the next record [2/ll
is left behind, whereas relation (R4) advances to the next record [5], resulting in record [2/l]
is no longer output. Therefore, if only the record of the relation on the side subject to constraint processing is duplicated, as shown in cycle (2), only the pointer on the relation (R5) side is updated without updating both pointers simultaneously.

そしてサイクル■では、両レコードの重複フラグFが共
に“O″となるので両レコードのポインタの同時更新を
行う。
Then, in cycle (2), since the duplication flags F of both records become "O", the pointers of both records are updated simultaneously.

(4)両リレーション共にレコードが重複している場合
のリレーションは、例えば次のようになる。
(4) When records overlap in both relations, the relation is, for example, as follows.

サイクル■では、その重複フラグFが共に1″であるか
ら、ポインタを同時に更新しても、条件レコードは連続
して同じ値を示すことになる。従って、各リレーション
のポインタをそれぞれ同時に更新することができる。
In cycle ■, the duplicate flags F are both 1'', so even if the pointers are updated at the same time, the condition records will continue to show the same value.Therefore, it is necessary to update the pointers of each relation at the same time. Can be done.

そしてサイクル■では、重複フラグFが共に“0”とな
ることから、両リレーションのポインタをそれぞれ同時
に更新することができる。
In cycle (2), since both duplication flags F become "0", the pointers of both relations can be updated simultaneously.

次に前述した実施例装置の処理動作につき、リレーショ
ン(R1)(R2)を例に挙げて説明する。尚、ここで
はリレーション(R1)(R2)の各属性の語長が全て
1語長であり、1語長でリレーション(R1)のルーコ
ード、2Ii長でリレーション(R2)ルーコードがそ
れぞれ構成されるものとする。また1語の処理に17エ
ーズ、ルーコードの処理に1サイクルの処理時間がか力
)るものとする。従って、ここではリレーション(R2
)に合せて、1サイクルを27エーズとする。
Next, the processing operation of the above-described embodiment apparatus will be explained using relations (R1) and (R2) as an example. In addition, here, the word length of each attribute of relation (R1) (R2) is all 1 word length, and the lou code of relation (R1) is constructed with 1 word length, and the lou code of relation (R2) is constructed with 2Ii length, respectively. shall be It is also assumed that it takes 17 aces to process one word and one cycle to process a lou code. Therefore, here we use the relation (R2
), one cycle is 27 azes.

先ず最初に、リレーション(R1)を構成する複数のレ
コードを、そのキイ(属性A)の値で昇このリレーショ
ン(R1)の条件データ(レコード)を順次入力して、
先ずそのリレーション中に重複レコードがあるか否かを
検査し、その検査結果をレコードに同期して出力する。
First of all, enter the condition data (records) of this relation (R1) in order by ascending the multiple records that make up the relation (R1) using the value of the key (attribute A).
First, it is checked whether there is a duplicate record in the relation, and the check result is output in synchronization with the record.

この場合、重複するレコードがなく、各レコードに対す
る重複フラグFは全て“0″になる。これを第1のレコ
ードバッファメモリ16に上記各レコードに対応させて
次のように格納する。
In this case, there are no duplicate records, and the duplicate flags F for each record are all "0". This is stored in the first record buffer memory 16 in correspondence with each of the above records as follows.

次に、リレーション(R2)に対して上記リレーション
(R1)と問様なソート処理を施した後、そのリレーシ
ョン中のレコードの重複の有無を検査する。そしてその
検査結果を当該レコードに同期して出力し、前記第2の
レコードバッファメモリγに格納する。従って、リレー
ション(R2]は、例えば次のようになる。
Next, after the relation (R2) and the relation (R1) are subjected to various sorting processes, it is checked whether records in the relation are duplicated or not. Then, the test result is output in synchronization with the record and stored in the second record buffer memory γ. Therefore, the relation (R2) is, for example, as follows.

この重度レコードの検出処理について、説明を付は加え
ると、リレーション(R2)は、上述したソート処理さ
れた順序で与えられる。
To explain this severity record detection process, the relations (R2) are given in the sorted order described above.

第1サイクルでは、1番目のレコードN/r]が入力さ
れる。即ち、その第17エーズでは上記レコードの最初
の語〔1〕が入力され、入力レジスタ11にセットされ
る。この入力レジスタ11にセットされた値(1りがレ
コードバッファメモリ1゛2に格納される。
In the first cycle, the first record N/r] is input. That is, in the 17th aid, the first word [1] of the record is input and set in the input register 11. The value (1) set in this input register 11 is stored in the record buffer memory 1-2.

次の第27エーズで、前記レコードの次の詔[r]が入
力レジスタ11にセットされ、同時に前記レコードバッ
ファメモリ12に格納される。これによって、最初のレ
コードの入力が終了する。
At the next 27th aid, the next edict [r] of the record is set in the input register 11 and stored in the record buffer memory 12 at the same time. This completes the input of the first record.

続く第2サイクルでは次の3つの処理が平行して行われ
る。即ち、2番目のレコード[5/s]を入力して前記
レコードバッファメモリ12に格納する処理、このバッ
ファメモリ12に1サイクル前に格納された第1のレコ
ード[1/rlを読出し、データレジスタ14を介して
次段の回路(レコードバッファメモリンに転送する処理
、そして上記バッフ7メモリ12から読出した1番目の
レコード[1/rコと、入力レジスタ11にセットした
2番目のレコード[5/slとのキイの値を相互に比較
する処理が行われる。
In the subsequent second cycle, the following three processes are performed in parallel. That is, the process of inputting the second record [5/s] and storing it in the record buffer memory 12, reading out the first record [1/rl stored in this buffer memory 12 one cycle before, and storing it in the data register. 14 to the next stage circuit (record buffer memory), and the first record [1/r] read from the buffer 7 memory 12 and the second record [5 A process is performed to mutually compare the key values with /sl.

具体的には、第1フエーズで、2番目のレコードの先頭
の1Rである[5]を入力レジスタ11にセットし、レ
コードバッファメモリ12に格納すると同時に、F I
 FOII能を有するレコードバッフ!り14を介して
次段に転送する。更に上記1番目のレコードの先頭の1
1[1]を比較回路13に与えて、前記入力レジスタ1
1にセットされている値[5]と比較する。この比較の
結果、上記各珀が等しくないことがわかる。従って、フ
ラグ回路15はそのサイクルの最後で重複フラグFを“
O″とする。
Specifically, in the first phase, [5], which is the first 1R of the second record, is set in the input register 11 and stored in the record buffer memory 12, and at the same time, the FI
Record buff with FOII ability! 14 to the next stage. Furthermore, the first 1 of the first record above
1[1] to the comparator circuit 13, and the input register 1
Compare with value [5] which is set to 1. As a result of this comparison, it can be seen that the above-mentioned numbers are not equal. Therefore, the flag circuit 15 sets the duplicate flag F at the end of the cycle.
O''.

続く第2フエーズでは、2番目のレコードの2語目であ
る[S]を入力レジスタ11にセットした後、レコード
バッファメモリ12に格納する。そして、レコードバッ
ファメモリ12から、1番目のレコードの2語目[r]
を読出し、これをデータレジスタ14を経由して出力す
る。この時、レコードの最後の1藷に対する処理なので
、前記比較回路13のイコール信号εに従ってフラグ回
路15から重複フラグF(−0)を、前記2番目の語の
出力に同期して出力する。
In the subsequent second phase, [S], which is the second word of the second record, is set in the input register 11 and then stored in the record buffer memory 12. Then, from the record buffer memory 12, the second word [r] of the first record
is read out and output via the data register 14. At this time, since the processing is for the last word of the record, the flag circuit 15 outputs the duplication flag F(-0) in accordance with the equal signal ε of the comparison circuit 13 in synchronization with the output of the second word.

続く第3サイクルでも同様な処理が行われる。Similar processing is performed in the subsequent third cycle.

このような処理を経て、前記第2のレコードバッファメ
モリ17に、前述したようなリレーション(R2)が格
納されることになる。
Through such processing, the above-mentioned relation (R2) is stored in the second record buffer memory 17.

しかる後、各レコードバッファメモリ16.17にそれ
ぞれ格納されたリレーション間で制約演算が実行される
。この制約演算は、上記各リレーションの先頭レコード
にポインタを置いてから始められる。つまり、前記レコ
ード読出し制御回路18゜19の各アドレスレジスタ2
0に、前記各リレーションの先頭のレコードで、且つ先
頭のデータ、つまりリレーション(R1)における[5
]と、リレーション(R2)におけるレコード[1/r
]の最初の語[1]をそれぞれ指すようにポインタを設
定する。尚、各バックアップレジスタ21には、上記各
アドレスレジスタ20にセットされたデータをセーブす
る。
Thereafter, constraint calculations are performed between the relations stored in each record buffer memory 16, 17. This constraint calculation is started after placing a pointer at the first record of each of the above relations. In other words, each address register 2 of the record read control circuit 18, 19
0, the first record of each relation and the first data, that is, [5 in relation (R1)]
] and the record [1/r
] Set pointers to point to the first word [1] of each. Incidentally, each backup register 21 saves the data set in each address register 20 described above.

出力されない。No output.

即ち、この第1サイクルでは、次の2つの処理が平行し
て行われる。但し、前述した重複レコードの検出処理に
おける第1サイクルと、ここでの第1サイクルとは興な
るタイミングである。
That is, in this first cycle, the following two processes are performed in parallel. However, the first cycle in the duplicate record detection process described above and the first cycle here are critical timings.

ここでは先ず前記各レコードバッファメモリ16゜17
から前記レコード読出し制御回路18.19の各アドレ
スレジスタ20によって示される値(語)を読出し、デ
・−タレジスタ22.23にセットした後、その値(語
)を比較回路24にて比較する。同時に、上記データレ
ジスタ22.23にそれぞれセットした値を第3および
14のレコードバッファメモリ26゜27に格納する。
Here, first, each of the record buffer memories 16 and 17
The values (words) indicated by each address register 20 of the record read control circuit 18, 19 are read out from the record read control circuit 18, 19 and set in the data registers 22, 23, and then the values (words) are compared in the comparator circuit 24. At the same time, the values set in the data registers 22 and 23 are stored in the third and fourteenth record buffer memories 26 and 27.

そして、そのサイクルの最後で、前記各レコードバッフ
ァメモリ16.17から次に読み出すレコードを決める
At the end of the cycle, the next record to be read from each record buffer memory 16, 17 is determined.

具体的にはその第17エーズにおいて、第1および第2
のレコードバッファメモリ16.17から各レコードの
最初の語[5][11を同時に読出し、これらをデータ
レジスタ22.23にセットして比較回路24で比較す
る。この時、両者の値は一致しなように通知する そしてレコード読出し制御回路19のアドレスレジスタ
20をカウントアツプする。
Specifically, in the 17th aid, the first and second
The first words [5] and [11] of each record are simultaneously read from the record buffer memories 16 and 17 of the record buffer memory 16 and 17, set in the data registers 22 and 23, and compared by the comparison circuit 24. At this time, it is notified that the two values do not match, and the address register 20 of the record read control circuit 19 is counted up.

このとき、前記各データレジスタ22.23にそれぞれ
セットした値[5]H]を、前記M3およjll ・−び第4のレコードバッファメモリ26.27にそれ
ぞ続く第2フエーズでは、前記第2のレコードバッファ
メモリ11から読出した次の語のI[rlをデータレジ
スタ23を介して前記第4のレコードバッファメモリ2
7に格納する。
At this time, the value [5]H] set in each of the data registers 22.23 is transferred to the M3, jll, and fourth record buffer memories 26, 27, respectively, in the second phase. The next word I[rl read from the second record buffer memory 11 is sent to the fourth record buffer memory 2 via the data register 23.
Store in 7.

そしてこの第2フエーズから次のフェーズである第2サ
イクルの最初のフェーズに移る時、リレーション(R1
)のキイの値の方が大きいので、前述したようにリレー
ション(R2)のポインタだけを先に進める。つまり、
レコード読出し制御回路18のアドレスレジスタ20に
は、そのバックアップレジスタ21に格納された値をロ
ードし、先頭のし]−ド[5]をもう一度読み出せるよ
うにする。他方、レコード読出しII t1回路19の
アドレスレジスタ20については、そのままカウントア
ツプし、次のレコード[5/S]を読出せるようにする
。そして、次の第2サイクルの最初で、上記アドレスレ
ジスタ20のカウントアツプされた値をバックアップレ
ジスタ21にセーブする。
Then, when moving from this second phase to the next phase, the first phase of the second cycle, the relation (R1
) is larger, so as described above, only the pointer of relation (R2) is advanced. In other words,
The address register 20 of the record read control circuit 18 is loaded with the value stored in the backup register 21, so that the leading address [5] can be read out again. On the other hand, the address register 20 of the record read II t1 circuit 19 continues to count up so that the next record [5/S] can be read. Then, at the beginning of the next second cycle, the counted up value of the address register 20 is saved in the backup register 21.

フェーズの終わりでは、比較結果が同値であり、且つリ
レーション(R1)の重複フラグFが“O”であり、リ
レーション(R2)の重複フラグFが“1″なので、リ
レーション(R2)のポインタだけを先に進める。つま
り、レコード読出し制御回路19のアドレスレジスタ2
0をカウントアツプし、次の第3サイクルの先頭でその
値をバックアップレジスタ21にセーブする。そしてレ
コード読出し制御回路18では、バックアップレジスタ
21に格納されている値をアドレスレジスタ20にロー
ドする。
At the end of the phase, the comparison results are the same, and the duplicate flag F of relation (R1) is "O" and the duplicate flag F of relation (R2) is "1", so only the pointer of relation (R2) is used. Proceed. In other words, the address register 2 of the record read control circuit 19
0 is counted up and the value is saved in the backup register 21 at the beginning of the next third cycle. Then, the record read control circuit 18 loads the value stored in the backup register 21 into the address register 20.

しかして次の第3サイクルでは、上記3つの処理に加え
て、出力制御回路25の制御の下でレコードの出力処理
が行われる。
In the next third cycle, in addition to the above three processes, record output processing is performed under the control of the output control circuit 25.

つまり、その第17エーズでは、第2のレコードバッフ
ァメモリ27から条件が適合したレコードの最初の語[
2]が選択回路28を介して読出され、出力レジスタ2
9にセットされた後、出力される。
That is, in the 17th aid, the first word [[
2] is read out via the selection circuit 28 and output to the output register 2.
After being set to 9, it is output.

この結果、前記リレーション(R1)(R2)の間で制
約演算された出力結果であるリレーション(R31の第
1番目のレコード[2/q]が得られる。
As a result, the first record [2/q] of the relation (R31), which is the output result of the constraint calculation between the relations (R1) and (R2), is obtained.

また、このサイクルでは前記第1および第2のレコード
バッファメモリ16.17から読出したレコードのキイ
の値が[5]と[5/k]として、一致結果が得られて
いる。従って、次の第4サイクルでは、上記レコード[
5/klが出力される。
Further, in this cycle, the key values of the records read from the first and second record buffer memories 16 and 17 are [5] and [5/k], and a matching result is obtained. Therefore, in the next fourth cycle, the above record [
5/kl is output.

また、この第3サイクルの第27エーズの終わりでは、
上記レコードのキイの値の比較結果が同値であり、且つ
両リレーションの!!?!フラグFの値が共に“0゛′
なので、両リレーションのポインタが先に進められる。
Also, at the end of the 27th Aze of this third cycle,
The comparison result of the key values of the above records is the same value, and both relations! ! ? ! Both values of flag F are “0゛′”
Therefore, the pointers of both relations are advanced.

つまり、レコード読出し制−回路18.19の各アドレ
スレジスタ20がそれぞれカウントアツプされ、次の第
4サイクルの先頭でその値が各バックアップレジスタ2
1にセーブされる。
In other words, each address register 20 of the record read control circuit 18 and 19 is counted up, and at the beginning of the next fourth cycle, the value is updated to each backup register 20.
1 is saved.

第4サイクルでは、各レコードのキイの値が異なり、リ
レーション〔R1)の値の方が大きいの制約演算が終了
する。
In the fourth cycle, the key values of each record are different, and the constraint calculation ends when the value of the relation [R1] is larger.

以上説明したように本装置では、レコードのキイの値の
比較結果が等しい時、リレーション(R1)が重複して
いない状態で、且つリレーション(R2)が重複してい
る時を除いて、両レコードのポインタをそれぞれ同時に
先に進めることができる。従って各リレーションのレコ
ードの読出しの効率の向上を図ることができ、制約演算
処理の  ′所要時間を大幅に短縮することが可能とな
る。しかも、簡易に制約演算処理を実行することが可能
となる。
As explained above, in this device, when the comparison results of the key values of the records are equal, except when the relation (R1) is not duplicated and the relation (R2) is duplicated, both records pointers can be advanced simultaneously. Therefore, it is possible to improve the efficiency of reading records of each relation, and it is possible to significantly shorten the time required for constraint calculation processing. Furthermore, it becomes possible to easily execute constraint calculation processing.

尚、本発明は上述した実施例に限定されるものではない
。例えば各リレーションを構成するレコードの数、およ
び各レコードを構成する属性の数、各属性の語長等はデ
ータベースの仕様等に応じて定めれば0.!い。またそ
の制約条件も種々の目的に応じて設定できる。要するに
、本発明はその要旨を逸脱しない範囲で種々変形して実
施することができる。
Note that the present invention is not limited to the embodiments described above. For example, the number of records that make up each relation, the number of attributes that make up each record, the word length of each attribute, etc. can be determined according to the specifications of the database. ! stomach. Moreover, the constraint conditions can also be set according to various purposes. In short, the present invention can be implemented with various modifications without departing from the gist thereof.

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

Claims (1)

【特許請求の範囲】[Claims] 所定の規則に従って複数のレコードをそれぞれソート処
理した第1および第2のリレーションを演算部に入力し
、各リレーションのレコード間で関係演算を施して上記
第1のリレーションのレコードで特定される前記第2の
リレーション中のレコードを選択して出力するデータ処
理装置において、上記演算部は前記第1および第2のリ
レーションにおけるレコードの重複をそれぞれ検出する
手段と、この重複検出結果を前記第1および第2のリレ
ーションの各レコードに対応させてそれぞれ記憶する第
1および第2のレコードバッファメモリと、これらの第
1および第2のレコードバッファメモリからそれぞれ読
出されたレコードを相互に比較する比較回路と、この比
較結果に従って上記レコードの出力を制御する手段と、
前記比較された各レコードにそれぞれ付された重複検出
結果とその比較結果とに従って前記第1および第2のレ
コードバッファメモリから次に読出す前記第1および第
2のリレーションのレコードを制御する手段とを具備し
、前記第1および第2のレコードバッファメモリからの
各レコードの読出しを制御する手段は、上記第1および
第2のレコードバッファメモリからそれぞれ読出された
各レコードの比較結果が等しく、且つ前記第2のレコー
ドバッファメモリから読出されたレコードだけが重複レ
コードとして示されるとき、上記第2のレコードバッフ
ァメモリから次に読出すレコードのみを更新し、他の場
合には前記第1および第2のレコードバッファメモリか
ら次に読出すレコードをそれぞれ更新してなり、前記第
1および第2のレコードバッファメモリからそれぞれ読
出された各レコードの比較結果が等しくないときにはレ
コードが前記ソート処理方向に若い値を示す側のリレー
ションのレコードを更新してなることを特徴とするデー
タ処理装置。
The first and second relations obtained by sorting a plurality of records according to a predetermined rule are inputted to the calculation unit, and a relational operation is performed between the records of each relation to obtain the first relation specified by the record of the first relation. In the data processing device that selects and outputs records in two relations, the arithmetic unit includes means for detecting duplication of records in the first and second relations, respectively, and a means for detecting duplication of records in the first and second relations, and a means for detecting duplicate records in the first and second relations. first and second record buffer memories that respectively store records in correspondence with the records of the second relation, and a comparison circuit that mutually compares the records read from the first and second record buffer memories, respectively; means for controlling the output of the record according to the comparison result;
means for controlling records of the first and second relations to be read next from the first and second record buffer memories according to the duplication detection results attached to each of the compared records and the comparison results; and means for controlling reading of each record from the first and second record buffer memories, the comparison result of each record read from the first and second record buffer memories is equal, and When only the record read from the second record buffer memory is indicated as a duplicate record, only the record to be read next from the second record buffer memory is updated; otherwise, the first and second records are updated. The next record to be read from the record buffer memory of the record buffer memory is updated, and when the comparison results of the records read from the first and second record buffer memories are not equal, the record is set to a smaller value in the direction of the sorting process. A data processing device characterized in that the data processing device updates a record of a relation on the side that indicates.
JP59231253A 1984-11-05 1984-11-05 Data processor Granted JPS61110234A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59231253A JPS61110234A (en) 1984-11-05 1984-11-05 Data processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59231253A JPS61110234A (en) 1984-11-05 1984-11-05 Data processor

Publications (2)

Publication Number Publication Date
JPS61110234A true JPS61110234A (en) 1986-05-28
JPH0373021B2 JPH0373021B2 (en) 1991-11-20

Family

ID=16920718

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59231253A Granted JPS61110234A (en) 1984-11-05 1984-11-05 Data processor

Country Status (1)

Country Link
JP (1) JPS61110234A (en)

Also Published As

Publication number Publication date
JPH0373021B2 (en) 1991-11-20

Similar Documents

Publication Publication Date Title
US5060143A (en) System for string searching including parallel comparison of candidate data block-by-block
US10262081B2 (en) Method and apparatus for improved database searching
US11210280B2 (en) Systems and methods for fast bloom filter operations
JPS61110234A (en) Data processor
KR0134036B1 (en) Apparatus for performing logic simulation
RU2659492C1 (en) Unification unit with parallel comparison of terms
JP5139335B2 (en) Data search device, data search method, and data search program
JPH0373020B2 (en)
JPH09153048A (en) Method and device for information retrieval
JPS61110232A (en) Data processor
Narasimhan et al. Early comparison and decision strategies for datapaths that recover from transient faults
JP2729491B2 (en) Variable length character string detector
JP2735255B2 (en) Hatching treatment method
JPH02289005A (en) Alignment processing system for count information
JPH0520350A (en) Vector processing device
Kamiya et al. A hardware pipeline algorithm for relational database operation
JP2716254B2 (en) List vector processing device
SU1571676A2 (en) Associative memory device
JP2539079B2 (en) Column data selection processing circuit
JPH03161883A (en) Microprocessor
JP2590866B2 (en) Data retrieval device
JPH01133134A (en) Key value overlap checking system
JPS63193228A (en) Character string matching device
JPS61110233A (en) Data processor
JPH06314226A (en) Data update method

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term