JPH0373020B2 - - Google Patents

Info

Publication number
JPH0373020B2
JPH0373020B2 JP59231254A JP23125484A JPH0373020B2 JP H0373020 B2 JPH0373020 B2 JP H0373020B2 JP 59231254 A JP59231254 A JP 59231254A JP 23125484 A JP23125484 A JP 23125484A JP H0373020 B2 JPH0373020 B2 JP H0373020B2
Authority
JP
Japan
Prior art keywords
record
buffer memory
records
input
circuit
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.)
Expired - Lifetime
Application number
JP59231254A
Other languages
Japanese (ja)
Other versions
JPS61110235A (en
Inventor
Shigeo Kamya
Kazuhide Iwata
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 JP59231254A priority Critical patent/JPS61110235A/en
Publication of JPS61110235A publication Critical patent/JPS61110235A/en
Publication of JPH0373020B2 publication Critical patent/JPH0373020B2/ja
Granted legal-status Critical Current

Links

Landscapes

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

Description

【発明の詳細な説明】[Detailed description of the invention]

〔発明の技術分野〕 本発明は、ソート処理されたリレーシヨンに対
してマージ・ソート処理を基準にした関係演算に
より射影演算を効率良く実行し得るデータ処理装
置に関する。 〔発明の技術的背景とその問題点〕 大容量記録装置の進歩に伴い、その大容量記録
装置上で大規模なデータベースを構築する計算機
システムが増えてきている。ところが、データベ
ースが大規模になる程、該データベースから必要
なデータを検索するに必要な時間が長くなるとい
う問題が生じている。これを解決する方法の1つ
として、検索に必要な処理、つまり関係演算を専
用ハードウエアで実行することが種々提唱されて
いる。 しかして、マージ・ソート処理をベースとした
関係演算を実行する従来のデータ処理装置にあつ
ては、予めソート処理されている2つのリレーシ
ヨン間の各レコードを相互に比較し、その比較結
果に応じて上記2つのリレーシヨンの一方から選
択的にレコードを出力する動作を基本としている
ので、例えば上記データベース検索で必要な射影
演算を行うことが困難であると云う不具合があつ
た。 即ち、この射影演算(projection)は、例えば
リレーシヨン{R1}
[Technical Field of the Invention] The present invention relates to a data processing device that can efficiently perform a projection operation on sorted relations using a relational operation based on a merge/sort process. [Technical background of the invention and its problems] With the advancement of large-capacity storage devices, the number of computer systems that construct large-scale databases on the large-capacity storage devices is increasing. However, as the database becomes larger, a problem arises in that the time required to search the database for necessary data becomes longer. As one method for solving this problem, various proposals have been made to execute the processing necessary for the search, that is, the relational calculations, using dedicated hardware. However, in conventional data processing devices that execute relational operations based on merge/sort processing, each record between two relations that has been sorted in advance is compared with each other, and the results of the comparison are Since the method is based on the operation of selectively outputting records from one of the two relations in response to the above, there is a problem that, for example, it is difficult to perform the projection calculation necessary for the database search. That is, this projection operation is, for example, relation {R1}

【表】 から、そのキイ(属性A、属性B)の値が等しい
レコードを取り除いて、新しいリレーシヨン
{R2}を
From [Table], remove records whose keys (attribute A, attribute B) have the same value and create a new relation {R2}.

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

本発明はこのような事情を考慮してなされたも
ので、その目的とするところは、例えばデータベ
ース検索処理に必要な射影演算を簡易に、且つ高
速に実現することができるデータ処理装置を提供
することにある。 〔発明の概要〕 本発明は、所定の規則に従つてソート処理が施
された複数のレコードからなるリレーシヨンを入
力する時、前記リレーシヨンに対して関係演算を
施す演算部の入力部分にレコードバツフアメモリ
と、このレコードバツフアメモリから読出される
レコードの属性(キイ)の値が、現入力レコード
の属性(キイ)の値と等しいか否かを検出する検
出手段(比較回路)を設けることによつて、連続
して入力されるレコードが等しいか否かを検出
し、この検出結果に従つて前記レコードを出力す
るか否かを決定してその出力制御部に通知し、レ
コードの出力を制御することにより射影演算を実
行できるようにしたものである。 さらに、本発明ではソート処理が正しく行われ
たか否かをチエツクする機能を有する。すなわち
ソート検査回路を設けレコードのキイの値が所定
の規則(昇順)に従う大小関係にないと検出され
た場合、ソート検査回路はソート処理部に対し複
数のレコードに対するソート処理を再度行うよう
指示することを特徴とするデータ処理装置であ
る。 〔発明の効果〕 かくして本発明によれば、所定のソート処理が
施されたリレーシヨンの順次入力されるレコード
が、次に入力されるレコードと等しいか否かを検
出し、等しい場合には該レコードの出力を阻止
し、且つ等しくない場合にのみ該レコードを順に
出力するので、出力されたレコードのリレーシヨ
ンは入力リレーシヨン中の重複レコードを取除い
たものとなる。従つてここに、従来ソフトウエア
に頼つていた射影演算を簡易に、且つ高速に実行
することが可能となる。しかも、演算部にレコー
ドバツフアメモリと比較回路とを設けるだけで、
そのハードウエアを簡易に構築することができる
等の実用上多大なる効果を奏する。 さらに、ソート検査回路を設けソート処理が正
しく行われたかどうかを検出し、正しく行われな
かつた場合に先に行われたレコードのソート処理
を再度行わせるように設定されているためソート
処理の誤りによる誤つた出力及び無駄な処理を行
うことがない。 〔発明の実施例〕 以下、図面を参照して本発明の一実施例につき
説明する。 第1図は本発明の実施例に係るデータ処理装置
の概略構成図である。データ処理装置は、基本的
にはマージ・ソート処理をベースとした関係演算
を実行する演算部1と、その関係演算結果の出力
制御を行う出力制御部2とにより構成される。 所定の規則に従つてソート処理が施された1つ
のリレーシヨンを構成する複数のレコードは、該
データ処理装置の演算部1に順次入力される。こ
の演算部1には順次入力されるレコードの1語を
セツトする入力レジスタ11と、1レコード分の
記憶容量を持ち、且つFIFO(フアーストイン・フ
アーストアウト)機能を有する第1のレコードバ
ツフアメモリ12と、この第1のレコードバツフ
アメモリ12から読み出されるキイの値(語)と
前記入力レジスタ11にセツトされているキイの
値(語)とを比較する比較回路13と、前記第1
レコードバツフアメモリ12から読み出されるレ
コードの1語分をセツトするデータレジスタ14
と、比較回路13のイコール信号Eを重複フラグ
Fとして格納するフラグ回路15とを備えて構成
される。 尚、比較回路13は語単位でレコードの一致検
出を行い、その検出結果に従つてイコール信号E
を出力している。しかしてレコードの一致は、そ
のレコードを構成する複数の語の全てが一致した
ときである。この為、上記比較回路13が出力す
るイコール信号Eを入力するフラグ回路15は、
前記レコードバツフアメモリ12に格納されたレ
コードの最後の1語を読出して上記比較に供し、
同時にその最後の1語をデータレジスタ14にセ
ツトする時、始めて重複フラグFを出力するもの
となつている。 ところでこのようにして語単位てレコードのキ
イの各値を比較判定しているので、その処理対象
レコードが、その後に続くレコードと重複してい
ることが判明するタイミングは、該レコードの最
後の語の比較結果を得たときとなる。この為、前
記第1のレコードバツフアメモリ12のデータレ
ジスタ14を介して語単位で順に出力されるレコ
ードを、一旦バツフアリングする必要がある。出
力制御部2に設けられた第2のレコードバツフア
メモリ16は、このようなバツフアリングを目的
としたもので、前記データレジスタ14を介して
演算部1から出力されるレコードを順に格納とて
いる。 しかして出力制御回路17は前記演算部1から
の重複フラグFを入力して、上記第2のレコード
バツフアメモリ16に格納されたレコードが、そ
のレコードに続く次のレコードと重複しているか
否かを判定している。そして、重複フラグFの入
力がなく(F=0)、該レコードが前記リレーシ
ヨン中で、次のレコードと重複していない場合に
は、出力制御回路17は出力レジスタ18を介し
て前記第2のレコードバツフアメモリ16に格納
されたレコードを出力している。また前記重複フ
ラグF(F=1)が入力されたとき、出力制御回
路17は前記第2のレコードバツフアメモリ16
に格納されたレコードの出力を阻止している。従
つて、次に続くレコードと等しいと判定されたレ
コードは、出力制御部2から出力されないように
なつている。 尚、ここでは本発明の要旨と直接関係していな
いことから図示していないが、演算部1には現在
キイ・フイールドを処理中か否かを示す回路や、
レコードの最後の1語を処理中か否かを示す回路
等が設けられることは云うまでもない。 尚、第2図に示すように前記演算部1に、前記
比較回路13の比較結果(<、=、>)を入力する
ソート検査回路19を設け、上記レコードバツフ
アメモリ12から読出される1サイクル前の入力
レコードと、入力レジスタ11にセツトされた現
入力レコードとの比較結果から、複数のレコード
に対してソート処理部3で施されたソート処理
が、正しく行われたか否かを検査するようにして
も良い。即ち、昇順でソート処理が行われた場
合、現入力レコードのキイの値は、先に入力され
たレコードのキイ値より大きいか、或いは等しい
はずである。従つて、このようなレコード条件を
前記比較回路13の比較結果から判定すれば、そ
のソート処理が正しく行われたか否かを容易に判
定することが可能となる。そしてソート処理の誤
りを検出した場合には、速やかに入力リレーシヨ
ンに対する射影演算を停止するようにすれば、そ
の無駄な処理を招くことがなくなる。同時に、前
記ソート処理部3に対して前記複数のレコードに
対するソート処理のやり直しを指示すれば、速や
かに射影演算を再開することが可能となる。 次に、本装置における射影演算処理の流れを具
体例を挙げて説明する。 本装置における射影演算は、基本的には次のよ
うに行われる。 () 先ずリレーシヨン{Rx}をそのキイの値
に対して、例えば昇順(小さい順)にソート処
理する。例えばリレーシヨン{R1}の属性A
と属性Bを1つの属性と看做してソート処理を
行う。このソート処理は、ソフトウエア、或い
はソート処理専用のハードウエア(図示せず)
によつて行われる。この結果、例えば次のよう
なリレーシヨンが得られる。
The present invention has been made in consideration of these circumstances, and its purpose is to provide a data processing device that can easily and quickly implement projection operations necessary for, for example, database search processing. There is a particular thing. [Summary of the Invention] According to the present invention, when a relation consisting of a plurality of records that has been sorted according to a predetermined rule is input, the record is input to the input part of a calculation unit that performs a relational operation on the relation. A buffer memory and a detection means (comparison circuit) for detecting whether the value of the attribute (key) of the record read from the record buffer memory is equal to the value of the attribute (key) of the current input record are provided. By detecting whether consecutively input records are equal or not, it is determined whether or not to output the record according to this detection result, and the output control unit is notified, and the record is output. The projection calculation can be executed by controlling the . Furthermore, the present invention has a function of checking whether the sorting process has been performed correctly. In other words, if a sorting inspection circuit is provided and it is detected that the key values of records do not have a magnitude relationship according to a predetermined rule (ascending order), the sorting inspection circuit instructs the sorting processing section to perform the sorting process on multiple records again. This is a data processing device characterized by the following. [Effects of the Invention] Thus, according to the present invention, it is detected whether or not records that are sequentially input in relations that have been subjected to a predetermined sorting process are equal to records that are input next, and if they are equal, the record is determined to be the same. Since the records are prevented from being output and the records are sequentially output only if they are not equal, the output record relation is the one in which the duplicate records in the input relation have been removed. Therefore, projection calculations that conventionally relied on software can now be performed easily and at high speed. Moreover, by simply providing a record buffer memory and a comparison circuit in the calculation section,
This has great practical effects, such as being able to easily construct the hardware. Furthermore, a sorting check circuit is installed to detect whether the sorting process has been performed correctly, and if it is not performed correctly, it is set to re-sort the records that were previously performed, resulting in an error in the sorting process. This prevents erroneous output and wasteful processing. [Embodiment of the Invention] Hereinafter, an embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a schematic configuration diagram of a data processing device according to an embodiment of the present invention. The data processing device basically includes a calculation unit 1 that executes relational calculations based on merge/sort processing, and an output control unit 2 that controls the output of the results of the relational calculations. A plurality of records constituting one relation, which have been sorted according to a predetermined rule, are sequentially input to the calculation unit 1 of the data processing device. This arithmetic unit 1 includes an input register 11 for setting one word of a record that is input sequentially, and a first record buffer memory that has a storage capacity for one record and has a FIFO (first-in, first-out) function. 12, a comparison circuit 13 for comparing the key value (word) read from the first record buffer memory 12 and the key value (word) set in the input register 11;
A data register 14 that sets one word of the record read from the record buffer memory 12.
and a flag circuit 15 that stores the equal signal E of the comparison circuit 13 as a duplication flag F. Note that the comparison circuit 13 detects matching records word by word, and outputs an equal signal E according to the detection result.
is outputting. Thus, a record matches when all of the plurality of words that make up the record match. Therefore, the flag circuit 15 to which the equal signal E outputted from the comparison circuit 13 is input,
reading the last word of the record stored in the record buffer memory 12 and providing it for the comparison;
At the same time, when the last word is set in the data register 14, the duplication flag F is output for the first time. By the way, since each key value of a record is compared word by word in this way, the timing when it becomes clear that the record to be processed overlaps with the record that follows is the last word of the record. This is when the comparison result is obtained. For this reason, it is necessary to buffer the records that are sequentially output word by word via the data register 14 of the first record buffer memory 12. A second record buffer memory 16 provided in the output control section 2 is intended for such buffering, and stores records outputted from the calculation section 1 via the data register 14 in order. . The output control circuit 17 inputs the duplication flag F from the arithmetic unit 1 and determines whether the record stored in the second record buffer memory 16 overlaps with the next record following that record. We are determining whether Then, if there is no input of the duplication flag F (F=0) and the record does not overlap with the next record in the relation, the output control circuit 17 sends the second record through the output register 18. The records stored in the record buffer memory 16 are output. Further, when the duplication flag F (F=1) is input, the output control circuit 17 controls the second record buffer memory 16.
is preventing the output of records stored in . Therefore, a record that is determined to be equal to the next record is not output from the output control unit 2. Although not shown here because it is not directly related to the gist of the present invention, the calculation unit 1 includes a circuit that indicates whether or not a key field is currently being processed;
Needless to say, a circuit or the like is provided to indicate whether or not the last word of the record is being processed. As shown in FIG. 2, the arithmetic unit 1 is provided with a sort check circuit 19 that inputs the comparison results (<, =, >) of the comparison circuit 13, and the sort check circuit 19 inputs the comparison results (<, =, >) of the comparison circuit 13. Based on the comparison result between the input record before the cycle and the current input record set in the input register 11, it is checked whether the sort processing performed on the plurality of records by the sort processing unit 3 was performed correctly. You can do it like this. That is, when sorting is performed in ascending order, the key value of the current input record should be greater than or equal to the key value of the previously input record. Therefore, by determining such record conditions from the comparison results of the comparison circuit 13, it becomes possible to easily determine whether or not the sorting process has been performed correctly. If an error in the sorting process is detected, the projection calculation for the input relation is immediately stopped, thereby eliminating unnecessary processing. At the same time, by instructing the sort processing unit 3 to redo the sorting process on the plurality of records, it becomes possible to promptly restart the projection calculation. Next, the flow of projection calculation processing in this apparatus will be explained using a specific example. Projection calculations in this device are basically performed as follows. () First, the relation {Rx} is sorted, for example, in ascending order (smallest first) with respect to its key value. For example, attribute A of relation {R1}
and attribute B are regarded as one attribute and the sorting process is performed. This sorting process can be performed using software or dedicated hardware for sorting (not shown).
It is carried out by. As a result, the following relations are obtained, for example.

【表】 このようなリレーシヨンの各レコードを語単
位で順次入力して、本装置による射影演算が次
のようにして実行される。 () 演算部1では、リレーシヨンの先頭のレコ
ードにポインタを置く。 () 次に重複フラグFが“0”であれば、上記
ポインタで示されるレコードを出力し、上記重
複フラグFが“1”であれば該レコードの出力
を阻止する。その後、前記ポインタを次のレコ
ードに進める。 () そして、前記リレーシヨン中に次のレコー
ドがあれば上記()の処理に戻り、該リレー
シヨン中に次のレコードがない場合には、その
処理を終了する。 この処理フローにおける前記()〜()の
処理について更に詳しく説明する。 尚、本実施例におけるリレーシヨン{R1}の
各レコードはそれぞれ複数の属性からなる。そこ
でここでは各属性の語長が、全て1語長であり、
各レコードのレコード長が2語長で与えられるも
のとする。そして1語を処理する時間を1フエー
ズとし、1レコードを処理する時間を1サイクル
として、つまり2フエーズを1サイクルとして動
作するものとする。 さて射影演算を実行するには、ソート処理され
たリレーシヨン中の連続する2個のレコードのみ
が必要である。そこで連続する2つのレコード入
力する毎に、その実行を開始する。つまり上述し
たリレーシヨンの最初の2個のレコード[1/
r]と[2/q]とが入力されたとき、演算部1
にて該2つのレコードが重複しているか否かを検
査し、その検査結果を重複フラグFとして該レコ
ードに同期して出力制御部2に出力する。この処
理をレコードが1つづつ入力される都度、先に入
力されたレコードとの間で行う。 即ち、第0サイクルでは、レコード[1/r]
を入力して第1のレコードバツフアメモリ12に
記憶する。具体的には、その第1フエーズで1番
目のレコードの最初の後[1]を入力し、これを
入力レジスタ11にセツトする。そして、データ
(語)を第1のレコードバツフアメモリ12に格
納する。次の第2フエーズでは前記レコードの次
の語[r]を入力レジスタ11にセツトし、これ
を第1のレコードバツフアメモリ12に格納す
る。以上の第0サイクルで、最初のレコードの入
力が終了し、そのレコードが第1のレコードバツ
フアメモリ12に格納された状態となる。 続く第1サイクルでは、以下に示す3つの処理
が平行して実行される。 その1つは2番目のレコード[2/q]を入力
し、第1のレコードバツフアメモリ12に格納す
る処理であり、この処理は上記第0サイクルの場
合と同様に行われる。この場合、レコードバツフ
アメモリ12のFIFO機能によつて、該レコード
バツフアメモリ12に先のサイクルで格納された
レコードが上記レコードの格納に同期して1語づ
つ読出される。2つ目の処理は、第1のレコード
バツフアメモリ12から読出される1番目のレコ
ードと、現入力状態があり前記入力レジスタ11
にセツトされた2番目のレコードと比較する動作
である。そして3つ目の処理は、前記第1のレコ
ードバツフアメモリ12から読出される1番目の
レコードを出力制御部2に転送して第2のレコー
ドバツフアメモリ16に格納する動作である。 即ち、第1フエーズでは、2番目のレコードの
先頭の1語である[2]が入力され、入力レジス
タ12にセツトされる。このデータが前記第1の
レコードバツフアメモリ12に格納されると共
に、FIFO機能を有している第1のレコードバツ
フアメモリ12から、1サイクル前に記憶したレ
コード(=1番目のレコード)の先頭の語が読出
される。そしてこのレコードバツフアメモリ12
から読出されるデータ、即ち1番目のレコードの
先頭の1語である[1]は、出力制御部2の第2
のレコードバツフアメモリ16に転送されると共
に、前記入力レジスタ11にセツトされている値
(2番目のレコードの先頭の1語である[2])と
前記比較回路13で相互に比較される。 続く第2フエーズでは、2番目の入力レコード
の2語目[q]が入力レジスタ11にセツトさ
れ、第1のレコードバツフアメモリ12に格納さ
れると共に、比較回路13にてレコードバツフア
メモリ12から読出される1番目のレコードの2
番目の語[r]と比較される。この第2フエーズ
は、レコードの最後の1語の処理であり、レコー
ド[1/r]と[2/q]とが不一致なので、前
記比較回路13のイコール信号Eは“0”であ
り、これを受けてフラグ回路15は重複フラグF
を“0”とする。 以上によつて第1サイクルが終了し、第1のレ
コードバツフアメモリ12には2番目のレコード
が格納され、第2のレコードバツフアメモリ16
には前記1番目のレコードが格納される。そして
出力制御回路17には、第2のレコードバツフア
メモリ16に格納された1番目のレコードが次の
レコードと重複しているか否かのフラグ情報が格
納される。 出力制御回路17はこの重複フラグFの情報に
従つて、次の第3サイクルで、前記第2のレコー
ドバツフアメモリ16に記憶したレコード[1/
r]の出力を制御する。この場合には、上記重複
フラグFが”0”でそのレコードが次のレコード
と重複していないことが示されるので、前記レコ
ード[1/r]はそのまま出力される。 しかして次の第3サイクルでは、上述した3つ
の処理に加えて、前記重複フラグFに従うレコー
ドの出力制御が行われる。このときには、前述し
た3つの処理によつて次に入力される3番目のレ
コードに対する処理、および2番目のレコードと
の比較処理と、該2番目のレコードの第2のレコ
ードバツフアメモリ16への転送が行われること
は云うまでもない。 しかしてこの第3サイクルでは上記重複フラグ
Fが”0”でそのレコードが次のレコードと重複
していないことが示されるので、前記レコード
[1/r]はそのまま出力される。 そして、続く第4サイクルでは、第3サイクル
における2番目のレコードと3番目のレコードと
の比較によつて、その一致が検出され、重複フラ
グFが”1”となつていることから、出力制御回
路17は第2のレコードバツフアメモリ16に格
納された2番目のレコード[2/q]の出力を阻
止している。つまり次のレコードと重複するレコ
ードが、出力されないようになつている。 以下、同様な処理が上記サイクルを繰返して実
行され、入力レコードの全てに対する処理が終了
するまで行われる。 かくして本装置によれば第2のレコードバツフ
アメモリ16に、重複フラグFを付加した形とし
て、次のようなリレーシヨンを得る。
[Table] Each record of such a relation is inputted word by word sequentially, and the projection calculation by this apparatus is executed as follows. () In the calculation unit 1, a pointer is placed at the first record of the relation. () Next, if the duplication flag F is "0", the record indicated by the pointer is output, and if the duplication flag F is "1", the output of the record is blocked. The pointer is then advanced to the next record. () If there is a next record in the relation, the process returns to the process in () above, and if there is no next record in the relation, the process ends. The above-mentioned processes () to () in this process flow will be explained in more detail. Note that each record of relation {R1} in this embodiment is composed of a plurality of attributes. Therefore, here, the word length of each attribute is all one word length,
It is assumed that the record length of each record is given as a two-word length. It is assumed that the time to process one word is one phase, and the time to process one record is one cycle, that is, two phases are one cycle. Now, to perform the projection operation, only two consecutive records in the sorted relation are required. Then, every time two consecutive records are input, the execution is started. In other words, the first two records [1/
r] and [2/q] are input, the calculation unit 1
It is checked whether the two records are duplicated or not, and the check result is output as a duplication flag F to the output control unit 2 in synchronization with the record. This process is performed each time a record is input one by one and between records that were input earlier. That is, in the 0th cycle, record [1/r]
is input and stored in the first record buffer memory 12. Specifically, in the first phase, [1] is input after the beginning of the first record, and this is set in the input register 11. The data (words) are then stored in the first record buffer memory 12. In the next second phase, the next word [r] of the record is set in the input register 11 and stored in the first record buffer memory 12. In the above 0th cycle, the input of the first record is completed, and the record is stored in the first record buffer memory 12. In the subsequent first cycle, the following three processes are executed in parallel. One of them is the process of inputting the second record [2/q] and storing it in the first record buffer memory 12, and this process is performed in the same way as in the 0th cycle. In this case, the FIFO function of the record buffer memory 12 causes the records stored in the record buffer memory 12 in the previous cycle to be read word by word in synchronization with the storage of the records. In the second process, the first record read from the first record buffer memory 12 and the current input state are stored in the input register 11.
This is an operation to compare with the second record set in . The third process is an operation of transferring the first record read from the first record buffer memory 12 to the output control section 2 and storing it in the second record buffer memory 16. That is, in the first phase, [2], which is the first word of the second record, is input and set in the input register 12. This data is stored in the first record buffer memory 12, and at the same time, from the first record buffer memory 12 having a FIFO function, the record stored one cycle ago (=first record) is stored in the first record buffer memory 12. The first word is read. And this record buffer memory 12
The data read from the output controller 2, that is, the first word [1] of the first record, is
The data is transferred to the record buffer memory 16 of the record buffer memory 16, and is compared with the value set in the input register 11 ([2], which is the first word of the second record) in the comparison circuit 13. In the subsequent second phase, the second word [q] of the second input record is set in the input register 11 and stored in the first record buffer memory 12, and at the same time, the second word [q] of the second input record is set in the first record buffer memory 12. 2 of the first record read from
It is compared with the word [r]. This second phase is processing of the last word of the record, and since records [1/r] and [2/q] do not match, the equal signal E of the comparison circuit 13 is "0", and this In response, the flag circuit 15 sets the duplication flag F.
is set to “0”. With the above, the first cycle is completed, the second record is stored in the first record buffer memory 12, and the second record is stored in the second record buffer memory 16.
The first record is stored in . The output control circuit 17 stores flag information indicating whether or not the first record stored in the second record buffer memory 16 overlaps with the next record. In accordance with the information of this duplication flag F, the output control circuit 17 updates the record [1/1] stored in the second record buffer memory 16 in the next third cycle.
r]. In this case, the duplication flag F is "0", indicating that the record does not overlap with the next record, so the record [1/r] is output as is. In the next third cycle, in addition to the three processes described above, record output control according to the duplication flag F is performed. At this time, the above-mentioned three processes include processing for the third record that will be input next, comparison processing with the second record, and transfer of the second record to the second record buffer memory 16. Needless to say, the transfer will take place. However, in the third cycle, the duplication flag F is "0", indicating that the record does not overlap with the next record, so the record [1/r] is output as is. Then, in the fourth cycle, a match is detected by comparing the second record and the third record in the third cycle, and since the duplicate flag F is "1", output control is performed. The circuit 17 prevents the output of the second record [2/q] stored in the second record buffer memory 16. In other words, records that duplicate the next record are not output. Thereafter, similar processing is performed by repeating the above cycle until processing for all input records is completed. Thus, according to the present apparatus, by adding the duplication flag F to the second record buffer memory 16, the following relation is obtained.

【表】 従つてこのリレーシヨン中から重複フラグF
が”1”であるレコードの出力を阻止し、つまり
重複したレコードを取除くことによつて、次のよ
うな新しいリレーシヨン{R2}を得ることが可
能となる。
[Table] Therefore, the duplicate flag F from this relation
By preventing the output of records for which is "1", that is, by removing duplicate records, it is possible to obtain the following new relation {R2}.

【表】 以上のように本装置によれば、第1レコードバ
ツフアメモリ12に格納したレコードと、次のサ
イクルで入力されるレコードとを比較して、その
結果により該レコードを出力するか否かを決定し
てレコードの出力を制御するので、データ処理装
置を用いて射影演算を効果的に、且つ高速に実行
することができる。しかも、その処理アルゴリズ
ムが簡単であり、ハードウエアにおける実現が容
易である。 尚、本発明は上述した実施例に限定されるもの
でなない。例えばレコードを構成する属性の数
や、その語長等は処理対象とするデータベースの
構造等に応じて定めれば良い。またこれに応じて
1サイクルのフエーズ数を定めれば良い。その
他、本発明はその要旨を逸脱しない範囲で種々変
形して実施することができる。
[Table] As described above, according to this device, the record stored in the first record buffer memory 12 is compared with the record input in the next cycle, and based on the result, whether or not to output the record is determined. Since the output of the record is controlled by determining the output of the record, the projection operation can be executed effectively and at high speed using the data processing device. Furthermore, the processing algorithm is simple and can be easily implemented in hardware. Note that the present invention is not limited to the embodiments described above. For example, the number of attributes constituting a record, its word length, etc. may be determined depending on the structure of the database to be processed. Also, the number of phases in one cycle may be determined in accordance with this. In addition, the present invention can be implemented with various modifications without departing from the gist thereof.

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

第1図は本発明の一実施例装置の概略構成図、
第2図は本発明の応用例を示す装置概略構成図で
ある。 1……演算部、2……出力制御部、3……ソー
ト処理部、11……入力レジスタ、12……第1
のレコードバツフアメモリ、13……比較回路、
14……データレジスタ、15……フラグ回路、
16……第2のレコードバツフアメモリ、17…
…出力制御回路、18……出力レジスタ、19…
…ソート検査回路。
FIG. 1 is a schematic diagram of an apparatus according to an embodiment of the present invention;
FIG. 2 is a schematic configuration diagram of an apparatus showing an application example of the present invention. 1... Arithmetic unit, 2... Output control unit, 3... Sort processing unit, 11... Input register, 12... First
record buffer memory, 13...comparison circuit,
14...Data register, 15...Flag circuit,
16...Second record buffer memory, 17...
...Output control circuit, 18...Output register, 19...
...Sort inspection circuit.

Claims (1)

【特許請求の範囲】 1 複数のレコードを所定の規則に従つてソート
処理するソート処理部と、 このソート処理部においてソート処理された各
レコードを順次入力しセツトする入力レジスタ
と、 この入力レジスタに入力された前記レコードを
1レコード単位で一旦格納する第1のレコードバ
ツフアメモリと、 この第1のレコードバツフアメモリに格納され
た前記レコードの属性を表わす第1のキイの値と
前記入力レジスタに現入力中のレコードの属性を
表わす第2のキイの値とを相互に比較する比較回
路と、この比較回路における第1及び第2のキイ
の値の比較結果が一致するか、あるいは前記所定
の規則に従う大小関係にあるか否かを検査するた
めのソート検査回路と、 前記第1のレコードバツフアメモリに格納され
た前記レコードの比較検出と平行して、この第1
のレコードバツフアメモリのレコードを1レコー
ド単位で一旦格納する第2のレコードバツフアメ
モリと、 前記ソート検査回路における第1及び第2のキ
イの値の検査結果が一致すると検出された場合、
この検査結果を受けて前記第2のレコードバツフ
アメモリに格納され読出されるレコードの出力を
阻止し、あるいは前記所定の規則に従う大小関係
にあると検出された場合、前記第2のレコードバ
ツフアメモリから読出されるレコードを出力する
出力制御回路を具備し、 前記ソート検査回路における第1及び第2のキ
イの値が前記所定の規則に従う大小関係にないと
検出された場合、前記ソート検査回路は前記ソー
ト処理部に対し前記複数のレコードに対するソー
ト処理を再度行うよう指示することを特徴とする
データ処理装置。 2 第1のレコードバツフアメモリは、1レコー
ドの処理時間を1サイクルとして動作するFIFO
機能を有するものであつて、現入力レコードのキ
イの値の書込み時に、1サイクル動作前に格納し
たレコードのキイの値を読出すものである特許請
求の範囲第1項記載のデータ処理装置。 3 比較回路は、その比較結果に応じてレコード
重複フラグを発生するフラグ回路を備えたもので
ある特許請求の範囲第1項記載のデータ処理装
置。
[Scope of Claims] 1. A sort processing unit that sorts a plurality of records according to a predetermined rule; an input register that sequentially inputs and sets each record sorted in this sort processing unit; a first record buffer memory that temporarily stores the input record in record units; a first key value representing an attribute of the record stored in the first record buffer memory; and the input register. a comparison circuit that mutually compares the values of the second key representing the attributes of the record currently being input; a sort inspection circuit for inspecting whether or not there is a size relationship according to the rule;
If it is detected that the test results of the first and second key values in the sort test circuit match the second record buffer memory that temporarily stores records in the record buffer memory in record units;
In response to this inspection result, the output of records stored in and read from the second record buffer memory is prevented, or if it is detected that the magnitude relationship conforms to the predetermined rule, the second record buffer memory an output control circuit that outputs records read from the memory, and when it is detected that the values of the first and second keys in the sorting inspection circuit do not have a magnitude relationship according to the predetermined rule, the sorting inspection circuit The data processing device is characterized in that it instructs the sorting processing unit to perform sorting processing on the plurality of records again. 2 The first record buffer memory is a FIFO that operates with one record processing time as one cycle.
2. The data processing device according to claim 1, wherein the data processing device has a function of reading out the key value of the record stored one cycle before when writing the key value of the current input record. 3. The data processing device according to claim 1, wherein the comparison circuit includes a flag circuit that generates a record duplication flag according to the comparison result.
JP59231254A 1984-11-05 1984-11-05 Data processor Granted JPS61110235A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59231254A JPS61110235A (en) 1984-11-05 1984-11-05 Data processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59231254A JPS61110235A (en) 1984-11-05 1984-11-05 Data processor

Publications (2)

Publication Number Publication Date
JPS61110235A JPS61110235A (en) 1986-05-28
JPH0373020B2 true JPH0373020B2 (en) 1991-11-20

Family

ID=16920733

Family Applications (1)

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

Country Status (1)

Country Link
JP (1) JPS61110235A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5092641A (en) * 1973-12-14 1975-07-24

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5092641A (en) * 1973-12-14 1975-07-24

Also Published As

Publication number Publication date
JPS61110235A (en) 1986-05-28

Similar Documents

Publication Publication Date Title
US4053871A (en) Method and system for the iterative and simultaneous comparison of data with a group of reference data items
US4514826A (en) Relational algebra engine
JPS5846742B2 (en) Interactive data search device
US3702011A (en) Apparatus and method for simulating logic faults
US20170212902A1 (en) Partially sorted log archive
JPH0373020B2 (en)
JP2865831B2 (en) Parallel string search device
RU2659492C1 (en) Unification unit with parallel comparison of terms
JPS61110234A (en) Data processor
JPH0370826B2 (en)
JPH0520350A (en) Vector processing device
JP2735255B2 (en) Hatching treatment method
JP2536572B2 (en) Sort processing device
JPS61110233A (en) Data processor
JP2539079B2 (en) Column data selection processing circuit
JPH03147036A (en) Variable length data processor
JPH0833812B2 (en) Sorting device
JPS62224833A (en) Suitability inspecting system of data form
JPH0431933A (en) Source program analyzing device
JPH05189513A (en) Logical simulation method taking delay into consideration
JPH04205173A (en) Information retrieval system
JPH0268633A (en) Check circuit for microprogram
JPS63303448A (en) Data storing circuit
JPH03268063A (en) Digital symbol train retrieving device
JPH02249040A (en) Information history storage circuit

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term