JP2011233012A - Merge processor, control program and record merge method - Google Patents
Merge processor, control program and record merge method Download PDFInfo
- Publication number
- JP2011233012A JP2011233012A JP2010104008A JP2010104008A JP2011233012A JP 2011233012 A JP2011233012 A JP 2011233012A JP 2010104008 A JP2010104008 A JP 2010104008A JP 2010104008 A JP2010104008 A JP 2010104008A JP 2011233012 A JP2011233012 A JP 2011233012A
- Authority
- JP
- Japan
- Prior art keywords
- record
- records
- input
- unit
- prediction
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
本発明はマージ処理装置、制御プログラム及びレコードマージ方法に関し、特に予測による手法を用いたマージ処理装置、マージ処理装置を動作させる制御プログラム、及び、マージ処理装置を用いたレコードマージ方法に関する。 The present invention relates to a merge processing device, a control program, and a record merging method, and more particularly to a merge processing device using a prediction method, a control program for operating the merge processing device, and a record merging method using the merge processing device.
データベース等の情報処理システムにおいて、ソートは、重要な基本処理であり、ソートを高速に処理する技術が求められている。ソートの一手法であるマージソート法は、既に得られている短いソート済みレコード列を結合して、より長いソート済みレコード列を得るマージ処理を段階的に繰り返す。これにより、多数のレコードを集めたデータのソートが可能となる。 In an information processing system such as a database, sorting is an important basic process, and a technique for processing the sorting at high speed is required. The merge sort method, which is a sort method, repeats in a stepwise manner a merge process that combines already obtained short sorted record strings to obtain a longer sorted record string. Thereby, it is possible to sort data obtained by collecting a large number of records.
図18を用いて、一般的に用いられるマージ処理装置の構成例について説明する。説明に用いる用語は、非特許文献1を参照し、次のように定義する。ソートされるデータの並び替え単位を「レコード(record)」とし、複数個のレコードをソート順序に従い並び変えられたものを「連(run)」とする。マージする連の個数を2以上の整数Pを用いて表す。各々の連には、1からPまでの番号(連番号)がつけられている。
A configuration example of a commonly used merge processing apparatus will be described with reference to FIG. Terms used in the description are defined as follows with reference to Non-Patent
マージ処理装置100は、外部の入力供給部150からマージするP個の連のレコードデータを入力し、内部でマージ処理を行った後、得られたマージ済み連のレコードを外部の出力記憶部160へ出力する。マージ処理装置100は、入力供給部150からレコードが入力される入力部110と、入力部110に入力されたレコードを格納する一時記憶部120と、一時記憶部120内のレコードを1個ずつ読み出し、ソート順序に従い並び替えて外部の出力記憶部160に出力する整列出力部140と、を備えている。さらに、入力部が入力する連の選択を行う入力連選択部130を備えている。
The
ここで、一時記憶部120は、マージされる連のレコードを全て格納するだけの容量を備えていない。そのため、一時記憶部120は、少しずつレコードデータを取得しながらマージ処理を進行させる。一時記憶部120へのレコード入力処理は、1個または複数のレコードの集まりであるレコードブロックを一単位として行われる。さらに入力部110は、P個の連で共有されている。そのため、一時記憶部120は、P個の連からレコードを同時に入力することはできず、入力する連を切り替えながら入力を進める。具体例としては、マージ処理装置100にメモリバスを介して接続されたSDRAMメモリからバースト転送モードを利用してレコードのデータを読み出す場合がある。このような事例を記載した文献として特許文献1がある。あるいは別の例として、マージ処理装置100に接続されたディスク装置からレコードのデータを所定長のブロック単位でまとめて入力する場合、イーサネット(登録商標)で接続されたストレージサーバからレコードを一定長のレコードブロック単位で読み出す場合などがある。
Here, the
マージ処理中に入力部110から一時記憶部120へ出力されるレコードブロックの選択は、入力連選択部によって行われる。整列出力部140の動作を停止させることなくマージ処理を高速に進行させるためには、P個の連の全てに対して一時記憶部120におけるレコード格納個数が空にならないよう十分な速度でレコードが一時記憶部120に入力される必要がある。しかし、各々の連に用いられるバッファからレコードが出力される速度は入力に依存して変化する。そのため、入力連選択部130は、一時記憶部のレコード格納状態を観測しながら入力連の決定を行う。この入力連の選択制御において有効な技法として、非特許文献1、P307及び非特許文献2、APPENDIX2において、予測(forecast)に基づく選択手法が考案されている
Selection of the record block output from the
ここで、非特許文献1及び非特許文献2連番号に開示されている予測(forecast)について具体的に説明する。一時記憶部120の第iのバッファに対して、第iの連からその時点で一時記憶部120に入力し終えた最後のレコードを第iの連の最後方レコードとする。予測に基づく手法では、入力選択部130は、P個ある最後方レコードの中からソート順序が最も前方になるレコードを選び出し、そのレコードを供給した連を、次にレコードを入力する連として選択する。このように選択された連は、その時点で後続のレコード供給を最も早く必要とする連を示している。そのため、予測に基づく入力連の選択手法は、一時記憶部120に必要なレコード記憶領域の容量や、マージ処理遅延を減らす上で好ましい手法である。
Here, the prediction disclosed in
しかし、マージ処理装置において予測に基づく入力連選択を用いる場合、予測自体に要する処理時間や、入力先の連番号を決定してから実際にレコードデータが入力されるまでの遅延時間が大きいときに、レコード入力処理の実行が効率良く行われない。さらに、マージ処理速度の低下が引き起こされる問題がある。この問題について、図19を用いて説明する。図19は、入力供給部150に対する入力要求処理と、入力供給部150からレコードが入力される処理と、入力連を決定する処理と、の3つの実行順序関係を示している。本図において、入力供給部150にレコード供給を要求してからレコードデータが入力されるまで3レコード分の遅延があるとする。また、入力単位であるレコードブロックは、8個のレコードから構成され、それらがソート規則に従う順序で並んでいる。予測に基づいて入力連を選択する場合、これらのレコードの中で最後に入力されたものを用いる。そのため、図19に示すように、入力連の選択処理中と入力遅延の間、レコード入力が全く行われず、レコード入力処理の効率が悪いという問題がある。
However, when using the input sequence selection based on prediction in the merge processing device, when the processing time required for the prediction itself or the delay time until the record data is actually input after determining the serial number of the input destination is large The record input process is not executed efficiently. Furthermore, there is a problem that the merge processing speed is lowered. This problem will be described with reference to FIG. FIG. 19 shows three execution order relationships: an input request process for the
この問題を解決するためには、冗長なバッファを用意していくつかのレコードブロックを先読みする手法や、全てのレコード入力を待たずに投機的に次の入力連を予測選択する手法などが考えられる。しかし、必要なバッファ容量と処理遅延時間を増加させる問題や、予測が外れた場合に時間ペナルティが生じるため、妥当ではない。 To solve this problem, there are methods such as preparing a redundant buffer and prefetching several record blocks, and speculatively selecting the next input series without waiting for all record inputs. It is done. However, the problem is that the required buffer capacity and processing delay time are increased, and a time penalty occurs when the prediction is lost.
本発明は、このような問題を解決するためになされたものであり、効率的なレコードの入力を実現することができるマージ処理装置、制御プログラム及びレコードマージ方法を提供することを目的とする。 The present invention has been made to solve such a problem, and an object thereof is to provide a merge processing apparatus, a control program, and a record merging method capable of realizing efficient record input.
本発明の第1の態様にかかるマージ処理装置は、ソートされた複数のレコードから構成されるレコード列が複数入力され、前記入力されたそれぞれのレコード列を、少なくとも1のレコードを含むレコードブロックに分離し、当該レコードブロックのそれぞれに含まれる複数のレコードの最後方に配置されている予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替える配置変換部と、前記配置変換部から複数のレコードブロックを取得し、記憶部へ入力する入力部と、前記複数のレコードブロックのそれぞれに含まれた前記予測用レコードの大小関係に基づいて、前記入力部が前記配置変換部から取得するレコード列を選択するレコード列選択部と、を備え、前記入力部は、前記レコードブロックに含まれるレコードのそれぞれを前記順序が入れ替えられたレコードの順に取得し、前記レコードブロックに含まれる全てのレコードを取得する前に、取得済の予測用レコードを前記レコード列選択部へ出力し、前記レコード列選択部は、前記入力部から出力された予測用レコードの入力に応じて、次に前記入力部が前記配置変換部から取得するレコード列を選択する処理を開始するものである。 In the merge processing device according to the first aspect of the present invention, a plurality of record strings composed of a plurality of sorted records are input, and each of the input record strings is converted into a record block including at least one record. An arrangement conversion unit that separates and changes the order of the records so that the prediction record arranged at the end of the plurality of records included in each of the record blocks is positioned ahead of the currently arranged position; The input unit obtains a plurality of record blocks from the arrangement conversion unit and inputs them to the storage unit, and the input unit is based on the size relationship between the prediction records included in each of the plurality of record blocks. A record string selection unit that selects a record string acquired from the layout conversion unit, and the input unit includes the record block. Each of the records included in the order of the records in which the order has been changed, before acquiring all the records included in the record block, output the acquired prediction record to the record string selection unit, The record sequence selection unit starts processing for selecting a record sequence that the input unit acquires from the layout conversion unit next in response to the input of the prediction record output from the input unit.
本発明の第2の態様にかかるマージ処理装置は、ソートされた複数のレコードから構成されるレコード列が複数入力され、当該前記入力されたそれぞれのレコード列を少なくとも1のレコードを含む複数のレコードブロックに分離する分離部と、前記分離部に後から入力された前記レコードブロックから順に前記レコードブロックを取得し、記憶部へ入力するとともに、前記レコードブロック内で最も前方に位置するブロックを予測用レコードとして取り出す入力部と、前記複数のレコードブロックのそれぞれに含まれた前記予測用レコードの大小関係に基づいて、前記入力部が前記配置変換部から取得するレコードブロックを選択するレコード列選択部と、前記レコード列のソート順序と逆のソート順序に従い記憶部からレコードを順に取り出して出力する整列出力部とを備え、前記入力部は、前記レコードブロックのレコードを全て取得する前に、前記予測用レコードを前記レコード列選択部へ出力し、前記レコード列選択部は、前記入力部から出力された予測用レコードに基づいて、次に前記入力部が前記配置変換部から取得するレコード列を選択する処理を開始するものである。 In the merge processing apparatus according to the second aspect of the present invention, a plurality of record strings each including a plurality of sorted records are input, and each of the input record strings includes a plurality of records including at least one record. The record block is obtained in order from the separation unit that is separated into blocks, and the record block that is input later to the separation unit, and the record block is input to the storage unit, and the block located at the forefront in the record block is used for prediction An input unit that is extracted as a record, and a record string selection unit that selects a record block that the input unit acquires from the arrangement conversion unit, based on the magnitude relationship of the prediction records included in each of the plurality of record blocks; The records are sequentially retrieved from the storage unit according to the sort order opposite to the sort order of the record sequence. An alignment output unit that outputs and outputs the prediction record to the record sequence selection unit before acquiring all the records of the record block, and the record sequence selection unit Based on the prediction record output from the input unit, the input unit next starts a process of selecting a record string acquired from the arrangement conversion unit.
本発明の第3の態様にかかるマージ処理装置は、ソートされた複数のレコードから構成されるレコード列が複数入力され、前記入力されたそれぞれのレコード列を、少なくとも1のレコードを含むレコードブロックに分離し、当該レコードブロックのそれぞれに含まれる複数のレコードの最後方に配置されている第1の予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替える配置変換部と、前記配置変換部から複数のレコードブロックを取得し、第1の記憶部へ入力する第1の入力部と、前記レコード列のソート順序と同じソート順序に従い前記第1の記憶部からレコードを順に取り出して出力する第1の整列出力部と、前記配置変換部へ後から入力された前記レコードブロックから順に前記レコードブロックを取得し、第2の記憶部へ入力するとともに、前記レコードブロック内で最も前方に配置されているブロックを第2の予測用レコードとして取り出す第2の入力部と、前記レコード列のソート順序と逆のソート順序に従い前記第2の記憶部からレコードを順に取り出して出力する第2の整列出力部と、前記複数のレコードブロックのそれぞれに含まれた前記第1の予測用レコードの大小関係に基づいて、前記第1の入力部が前記配置変換部から取得するレコード列を選択する第1のレコード列選択部と、前記複数のレコードブロックのそれぞれに含まれた前記第2の予測用レコードの大小関係に基づいて、前記第2の入力部が前記配置変換部から取得するレコード列を選択する第2のレコード列選択部と、を備え、前記第1及び第2の入力部は、前記レコードブロックのレコードを全て取得する前に、前記第1及び第2の予測用レコードを前記第1及び第2のレコード列選択部へ出力し、前記第1及び第2のレコード列選択部は、前記第1及び第2の入力部から出力された第1及び第2の予測用レコードに基づいて、次に前記第1及び第2の入力部が前記配置変換部から取得するレコード列を選択する処理を開始するものである。 In the merge processing device according to the third aspect of the present invention, a plurality of record strings composed of a plurality of sorted records are input, and each of the input record strings is converted into a record block including at least one record. An arrangement in which the order of the records is changed so that the first prediction record arranged at the end of the plurality of records included in each of the record blocks is positioned ahead of the currently arranged position. A conversion unit, a first input unit that obtains a plurality of record blocks from the arrangement conversion unit and inputs them to the first storage unit, and from the first storage unit according to the same sort order as the sort order of the record sequence A first alignment output unit for sequentially extracting and outputting records, and the record block sequentially input from the record block to the layout conversion unit; A second input unit that obtains a first block and inputs the second block to the second storage unit, and extracts a block arranged at the foremost position in the record block as a second prediction record; and a sort order of the record sequence The second sort output unit that sequentially extracts and outputs records from the second storage unit according to the reverse sort order and the magnitude relationship between the first prediction records included in each of the plurality of record blocks Based on the first record sequence selection unit that selects the record sequence that the first input unit acquires from the arrangement conversion unit, and the second prediction record included in each of the plurality of record blocks A second record string selection unit that selects a record string that the second input unit acquires from the arrangement conversion unit based on a magnitude relationship; The second input unit outputs the first and second prediction records to the first and second record sequence selection units before acquiring all the records of the record block, and The second record string selection unit is configured such that, based on the first and second prediction records output from the first and second input units, then the first and second input units are the arrangement conversion unit. The process of selecting a record string to be acquired from is started.
本発明の第4の態様にかかる制御プログラムは、複数のレコードから構成されるレコード列を複数格納する記憶部と、前記記憶部に格納されたレコードを取り出してソート規則に従う順序に並び変えてレコードを出力する整列出力部と、複数のレコード列が少なくとも1のレコードを含むレコードブロックに分離され、当該レコードブロックのそれぞれにおいて外部からの入力時に最後方に配置されている予測用レコードに基づいて、次に入力するレコード列を選択するレコード列選択部とを含むマージ処理ユニットに、前記レコード列を入力する処理をコンピュータに実行させる制御プログラムであって、外部から前記レコードブロックを複数取得するするステップと、前記取得された複数のレコードブロックの最後方に配置されている予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替えるステップと、前記順序が入れ替えられたレコードの順に前記レコードを前記マージ処理ユニットに入力するステップと、をコンピュータに実行させるものである。 A control program according to a fourth aspect of the present invention includes: a storage unit that stores a plurality of record strings including a plurality of records; and a record that is extracted from the records stored in the storage unit and rearranged in an order according to a sorting rule. Based on the prediction output arranged at the end at the time of input from the outside in each of the record blocks, the aligned output unit that outputs and a plurality of record sequences are separated into record blocks including at least one record, A control program for causing a computer to execute a process of inputting the record string in a merge processing unit including a record string selection unit that selects a record string to be input next, and acquiring a plurality of the record blocks from the outside And the schedule arranged at the end of the plurality of obtained record blocks. Changing the order of the records so that the records for use are positioned ahead of the currently arranged position, and inputting the records to the merge processing unit in the order of the records whose order has been changed. To be executed.
本発明の第5の態様にかかるレコードマージ方法は、ソートされた複数のレコードから構成されるレコード列が複数入力され、前記入力されたそれぞれのレコード列を、少なくとも1のレコードを含むレコードブロックに分離するステップと、前記複数のレコードブロックのそれぞれに含まれる複数のレコードの最後方に配置されている予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替えるステップと、前記レコードブロックに含まれるレコードのそれぞれを前記順序が入れ替えられたレコードの順に取得するとともに、取得済みの予測用レコードを出力するステップと、前記出力された予測用レコードの入力に応じて、次に入力されるレコード列を選択する処理を開始するステップと、を備えるものである。 In the record merging method according to the fifth aspect of the present invention, a plurality of record strings composed of a plurality of sorted records are input, and each of the input record strings is converted into a record block including at least one record. The order of the records is changed so that the prediction record arranged at the end of the plurality of records included in each of the plurality of record blocks is positioned ahead of the currently arranged position. Acquiring each of the records included in the record block in the order of the records in which the order has been changed, outputting the acquired prediction record, and depending on the input of the output prediction record And a step for starting a process for selecting a record string to be input next. Is shall.
本発明により、効率的なレコードの入力を実現することができるマージ処理装置、制御プログラム及びレコードマージ方法を提供することができる。 According to the present invention, it is possible to provide a merge processing apparatus, a control program, and a record merging method capable of realizing efficient record input.
(実施の形態1)
以下、図面を参照して本発明の実施の形態について説明する。図1を用いて本発明の実施の形態1にかかるマージ処理装置の構成例について説明する。マージ処理装置10は、配置変換部20と、入力部22と、記憶部24と、レコード列選択部26と、を備えている。
(Embodiment 1)
Embodiments of the present invention will be described below with reference to the drawings. A configuration example of the merge processing apparatus according to the first exemplary embodiment of the present invention will be described with reference to FIG. The
配置変換部20は、ソートされた複数のレコードから構成されるレコード列が複数入力される。さらに、配置変換部20は、入力された複数のレコード列を、少なくとも1のレコードを含むレコードブロックに分離し、それぞれのレコードブロックに含まれる複数のレコードの最後方に配置されている予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替える。
The
入力部22は、配置変換部20から複数のレコードブロックを取得し、記憶部24へ入力する。入力部22は、配置変換部20から、レコードブロックに含まれるレコードのそれぞれを順序が入れ替えられたレコードの順に取得する。これにより、入力部22は、レコードブロックに含まれる全てのレコードを取得する前に、予測用レコードを取得することができる。入力部22は、レコードブロックに含まれる全てのレコードを取得する前に、取得済みの予測用レコードを、レコード列選択部26へ出力する。
The
レコード列選択部26は、複数のレコードブロックのそれぞれに含まれた予測用レコードに基づいて、入力部22が配置変換部20から取得するレコード列を選択する。レコード列選択部26によって選択されたレコード列は、入力部22における現在のレコード列の取得が完了後に、入力部22によって配置変換部20から取得される。
The record
記憶部24は、入力部22から入力されたレコード列を格納する。
The
以上説明したように、図1において説明したマージ処理装置10を用いることにより、入力部22は、レコードブロックに含まれるレコードを全て取得する前に、予測用レコードを取得することができる。これにより、入力部22は、レコードブロックに含まれるレコードを全て取得する前に、予測用レコードをレコード列選択部26へ出力することができる。よって、レコード列選択部26は、出力された予測用レコードに基づいて、入力部22が配置変換部20からレコードブロックに含まれるレコードを全て取得する前に、次に入力部22が配置変換部20から取得するレコード列を選択する処理を開始することができる。そのため、配置変換部から入力部にレコード列が入力されてから、次のレコード列が入力されるまでの時間を短縮することができるため、レコード列の効率的な入力処理を実現することができる。
As described above, by using the
続いて、図2を用いて本発明の実施の形態1にかかるマージ処理装置の詳細な構成例について説明する。マージ処理装置10は、配置変換部20と、入力部22と、記憶部24と、レコード列選択部26と、入力記憶部30と、整列出力部32と、を備えている。記憶部24は、第1のバッファ41と、第2のバッファ42と、第Pのバッファ43と、を有している。また、マージ処理装置10は、入力供給部50と、出力記憶部60とに接続されている。図1と同様の機能を有するマージ処理装置10の構成要素は、図1と同様の符号を付して説明する。また、以下の説明において用いる連(run)という用語は、上述したレコード列と同様の意味を有する。
Subsequently, a detailed configuration example of the merge processing apparatus according to the first exemplary embodiment of the present invention will be described with reference to FIG. The
マージ処理装置10は、外部の入力供給部50から、マージするP個の連のレコードデータが入力される。各々の連は、1からPまでの番号(連番号)を用いて識別される。マージ処理装置10は、装置内部においてP個の連のマージ処理を行った後、得られたマージ済み連のレコードを外部の出力記憶部60へ出力する。
The
配置変換部20は、入力供給部50から供給されるレコードを取得し、レコードの配置を並び替える。例えば、配置変換部20は、連に含まれる複数のレコードを、予め定められたレコード数を有するレコードブロックに区切り、レコードブロックの最後方に配置されているレコード、つまり予測用レコードを、先頭に位置するように配置する。
The
入力記憶部30は、配置変換部20からレコードが入力され、並び替えられたレコードをレコードブロック単位に記憶する。
The
入力部22は、入力記憶部30から、配置変換部20によって順序が入れ替えられたレコードの順にレコードを取得する。入力部22は、レコード列選択部26によって選択された連から、レコードブロック単位にレコードを取得する。入力部22は、予測用レコードを取得すると、レコードブロックに含まれる全てのレコードを取得する前に、取得した予測用レコードをレコード列選択部26へ出力する。さらに、入力部22は、取得したレコードを、並び替え前のソート順序に復元して、記憶部24へ出力する。
The
記憶部24は、連ごとにレコードを格納するために複数のバッファを有している。例えば、マージ処理装置10にP個の連が入力される場合、連1を格納するバッファを第1のバッファ41とし、連2を格納するバッファを第2のバッファ42とし、連Pを格納するバッファを第Pのバッファ43とする。記憶部24は、連ごとに、復元されたレコードの順にそれぞれのバッファへレコードを格納する。
The
整列出力部32は、記憶部24内のレコードをソート順序に従いながら読み出し、外部の出力記憶部60へ出力する。例えば、整列出力部32は、それぞれのバッファの先頭に位置するレコードの値が一番小さいレコードを読み出す。これにより、整列出力部32は、値の小さいレコードから順にレコードをソートして、複数の連をマージすることができる。
The
レコード列選択部26は、入力部22が入力記憶部30から取得するレコードブロックを、予測に基づく手法により選択する。以下に、予測に基づく手法について説明する。
The record
レコード列選択部26に対しては、入力部22が記憶部24へレコードブロックを入力する際に、入力部22から、それぞれのレコードブロックに含まれる予測用レコードが出力され、レコード列選択部26は、最後に出力された予測用レコードをそれぞれの連ごとに1つずつ、合計でP個保持している。レコード列選択部26は、P個ある予測用レコードの中から、ソート順序が最も前方になるレコード、つまり、値が最も小さいレコードを抽出する。レコード列選択部26は、抽出したレコードを供給した連を、次にレコードを入力する連として選択する。このように選択された連は、その時点で後続のレコード供給を最も早く必要とする連を示している。レコード列選択部26は、入力部22及び入力記憶部30の少なくとも一方に対して、選択した連を通知する。
When the
入力記憶部30は、レコード列選択部26によって選択された連が通知されると、選択された連に含まれるレコードブロックを入力部22へ出力する。もしくは、入力部22は、レコード列選択部26によって選択された連が通知されると、入力記憶部30に対して選択された連に含まれるレコードブロックの出力を要求してもよい。
When the input selected by the record
入力部22は、入力記憶部30からレコードブロックを取得すると、予測用レコードをレコード列選択部26へ出力し、レコード列選択部26は、取得した予測用レコードと、保持している他の連の予測用レコードとを用いて、値が最も小さいレコードを抽出する。
When the
以上説明したように、入力部22が入力記憶部30から取得するレコードブロックは、予測に基づく手法により選択される。
As described above, the record block acquired by the
次に、マージ処理装置10内の処理動作のタイミングについて説明する。ここで、マージ処理装置10内の、入力部22と、記憶部24と、整列出力部32と、入力連選択部26とをまとめてマージ処理ユニットとする。マージ処理が開始されると各部において必要な初期化が行われる。その後、配置変換部20は、外部の入力供給部50からのレコードデータ入力を待機する。配置変換部20は、レコードデータの入力開始とともにレコードデータの並び替えと、入力記憶部に対するレコードデータの格納を開始する。配置変換部20は、全てのレコードデータの入力を終えるまで処理を続ける。その途中、入力記憶部30に十分な量のレコードデータが蓄積されると、マージ処理ユニットは、マージ処理を開始する。マージ処理ユニットは、全てのレコードを外部の出力記憶部60に出力し終えるまで処理を続ける。配置変換部20とマージ処理ユニットの動作タイミングとは一定の時間差を保ちながら同期して動作しても構わないし、独立したタイミングにより動作しても構わない。ただし、処理すべきレコードデータが未入力である場合、マージ処理ユニットは、処理を行わず待機する。あるいは、入力記憶部30が、全てのレコードデータを記憶可能な容量を持っている場合、マージ処理ユニットは、配置変換部20から入力されるレコードデータの蓄積が全て完了してから、処理を開始しても良い。
Next, the timing of the processing operation in the
続いて、図3を用いて本発明の実施の形態1にかかる、レコードの並び替え処理について説明する。図3におけるa1、a2、a3・・・は、外部から供給された任意の連のレコードを表し、添字の番号はソート規則に従う順序を表す。各々の連のレコードは、図3(a)で表されるように、ソート順序に従い配置変換部20に供給される。配置変更部20は、これらのレコードを、a1〜a8、a9〜a16、a17〜a24、のように8個のレコードを有するレコードブロックに区切る。さらに、配置変換部20は、レコードブロック内のレコードの配置順序を、図3(b)で示されるように、それぞれのレコードブロックの最後方レコード(予測用レコード)を、レコードブロックの先頭に位置するように、並び替える。配置変換部20は、このようにレコードの配置が変更された連を、レコードブロック単位に入力記憶部30へ格納する。
Next, a record rearrangement process according to the first embodiment of the present invention will be described with reference to FIG. 3, a1, a2, a3,... Represent arbitrary continuous records supplied from the outside, and the subscript numbers represent the order according to the sorting rule. Each series of records is supplied to the
図3(b)には、各レコードブロック内において最後方のレコード(a8、a16、a24・・・)が先頭に配置され、その他のレコードは一つ位置を後ろにずらして格納される様子が示されている。入力記憶部30から入力部22へのレコードデータの供給はレコードブロック単位で行われるが、レコードブロック内のレコードはこの並び替えられた順序により供給される。
FIG. 3B shows that the last record (a8, a16, a24...) Is arranged at the top in each record block, and the other records are stored with one position shifted backward. It is shown. The record data is supplied from the
また、入力部22は、配置変換部20により並び替えられたレコードブロック内のレコード配置を、元の配置順に戻しながらレコードを記憶部24へ入力する。これにより、ソートされた順序と異なる配置によりレコードが入力されても、記憶部24内ではソートされた順序によりレコードが格納される。そのため、整列出力部32は、それぞれのバッファの先頭レコードを比較して抽出することにより、マージ処理を実行することができる。
The
続いて、図4を用いて本発明の実施の形態1にかかるマージ処理の流れについて説明する。はじめに、マージ処理ユニットにおいてマージ処理が開始されると、レコード列選択部26は、保持する変数を初期化する(S1)。例えば、レコード列選択部26は、最小の値を有する予測用レコードの連番号及び予測用レコードの最小値を初期化する。
Next, the flow of merge processing according to the first embodiment of the present invention will be described with reference to FIG. First, when merge processing is started in the merge processing unit, the record
次に、記憶部24は、連iのバッファに空きがあるか否かを判定する(S2)。連iのバッファに空きがあると判定された場合、レコード列選択部26は、連iの予測用レコードが入力済みの予測用レコードの中で最小か否かを判定する(S3)。レコード列選択部26は、連iの予測用レコードが最小であると判定した場合、連番号i及び予測用レコードの最小値を示す変数を更新する(S4)。次に、連i+1についても、同様にステップS2乃至4の処理を繰り返し実行する(S5)。
Next, the
ステップS2において、記憶部24が、連iのバッファに空きがないと判定した場合、又はステップS3において、レコード列選択部26が、連iの予測用レコードが最小ではないと判定した場合、ステップS5の処理へ移行する。次に、レコード列選択部26は、全ての連について、ステップS2以降の処理を実行したか否かを判定する(S6)。レコード列選択部26によって、全ての連がステップS2以降の処理を実行していないと判定された場合、ステップS2の処理へ移行する。レコード列選択部26によって、全ての連がステップS2以降の処理を実行したと判定された場合、記憶部24が有するバッファに空きのあるバッファがあったか否かを判定する(S8)。レコード列選択部26は、空きのあるバッファがあったと判定した場合、入力部22及び入力記憶部30の少なくともどちらか一方に、更新された連番号を通知し、レコードの入力要求を行う(S9)。レコード列選択部26は、空きのあるバッファがないと判定した場合、処理を終了する。
If the
以上説明したように、本発明の実施の形態1にかかるマージ処理装置を用いることにより、入力記憶部30から入力部22に対するレコードブロックの入力処理を連続的に実行することができる。図5を用いて、本発明の実施の形態1における効果を説明する。入力部22は、配置変換部20によって順序が並び替えられたレコードを取得する。例えば、配置変換部20によって予測用レコードがレコードブロックの先頭に位置するように配置された場合、入力部22は、レコードブロックの全てのレコードを取得する前に、予測用レコードをレコード列選択部26へ出力することができる。これにより、レコード列選択部26は、入力部22が全てのレコードを取得する前に、次に入力する連を選択し、入力部22及び入力記憶部30の少なくとも一方にレコード入力要求を行う。これにより、レコード入力要求が行われてから、入力部22が実際に入力記憶部30からレコードを取得するまでの遅延時間を隠蔽する時間的余裕がある。そのため、入力記憶部30は、入力部22に対して、連続的にレコードの入力処理を実行することができる。
As described above, by using the merge processing apparatus according to the first embodiment of the present invention, record block input processing from the
(実施の形態2)
続いて、図6を用いて本発明の実施の形態2にかかるマージ処理装置の構成例について説明する。図6のマージ処理装置10は、図2のマージ処理装置と比較して、配置変換部20が無い点において異なる。図6のその他の構成は、図2と同様であるため、図2と同様の符号を用いて説明する。
(Embodiment 2)
Next, a configuration example of the merge processing apparatus according to the second exemplary embodiment of the present invention will be described with reference to FIG. The
入力記憶部30は、入力供給部50から、マージされる全ての連のレコードを記憶できるだけの容量を有する。そのため、入力記憶部30が、入力供給部50から全てのレコードデータを入力されると、マージ処理ユニットによるマージ処理が開始される。入力記憶部30は、入力供給部50から入力されるレコードのソート順序を保ちながらレコードを格納する。ここで、a1、a2、・・・と、値が小さいレコードから入力される順序を昇順とする。これと逆の順序を降順とする。入力記憶部30は、入力供給部50から入力されたレコードデータを、少なくとも1のレコードを含むレコードブロックに分離する。また、a1〜a8のレコードを有するレコードブロックをレコードブロック1とし、a9〜a16のレコードを有するレコードブロックをレコードブロック2とし、a41〜a48のレコードを有するレコードブロックをレコードブロック6とする。a17〜a41は、レコードブロック3〜5が設定される。図7(a)に、レコードブロック内のレコード数を8個として、48個のレコードを持つ連を入力記憶部30に格納した場合の配置例を示す。
The
入力部22は、本発明の実施の形態1と異なり、入力記憶部30から、レコードブロック6、レコードブロック5、・・・レコードブロック1の順(降順)にレコードブロックを取得する。ただし、入力部22は、レコードブロック内のレコードを昇順に取得する。さらに、入力部22は、レコードブロック内のレコードを全て降順に並べ替えながら、取得したレコードを記憶部24へ格納する。図7(b)は、入力部22が入力記憶部30から取得するレコードの順序と、記憶部24へ格納するレコードの順序を示している。
Unlike the first embodiment of the present invention, the
ここで、レコード列選択部26が予測のために用いる予測用レコードは、ソート順序を降順とした時のレコードブロックの最後方レコード、すなわちソート順序を昇順とした時のレコードブロックの最前方レコードとする。入力部22は、レコードブロック内のレコードを昇順に取得する。そのため、予測用レコードは、レコードブロック内のレコードの中で最初に入力部22に取得される。入力部22は、予測用レコードを取得すると、レコードブロック内のすべてのレコードが入力される前に、取得した予測用レコードをレコード列選択部26へ出力する。これにより、レコード列選択部26は、入力部22がレコードブロック内の全てのレコードを取得する前に、次に取得するレコードブロックの連を決定する処理を開始する。なお、本発明の実施の形態2においては、レコード列選択部26は、予測用レコードの中で最大の値が設定されている予測用レコードの連を選択する。
Here, the prediction record used by the record
以上説明したように、本発明の実施の形態2にかかるマージ処理装置においては、本発明の第1の実施の形態にかかるマージ処理装置と同様のタイミングにより、入力部22が入力記憶部30からレコードを取得することができる。よって、マージ処理ユニットの可動効率を高めるとともに、マージ処理の処理速度を高めることができる。
As described above, in the merge processing device according to the second exemplary embodiment of the present invention, the
(実施の形態3)
続いて、図8を用いて本発明の実施の形態3にかかるマージ処理装置の構成例について説明する。本発明の実施の形態3にかかるマージ処理装置は、本発明の実施の形態1及び2を組み合わせた構成を有している。入力部22と、記憶部24と、レコード列選択部26と、整列出力部32と、を昇順マージ処理ユニットとし、昇順マージ処理ユニットは、本発明の実施の形態1にかかるマージ処理ユニットと同様の動作をする。また、入力部22_1と、記憶部24_1と、レコード列選択部26_1と、整列出力部32_1と、を降順マージ処理ユニットとし、降順マージ処理ユニットは、本発明の実施の形態2にかかるマージ処理ユニットと同様の動作をする。
(Embodiment 3)
Next, a configuration example of the merge processing apparatus according to the third embodiment of the present invention will be described with reference to FIG. The merge processing apparatus according to the third embodiment of the present invention has a configuration combining the first and second embodiments of the present invention. The
入力記憶部30は、本発明の実施の形態2にかかるマージ処理装置と同様に、マージされる全ての連のレコードデータを記憶できるだけの容量を有する。そのため、入力記憶部30に、配置変換部20から全てのレコードデータが入力されてから昇順マージ処理ユニット及び降順マージ処理ユニットによるマージ処理が開始される。入力供給部50から入力されるレコードは、本発明の実施の形態1にかかるマージ処理装置10と同様に、配置変換部20に入力される。配置変換部20は、入力供給部50から図9(a)のようにソートされた順番に入力されたレコードを、図9(b)のように、それぞれのレコードブロックの最後方レコードを、先頭に位置するようにレコードの順番を入れ替える。配置変換部20は、並び替えた複数の連のレコードを、入力記憶部30に入力する。
Similar to the merge processing apparatus according to the second embodiment of the present invention, the
入力記憶部30は、入力されたレコードの総数もしくはレコードデータが占める記憶容量をマージ処理装置内の制御部に通知し、制御部はこれを元に出力記憶部60にマージされたレコード列を書き込む領域を確保する。確保が終わると、昇順マージ処理ユニットと降順マージ処理ユニットにマージ処理を開始するよう指令を出す。
The
入力部22は、それぞれの連について、レコードブロック1、レコードブロック2、・・・レコードブロック6の順番にレコードを取得する。以降の処理は、図10(a)に示されるように、本発明の実施の形態1にかかるマージ処理装置と同様であり、入力部22は、レコードを、並び替えられる前の順番に復元して、記憶部24へ入力する。これらのレコードは昇順に並び替えられた上で出力記憶部60に順次出力される。出力されたレコードは、出力記憶部60に確保された領域の先頭から書き込まれる。
The
入力部22_1は、それぞれの連について、レコードブロック6、レコードブロック5、・・・レコードブロック1の順番にレコードを取得する。また、降順マージ処理ユニットにおいては、本発明の実施の形態2と同様に、予測用レコードは、a1、a9、・・・a41である。本発明の実施の形態3においては、配置変換部20において、レコードの順番が入れ替えられているため、予測用レコードは、それぞれのレコードブロックの2番目に配置されている。入力部22_1は、予測用レコードを取得した場合、レコードブロックの全てのレコードを取得する前に、レコード列選択部26_1へ予測用レコードを出力する。以降の処理は、本発明の実施の形態2にかかるマージ処理装置と同様に、入力部22は、レコードを降順に並べ替えて、記憶部24_1へ入力する。これらのレコードは降順に並び替えられた上で出力記憶部60に順次出力される。出力されたレコードは、出力記憶部に確保された領域の後ろから逆順に書き込まれる。
The input unit 22_1 acquires records in the order of the record block 6, the
ここで、昇順マージ処理ユニットは、入力された連の前方に位置するレコードブロックから順にマージ処理を行う。これに対して、降順マージ処理ユニットは、入力された連の後方に位置するレコードブロックから順にマージ処理を行う。これより、入力された連のレコードは、昇順マージ処理ユニットもしくは降順マージ処理ユニットのどちらか一方によりマージ処理が実行されるように制御されてもよい。これは例えば、昇順マージ処理ユニットが出力したレコードの個数と、降順マージユニットが出力したレコードの個数をマージ処理装置内の制御部が監視し、両者の個数の和が入力されたレコードの総数に到達した時点で、両ユニットの動作を停止させることで行われてもよい。これにより、出力記憶部60に対して、重複するレコードの書き込みを防止することができる。
Here, the ascending order merge processing unit performs the merge processing in order from the record block located in front of the input series. On the other hand, the descending order merging processing unit performs the merging processing in order from the record block located behind the input series. Thus, the input continuous records may be controlled so that the merge processing is executed by either the ascending order merge processing unit or the descending order merge processing unit. For example, the number of records output by the ascending order merge processing unit and the number of records output by the descending order merge unit are monitored by the control unit in the merge processing apparatus, and the sum of both numbers is added to the total number of records input. It may be performed by stopping the operation of both units when it reaches. Thereby, it is possible to prevent duplicate records from being written to the
以上説明したように、本発明の実施の形態3にかかるマージ処理装置を用いることにより、入力されたP個の連に対して、昇順マージ処理ユニットによるマージ処理と、降順マージ処理ユニットによるマージ処理とを並列に実行することができる。そのため、本発明の実施の形態1及び2と比較して、高速なマージ処理を実現することができる。
As described above, by using the merge processing apparatus according to the third embodiment of the present invention, merge processing by the ascending order merge processing unit and merge processing by the descending order merge processing unit are performed on the input P series. Can be executed in parallel. Therefore, compared with
(実施の形態4)
続いて、本発明の実施の形態4にかかる配置変換部20のレコード入れ替えパタンについて説明する。本発明の実施の形態4にかかるマージ処理装置の構成は、図8の構成と同様である。図11を用いて、本発明の実施の形態4にかかる配置変換部20のレコード入れ替えパタンについて説明する。
(Embodiment 4)
Subsequently, a record replacement pattern of the
図11(a)は、配置変換部20に入力される連1のレコードの順序を示している。これに対して、図11(b)は、配置変換部20によってレコードが入れ替えられた後の、連1のレコードの順序を示している。レコードブロック1を例に説明する。配置変換部20によって並び替えられる前のレコードブロック内のレコードの順序は、a1〜a8の順番に並べられている。配置変換部20によって並び替えられた後のレコードブロック1内のレコードの順序は、a8、a1、a7、a2、a6、a3、a5、a4の順番に並び替えられている。レコードの並び替えは次のようにして行われる。はじめに、並び替えられる前のレコードブロック1内のa1〜a4を前半部とし、a5〜a8を後半部とする。ここで、後半部のレコードを降順に並び替えを行う。次に、昇順に並べられている前半部のレコードと、降順に並べられている後半部のレコードとを交互に配置する。これにより、上述したレコードの順序となる。
FIG. 11A shows the order of the records of the
図12(a)は、入力部22から記憶部24へレコードが入力される際に行われるレコードの並び替えであり、図10(a)と同様に、それぞれのレコードは、昇順に並び替えられて、記憶部24へ入力される。また、図12(b)は、入力部22_1から記憶部24_1へレコードが入力される際に行われるレコードの並び替えであり、図10(b)と同様に、それぞれのレコードは、降順に並び替えられて記憶部24へ入力される。
FIG. 12A shows the rearrangement of records performed when records are input from the
上述したように、図12(a)及び(b)に示したように、レコードブロックの前半部と後半部を交互に配置した場合、図10(b)において説明した場合よりも、入力部22_1から記憶部24_1へレコードを入力するまでの遅延時間を短縮することができる。図10(b)においては、入力部22_1は、8番目に到着するレコードa47を取得するまで、記憶部24_1へレコードを出力することができない。これに対して、図12(b)においては、入力部22_1は、5番目に到着するレコードa46を取得すると、記憶部24_1へレコードを出力することができる。これより、降順マージ処理ユニットにおける記憶部24_1への出力遅延時間を短縮することができる。昇順マージ処理ユニットにおける記憶部24_1への出力遅延時間は、増加することになるが、一方のマージ処理ユニットにおける遅延時間が大幅に増加することを防止することができる。 As described above, as shown in FIGS. 12A and 12B, when the first half and the second half of the record block are alternately arranged, the input unit 22_1 is more than the case described in FIG. 10B. The delay time from when the record is input to the storage unit 24_1 can be shortened. In FIG. 10B, the input unit 22_1 cannot output a record to the storage unit 24_1 until the record a47 that reaches the eighth is acquired. On the other hand, in FIG. 12B, the input unit 22_1 can output the record to the storage unit 24_1 when acquiring the fifth record a46. Accordingly, the output delay time to the storage unit 24_1 in the descending order merge processing unit can be shortened. Although the output delay time to the storage unit 24_1 in the ascending order merge processing unit increases, it is possible to prevent the delay time in one merge processing unit from significantly increasing.
(実施の形態5)
続いて、図13を用いて本発明の実施の形態5にかかるマージ処理装置の構成例について説明する。図13に示すマージ処理装置は、N個のマージ処理部を直列に接続したパイプラインマージソート装置である。このマージ処理装置は、P個のレコード列をマージする装置であり、第1のマージ処理部71、第2のマージ処理部72、・・・、第Nのマージ処理部73は、それぞれP1、P2、・・・、PN個のレコード列をマージする機能を備える。ここで、P=P1×P2×・・・×PNであるとし、それぞれのマージ処理部は、レコード列を記憶する十分な入力記憶部を備えるとする。第1のマージ処理部71は、外部からソート済みレコード列がP1個入力されるとマージ処理を開始し、第2のマージ処理部72の入力記憶部にマージ後のレコード列を出力し、これをP÷P1=P2×・・・×PN回繰り返す。第2のマージ処理部72は、第1のマージ処理部71からレコード列がP2個入力されるとマージ処理を開始し、第3のマージ処理部の入力記憶部にマージ後のレコード列を出力し、これをP3×・・・×PN回繰り返す。このようにして、このマージ処理装置は、P個のレコード列のマージを行う。
(Embodiment 5)
Subsequently, a configuration example of the merge processing apparatus according to the fifth exemplary embodiment of the present invention will be described with reference to FIG. The merge processing apparatus shown in FIG. 13 is a pipeline merge sort apparatus in which N merge processing units are connected in series. The merge processing apparatus is an apparatus for merging a P number of records column, the first
このマージ処理装置において、それぞれのマージ処理部は、本発明の実施の形態2にかかるマージ処理装置と同じ構成をしている。N=1のときは、本発明の実施の形態2と同じである。第1のマージ処理部に入力されたレコード列のソート順を昇順とすると、第1のマージ処理部71から第2のマージ処理部72に出力されるレコード列のソート順は降順である。同様に、第2のマージ処理部72から第3のマージ処理部に出力されるレコード列のソート順は昇順となり、第Nのマージ処理部73は、Nが奇数のとき昇順のレコード列を入力して降順のレコード列を出力し、Nが偶数のとき降順のレコード列を入力して昇順のレコード列を出力する。
In this merge processing apparatus, each merge processing unit has the same configuration as that of the merge processing apparatus according to the second embodiment of the present invention. When N = 1, it is the same as the second embodiment of the present invention. If the sort order of the record sequence input to the first merge processing unit is ascending order, the sort sequence of the record sequence output from the first
マージ処理部の内部の動作は、実施の形態2で説明した通りである。それぞれの処理部が備える入力記憶部はレコードブロック単位で読み出す必要があり、さらに読み出し遅延時間が生じる。しかし、入力のソート順序と出力のソート順序とを入れ替えて、出力ソート順序に従ったときの予測用レコードをレコードブロックの最初に読み出せるようにすることで、読み出し遅延を隠蔽しレコード入力の効率を高め、高速な動作を可能としている。 The internal operation of the merge processing unit is as described in the second embodiment. The input storage unit included in each processing unit needs to read in record block units, and further causes a read delay time. However, by switching the input sort order and the output sort order so that the prediction record can be read at the beginning of the record block according to the output sort order, the read delay is concealed and the record input efficiency is improved. And enables high-speed operation.
(実施の形態6)
続いて、図14を用いて本発明の実施の形態6にかかるマージ処理装置の構成例について説明する。図14に示すマージ処理装置も実施の形態5と同様の構成をしたパイプラインマージソート装置であるが、各マージ処理部の間に配置変換部74及び75を備えていることと、N個のマージ処理部の内部構成と動作が異なっている。ここで、第1のマージ処理部71は一般的なマージ処理装置であり、第2〜第Nのマージ処理部は、その手前の配置変換部と合わせて本発明の実施の形態1または3または4と同様の構成と動作をする。例えば図15は、N=2であり、第2のマージ処理部72が本発明の実施の形態1と同様の構成である場合の構成を示す。このマージ処理装置において、配置変換部、全てのマージ処理部において、入力レコード列のソート順と出力レコード列のソート順は同じである。
(Embodiment 6)
Next, a configuration example of the merge processing apparatus according to the sixth embodiment of the present invention will be described with reference to FIG. The merge processing apparatus shown in FIG. 14 is also a pipeline merge sort apparatus having the same configuration as that of the fifth embodiment, but includes
ここで、第1のマージ処理部71と第2のマージ処理部72の間の配置変換部74は、第1のマージ処理部71から順に出力されるレコードを、レコードブロックに区切りながら配置変換を同時に行い、変換された配置のレコードブロックデータを第2のマージ処理部72に書き込む。この配置変換処理は、マージ処理部の出力と同時に行われるため、配置変換処理を行うことによるマージ処理時間の増加は少ない。同様に、第Nのマージ処理部73と第(n+1)のマージ処理部の間の配置変換部は、第Nのマージ処理部73のレコード出力と同時に動作するため、配置変換処理を行うことによるマージ処理時間の増加は少ない。よって、本発明の実施の形態のマージ処理装置は、レコード入力の効率を高め、高速な動作を可能としている。
Here, the
(実施の形態7)
続いて、図16を用いて本発明の実施の形態7にかかるソート処理装置の構成例について説明する。このソート処理装置は、本発明の実施の形態5のマージ処理装置の入力にソート処理部81を加えたソート装置である。ソート処理部81は、複数のレコードを内部の記憶部に入力し、それらをP個のレコードのグループに分割してグループ内のソートを行う。ソートされたレコード列を、第1のマージ処理部71に出力する。ソート処理部81におけるソート順序は第1のマージ処理部のソート順序の逆である。このように構成されたソート処理装置は、実施の形態5のマージ処理装置と同様に高速に動作する。
(Embodiment 7)
Next, a configuration example of the sort processing apparatus according to the seventh embodiment of the present invention will be described with reference to FIG. This sort processing apparatus is a sort apparatus in which a
(実施の形態8)
続いて、図17を用いて本発明の実施の形態8にかかるソート処理装置の構成例について説明する。このソート処理装置は、本発明の実施の形態6のマージ処理装置における第1のマージ処理部71をソート処理部に置き換えたソート装置である。ソート処理部81は、複数のレコードを内部の記憶部に入力し、それらをP個のレコードのグループに分割してグループ内のソートを行う。ソートされたレコード列を、第1のマージ処理部71に出力する。このように構成されたソート処理装置は、実施の形態6のマージ処理装置と同様に高速に動作する。
(Embodiment 8)
Next, a configuration example of the sort processing apparatus according to the eighth embodiment of the present invention will be described with reference to FIG. This sort processing apparatus is a sort apparatus in which the first
なお、上述した実施の形態1乃至8において、入力される連(レコード列)に含まれるレコードの数は、説明を容易にするため、それぞれ等しいとして説明しているが、レコードの数は制限されない。つまり、入力される連に含まれるそれぞれのレコードの数は、連ごとに任意に定められる。 In the first to eighth embodiments described above, the number of records included in the input ream (record sequence) is described as being equal for ease of explanation, but the number of records is not limited. . In other words, the number of records included in the input series is arbitrarily determined for each series.
また、上述した本発明の実施の形態1乃至8にかかるマージ処理装置の適用例について、以下に説明する。 An application example of the merge processing apparatus according to the first to eighth embodiments of the present invention will be described below.
はじめに、第1乃至第8の実施形態に係るマージ処理装置を集積回路により構成した例について説明する。入力記憶部30と整列出力部32とはSDRAMとその制御用回路から構成され、記憶部24にはSRAMとその制御用回路から構成される。SDRAMはバースト転送モードを用いることにより高速なデータ読み出しが可能であり、レコードブロックのレコード数は、SDRAMからの読み出し効率が高くなるように大きめに設定される。また、レコードブロックが配置されるアドレスは、適切な倍数のアドレスにアラインされている。SDRAMにデータを読み出すコマンド発行してからデータが転送されるまでアクセス遅延があり、これがマージ処理装置におけるレコード入力処理の効率を低下させる要因となる。しかし、本発明のマージ処理装置10は、SDRAMにレコードブロックを格納する際の配置を並び替えているため、レコードブロック内の全てのレコードを入力部20に転送し終える前に次のリード要求処理をSDRAMに対して行うことができる。そのため、SDRAMからデータが転送されるまでの、アクセス遅延を隠蔽できる。これにより、マージ処理装置を集積回路により構成した場合、本発明を用いないマージ装置よりも高速にマージ処理を実行できる。
First, an example in which the merge processing apparatus according to the first to eighth embodiments is configured by an integrated circuit will be described. The
続いて、第1乃至第8の実施形態に係るマージ処理装置をCPUと主記憶メモリからなるコンピュータとハードディスク装置、コンピュータにマージ処理を行わせるプログラムにより構成した例について説明する。入力記憶部30と整列出力部32とへのレコードの記憶にはハードディスクを用い、記憶部24には、コンピュータ内部の主記憶メモリを用いる。このコンピュータは複数のスレッドを並列に動作させることが可能であり、このプログラムは、配置変更部20、入力部22、レコード列選択部26、整列出力部32に複数のスレッドを起動して、CPUに本発明に係るマージ処理を行わせるための指令が記述されている。ハードディスク装置に記憶されたレコードデータを読み出す際、読み出しコマンドを発行してから、データが読み出されるまで遅延時間があるため、これがマージ処理装置におけるレコード入力処理の効率を低下させる要因となる。しかし、本発明のマージ処理装置は、ハードディスクにレコードブロックを格納する際の配置を並び替えている。そのため、レコードブロック内の全てのレコードを入力部22に転送し終える前に次のリード要求処理をハードディスクに対して行うことができる。そのため、ハードディスク装置からデータが読み出されるまでのアクセス遅延を隠蔽できる。これにより、マージ処理装置をコンピュータ装置により構成した場合、本発明を用いないマージ処理装置よりも高速にマージ処理を実行できる。
Next, an example in which the merge processing device according to the first to eighth embodiments is configured by a computer and a hard disk device including a CPU and a main memory, and a program for causing the computer to perform merge processing will be described. A hard disk is used for storing records in the
上述の実施の形態では、本発明をハードウェアの構成として説明したが、本発明は、これに限定されるものではない。本発明は、任意の処理を、CPU(Central Processing Unit)にコンピュータプログラムを実行させることにより実現することも可能である。 In the above-described embodiments, the present invention has been described as a hardware configuration, but the present invention is not limited to this. The present invention can also realize arbitrary processing by causing a CPU (Central Processing Unit) to execute a computer program.
プログラムは、様々なタイプの非一時的なコンピュータ可読媒体(non-transitory computer readable medium)を用いて格納され、コンピュータに供給することができる。非一時的なコンピュータ可読媒体は、様々なタイプの実体のある記録媒体(tangible storage medium)を含む。非一時的なコンピュータ可読媒体の例は、磁気記録媒体(例えばフレキシブルディスク、磁気テープ、ハードディスクドライブ)、光磁気記録媒体(例えば光磁気ディスク)、CD−ROM(Read Only Memory)、CD−R、CD−R/W、半導体メモリ(例えば、マスクROM、PROM(Programmable ROM)、EPROM(Erasable PROM)、フラッシュROM、RAM(random access memory))を含む。また、プログラムは、様々なタイプの一時的なコンピュータ可読媒体(transitory computer readable medium)によってコンピュータに供給されてもよい。一時的なコンピュータ可読媒体の例は、電気信号、光信号、及び電磁波を含む。一時的なコンピュータ可読媒体は、電線及び光ファイバ等の有線通信路、又は無線通信路を介して、プログラムをコンピュータに供給できる。 The program may be stored using various types of non-transitory computer readable media and supplied to a computer. Non-transitory computer readable media include various types of tangible storage media. Examples of non-transitory computer-readable media include magnetic recording media (for example, flexible disks, magnetic tapes, hard disk drives), magneto-optical recording media (for example, magneto-optical disks), CD-ROMs (Read Only Memory), CD-Rs, CD-R / W and semiconductor memory (for example, mask ROM, PROM (Programmable ROM), EPROM (Erasable PROM), flash ROM, RAM (random access memory)) are included. The program may also be supplied to the computer by various types of transitory computer readable media. Examples of transitory computer readable media include electrical signals, optical signals, and electromagnetic waves. The temporary computer-readable medium can supply the program to the computer via a wired communication path such as an electric wire and an optical fiber, or a wireless communication path.
なお、本発明は上記実施の形態に限られたものではなく、趣旨を逸脱しない範囲で適宜変更することが可能である。 Note that the present invention is not limited to the above-described embodiment, and can be changed as appropriate without departing from the spirit of the present invention.
(付記1)ソートされた複数のレコードから構成されるレコード列が複数入力され、前記入力されたそれぞれのレコード列を、少なくとも1のレコードを含むレコードブロックに分離し、当該レコードブロックのそれぞれに含まれる複数のレコードの最後方に配置されている予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替える配置変換部と、前記配置変換部から複数のレコードブロックを取得し、記憶部へ入力する入力部と、前記複数のレコードブロックのそれぞれに含まれた前記予測用レコードの大小関係に基づいて、前記入力部が前記配置変換部から取得するレコード列を選択するレコード列選択部と、を備え、前記入力部は、前記レコードブロックに含まれるレコードのそれぞれを前記順序が入れ替えられたレコードの順に取得し、前記レコードブロックに含まれる全てのレコードを取得する前に、取得済の予測用レコードを前記レコード列選択部へ出力し、前記レコード列選択部は、前記入力部から出力された予測用レコードの入力に応じて、次に前記入力部が前記配置変換部から取得するレコード列を選択する処理を開始するマージ処理装置。 (Supplementary note 1) A plurality of record strings composed of a plurality of sorted records are input, and each of the input record strings is separated into record blocks including at least one record and included in each of the record blocks. A record conversion unit that changes the order of the records so that the prediction record arranged at the end of the plurality of records is positioned ahead of the currently arranged record, and a plurality of record blocks from the arrangement conversion unit And selecting a record string that the input unit acquires from the layout conversion unit based on the size relationship between the input unit that inputs to the storage unit and the prediction record included in each of the plurality of record blocks A record string selection unit that performs the recording, and the input unit precedes each of the records included in the record block. Before acquiring all the records included in the record block, in order of the records whose order has been changed, the acquired prediction record is output to the record sequence selection unit, and the record sequence selection unit The merge processing apparatus which starts the process which the said input part next selects the record row | line | column acquired from the said arrangement | positioning conversion part according to the input of the record for prediction output from the input part.
(付記2)前記配置変換部は、前記予測用レコードを前記レコードブロックの先頭に位置するように、前記レコードの順序を入れ替える、付記1記載のマージ処理装置。
(Supplementary note 2) The merge processing device according to
(付記3)前記入力部は、前記レコードの順序が入れ替えられたレコードブロックの順序を元に戻して、前記順序が元に戻されたレコードブロックを前記記憶部へ入力する、付記1又は2に記載のマージ処理装置。
(Supplementary note 3) In the
(付記4)ソートされた複数のレコードから構成されるレコード列が複数入力され、当該前記入力されたそれぞれのレコード列を少なくとも1のレコードを含む複数のレコードブロックに分離する分離部と、前記分離部に後から入力された前記レコードブロックから順に前記レコードブロックを取得し、記憶部へ入力するとともに、前記レコードブロック内で最も前方に位置するブロックを予測用レコードとして取り出す入力部と、前記複数のレコードブロックのそれぞれに含まれた前記予測用レコードの大小関係に基づいて、前記入力部が前記配置変換部から取得するレコードブロックを選択するレコード列選択部と、前記レコード列のソート順序と逆のソート順序に従い記憶部からレコードを順に取り出して出力する整列出力部とを備え、前記入力部は、前記レコードブロックのレコードを全て取得する前に、前記予測用レコードを前記レコード列選択部へ出力し、前記レコード列選択部は、前記入力部から出力された予測用レコードに基づいて、次に前記入力部が前記配置変換部から取得するレコード列を選択する処理を開始するマージ処理装置。 (Supplementary Note 4) A separation unit that inputs a plurality of record strings composed of a plurality of sorted records and separates the input record strings into a plurality of record blocks including at least one record, and the separation The record block is sequentially input from the record block that is input later to the unit, and the record block is input to the storage unit, and the input unit that takes out the block positioned at the forefront in the record block as a prediction record; Based on the magnitude relationship of the prediction records included in each of the record blocks, the input unit selects a record block to be acquired from the arrangement conversion unit, and the record sequence is reverse to the sort sequence of the record sequence A sort output unit that sequentially extracts records from the storage unit according to the sort order and outputs them The input unit outputs the prediction record to the record sequence selection unit before acquiring all the records of the record block, and the record sequence selection unit is based on the prediction record output from the input unit. Then, a merge processing device that starts processing for selecting a record string that the input unit acquires from the layout conversion unit.
(付記5)ソートされた複数のレコードから構成されるレコード列が複数入力され、前記入力されたそれぞれのレコード列を、少なくとも1のレコードを含むレコードブロックに分離し、当該レコードブロックのそれぞれに含まれる複数のレコードの最後方に配置されている第1の予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替える配置変換部と、前記配置変換部から複数のレコードブロックを取得し、第1の記憶部へ入力する第1の入力部と、前記レコード列のソート順序と同じソート順序に従い前記第1の記憶部からレコードを順に取り出して出力する第1の整列出力部と、前記配置変換部へ後から入力された前記レコードブロックから順に前記レコードブロックを取得し、第2の記憶部へ入力するとともに、前記レコードブロック内で最も前方に配置されているブロックを第2の予測用レコードとして取り出す第2の入力部と、前記レコード列のソート順序と逆のソート順序に従い前記第2の記憶部からレコードを順に取り出して出力する第2の整列出力部と、前記複数のレコードブロックのそれぞれに含まれた前記第1の予測用レコードの大小関係に基づいて、前記第1の入力部が前記配置変換部から取得するレコード列を選択する第1のレコード列選択部と、前記複数のレコードブロックのそれぞれに含まれた前記第2の予測用レコードの大小関係に基づいて、前記第2の入力部が前記配置変換部から取得するレコード列を選択する第2のレコード列選択部と、を備え、前記第1及び第2の入力部は、前記レコードブロックのレコードを全て取得する前に、前記第1及び第2の予測用レコードを前記第1及び第2のレコード列選択部へ出力し、前記第1及び第2のレコード列選択部は、前記第1及び第2の入力部から出力された第1及び第2の予測用レコードに基づいて、次に前記第1及び第2の入力部が前記配置変換部から取得するレコード列を選択する処理を開始するマージ処理装置。 (Supplementary note 5) A plurality of record strings composed of a plurality of sorted records are input, and each of the input record strings is separated into record blocks including at least one record and included in each of the record blocks A first conversion record arranged at the end of the plurality of records to be arranged, the arrangement conversion unit for changing the order of the records so as to be positioned in front of the currently arranged position, and a plurality of the arrangement conversion unit from the arrangement conversion unit A first input unit that inputs to the first storage unit, and sequentially outputs records from the first storage unit according to the same sort order as the record sequence. The record block is acquired in order from the record block input afterward to the alignment output unit and the arrangement conversion unit, and the second storage And the second input unit that takes out the block arranged at the foremost position in the record block as a second prediction record, and the second input unit according to the sort order opposite to the sort order of the record sequence. Based on the magnitude relationship between a second alignment output unit that sequentially extracts and outputs records from the storage unit, and the first prediction record included in each of the plurality of record blocks, the first input unit includes: Based on the magnitude relationship between a first record sequence selection unit that selects a record sequence to be acquired from the layout conversion unit and the second prediction record included in each of the plurality of record blocks, the second A second record sequence selection unit that selects a record sequence acquired from the arrangement conversion unit, and the first and second input units are configured to record the record block. Before acquiring all the records of the first and second records, the first and second record records are output to the first and second record string selectors, and the first and second record string selectors are A process of selecting a record sequence that the first and second input units acquire from the arrangement conversion unit next based on the first and second prediction records output from the first and second input units Merge processing device to start.
(付記6)前記配置変換部は、前記レコードブロックに含まれるレコードの前半の列と、残りのレコードを逆順に並び替えたレコードの列とを交互に配置する付記5に記載のマージ処理装置。
(Supplementary note 6) The merge processing device according to
(付記7)複数のレコードから構成されるレコード列を複数格納する記憶部と、前記記憶部に格納されたレコードを取り出してソート規則に従う順序に並び変えてレコードを出力する整列出力部と、複数のレコード列が少なくとも1のレコードを含むレコードブロックに分離され、当該レコードブロックのそれぞれにおいて外部からの入力時に最後方に配置されている予測用レコードに基づいて、次に入力するレコード列を選択するレコード列選択部とを含むマージ処理ユニットに、前記レコード列を入力する処理をコンピュータに実行させる制御プログラムであって、外部から前記レコードブロックを複数取得するするステップと、前記取得された複数のレコードブロックの最後方に配置されている予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替えるステップと、前記順序が入れ替えられたレコードの順に前記レコードを前記マージ処理ユニットに入力するステップと、をコンピュータに実行させる制御プログラム。 (Supplementary note 7) A storage unit that stores a plurality of record strings composed of a plurality of records, an alignment output unit that takes out the records stored in the storage unit and rearranges them in an order according to a sorting rule, and a plurality of output units The record sequence is separated into record blocks including at least one record, and the record sequence to be input next is selected based on the record for prediction arranged at the end of each record block at the time of external input. A control program for causing a computer to execute a process of inputting the record string in a merge processing unit including a record string selection unit, the step of acquiring a plurality of the record blocks from the outside, and the plurality of acquired records The record for prediction placed at the end of the block is currently placed A step of replacing the order of the records to be located forward of the location, a control program for executing the steps, to a computer for inputting the record in the order of records in which the sequence has been replaced with the merge processing unit.
(付記8)複数のレコードから構成されるレコード列を複数格納する記憶部と、前記記憶部に格納されたレコードを取り出してソート規則に従う順序に並び変えてレコードを出力する整列出力部と、複数のレコード列が少なくとも1のレコードを含むレコードブロックに分離され、当該レコードブロックのそれぞれにおいて外部からの入力時に最後方に配置されている予測用レコードに基づいて、次に入力するレコード列を選択するレコード列選択部とを含むマージ処理ユニットに、前記レコード列を入力する処理をコンピュータに実行させる制御プログラムであって、外部から前記レコードブロックを複数取得するするステップと、前記取得した複数のレコードブロックに含まれるレコードをソートするステップと、前記ソートされた複数のレコードブロックの最後方に配置されている予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替えるステップと、前記順序が入れ替えられたレコードの順に前記レコードを前記マージ処理ユニットに入力するステップと、をコンピュータに実行させる制御プログラム。 (Supplementary Note 8) A storage unit that stores a plurality of record strings composed of a plurality of records, an output unit that outputs records by taking out the records stored in the storage unit and rearranging them in an order according to a sorting rule, The record sequence is separated into record blocks including at least one record, and the record sequence to be input next is selected based on the record for prediction arranged at the end of each record block at the time of external input. A control program for causing a merge processing unit including a record sequence selection unit to execute a process of inputting the record sequence on a computer, the step of acquiring a plurality of the record blocks from the outside, and the plurality of acquired record blocks Sorting the records contained in and the sorted plurality Changing the order of the records so that the prediction record arranged at the end of the record block is positioned ahead of the currently arranged position; and the records in the order of the records in which the order is changed A control program for causing a computer to execute the step of inputting to the merge processing unit.
(付記9)ソートされた複数のレコードから構成されるレコード列が複数入力され、前記入力されたそれぞれのレコード列を、少なくとも1のレコードを含むレコードブロックに分離するステップと、前記複数のレコードブロックのそれぞれに含まれる複数のレコードの最後方に配置されている予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替えるステップと、前記レコードブロックに含まれるレコードのそれぞれを前記順序が入れ替えられたレコードの順に取得するとともに、取得済みの予測用レコードを出力するステップと、前記出力された予測用レコードの入力に応じて、次に入力されるレコード列を選択する処理を開始するステップと、を備えるレコードマージ方法。 (Additional remark 9) The step which isolate | separates each said input record row | line | column into the record block containing at least 1 record from which the several record row | line | column comprised from the some sort | sorted record is input, and the said several record block Reordering the records so that the prediction record arranged at the end of the plurality of records included in each of the records is positioned ahead of the position where the records are currently arranged, and the records included in the record block Are obtained in the order of the records in which the order has been changed, and a step of outputting the obtained prediction record and a record string to be input next are selected in accordance with the input of the output prediction record And a record merging method comprising:
(付記10)複数のレコードから構成されるレコード列が複数入力され、前記入力されたそれぞれのレコード列を、少なくとも1のレコードを含むレコードブロックに分離するステップと、前記レコードブロックに含まれるレコードをソートするステップと、前記複数のレコードブロックのそれぞれに含まれる複数のレコードの最後方に配置されている予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替えるステップと、前記レコードブロックに含まれるレコードのそれぞれを前記順序が入れ替えられたレコードの順に取得するとともに、取得済みの予測用レコードを出力するステップと、前記出力された予測用レコードの入力に応じて、次に入力されるレコード列を選択する処理を開始するステップと、を備えるレコードマージ方法。 (Supplementary Note 10) A plurality of record sequences each composed of a plurality of records are input, and each of the input record sequences is separated into record blocks including at least one record; and records included in the record block are The order of the records is changed so that the prediction record arranged at the end of the plurality of records included in each of the plurality of record blocks is positioned ahead of the currently arranged position. Acquiring each of the records included in the record block in the order of the records in which the order has been changed, outputting the acquired prediction record, and depending on the input of the output prediction record , Start the process to select the next input record string Record merge method comprising Tsu and up, the.
(付記11)複数のレコードから構成されるレコード列が複数入力され、当該前記入力されたそれぞれのレコード列を少なくとも1のレコードを含む複数のレコードブロックに分離し、当該レコードブロックに含まれるレコードをソートするソート処理部と、前記ソート処理部に後から入力された前記レコードブロックから順に前記レコードブロックを取得し、記憶部へ入力するとともに、前記レコードブロック内で最も前方に位置するブロックを予測用レコードとして取り出す入力部と、前記複数のレコードブロックのそれぞれに含まれた前記予測用レコードの大小関係に基づいて、前記入力部が前記配置変換部から取得するレコードブロックを選択するレコード列選択部と、前記レコード列のソート順序と逆のソート順序に従い記憶部からレコードを順に取り出して出力する整列出力部とを備え、前記入力部は、前記レコードブロックのレコードを全て取得する前に、前記予測用レコードを前記レコード列選択部へ出力し、前記レコード列選択部は、前記入力部から出力された予測用レコードに基づいて、次に前記入力部が前記配置変換部から取得するレコード列を選択する処理を開始するソート処理装置。 (Additional remark 11) A plurality of record sequences composed of a plurality of records are input, and each of the input record sequences is separated into a plurality of record blocks including at least one record, and records included in the record block are The sort processing unit for sorting, and the record blocks are acquired in order from the record block input later to the sort processing unit, input to the storage unit, and the block located at the forefront in the record block is used for prediction An input unit that is extracted as a record, and a record string selection unit that selects a record block that the input unit acquires from the arrangement conversion unit, based on the magnitude relationship of the prediction records included in each of the plurality of record blocks; The storage unit according to the sort order opposite to the sort order of the record sequence. An alignment output unit that sequentially extracts and outputs the records, and the input unit outputs the prediction records to the record sequence selection unit before acquiring all the records of the record block, and the record sequence selection unit Is a sort processing device that starts processing for selecting a record sequence that the input unit acquires from the arrangement conversion unit next, based on the prediction record output from the input unit.
(付記12)複数のレコードから構成されるレコード列が複数入力され、前記入力されたそれぞれのレコード列を、少なくとも1のレコードを含むレコードブロックに分離し、当該レコードブロックに含まれるレコードをソートするソート処理部と、前記レコードブロックのそれぞれに含まれる複数のレコードの最後方に配置されている予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替える配置変換部と、前記配置変換部から複数のレコードブロックを取得し、記憶部へ入力する入力部と、前記複数のレコードブロックのそれぞれに含まれた前記予測用レコードの大小関係に基づいて、前記入力部が前記配置変換部から取得するレコード列を選択するレコード列選択部と、を備え、前記入力部は、前記レコードブロックに含まれるレコードのそれぞれを前記順序が入れ替えられたレコードの順に取得し、前記レコードブロックに含まれる全てのレコードを取得する前に、取得済の予測用レコードを前記レコード列選択部へ出力し、前記レコード列選択部は、前記入力部から出力された予測用レコードの入力に応じて、次に前記入力部が前記配置変換部から取得するレコード列を選択する処理を開始するソート処理装置。 (Supplementary note 12) A plurality of record strings composed of a plurality of records are input, the input record strings are separated into record blocks including at least one record, and the records included in the record block are sorted. Arrangement conversion that rearranges the order of records so that the sorting record and the prediction record arranged at the end of the plurality of records included in each of the record blocks are positioned ahead of the currently arranged position A plurality of record blocks from the layout conversion unit and input to the storage unit, and the input unit based on the magnitude relationship of the prediction records included in each of the plurality of record blocks A record string selection unit that selects a record string to be acquired from the arrangement conversion unit, and the input unit , Each of the records included in the record block is acquired in the order of the records in which the order is changed, and before acquiring all the records included in the record block, the acquired prediction records are stored in the record string selection unit. The record sequence selection unit sorts to start processing for selecting a record sequence that the input unit acquires from the layout conversion unit in response to the input of the prediction record output from the input unit Processing equipment.
10 マージ処理装置
20 配置変換部
22、22_1 入力部
24、24_1 記憶部
26、26_1 レコード列選択部
30 入力記憶部
32、32_1 整列出力部
41 第1のバッファ
42 第2のバッファ
43 第Pのバッファ
50 入力供給部
60 出力記憶部
DESCRIPTION OF
Claims (10)
前記配置変換部から複数のレコードブロックを取得し、記憶部へ入力する入力部と、
前記複数のレコードブロックのそれぞれに含まれた前記予測用レコードの大小関係に基づいて、前記入力部が前記配置変換部から取得するレコード列を選択するレコード列選択部と、を備え、
前記入力部は、
前記レコードブロックに含まれるレコードのそれぞれを前記順序が入れ替えられたレコードの順に取得し、前記レコードブロックに含まれる全てのレコードを取得する前に、取得済の予測用レコードを前記レコード列選択部へ出力し、
前記レコード列選択部は、
前記入力部から出力された予測用レコードの入力に応じて、次に前記入力部が前記配置変換部から取得するレコード列を選択する処理を開始するマージ処理装置。 A plurality of record sequences composed of a plurality of sorted records are input, and each of the input record sequences is separated into record blocks including at least one record, and a plurality of records included in each of the record blocks An arrangement conversion unit that changes the order of records so that the prediction record arranged at the end of the record is positioned ahead of the currently arranged position;
An input unit that obtains a plurality of record blocks from the arrangement conversion unit and inputs to the storage unit;
Based on the magnitude relationship of the prediction records included in each of the plurality of record blocks, a record sequence selection unit that selects a record sequence that the input unit acquires from the arrangement conversion unit, and
The input unit is
Each of the records included in the record block is acquired in the order of the records whose order has been changed, and before the acquisition of all the records included in the record block, the acquired prediction records are transferred to the record sequence selection unit. Output,
The record string selection unit
The merge processing apparatus which starts the process which the said input part next selects the record row | line | column which the said input part acquires from the said arrangement | positioning conversion part according to the input of the record for prediction output from the said input part.
前記予測用レコードを前記レコードブロックの先頭に位置するように、前記レコードの順序を入れ替える、請求項1記載のマージ処理装置。 The arrangement conversion unit
The merge processing apparatus according to claim 1, wherein the order of the records is changed so that the prediction record is positioned at a head of the record block.
前記レコードの順序が入れ替えられたレコードブロックの順序を元に戻して、前記順序が元に戻されたレコードブロックを前記記憶部へ入力する、請求項1又は2に記載のマージ処理装置。 The input unit is
The merge processing apparatus according to claim 1, wherein the order of the record blocks in which the order of the records is changed is returned to the original, and the record block in which the order is returned is input to the storage unit.
前記分離部に後から入力された前記レコードブロックから順に前記レコードブロックを取得し、記憶部へ入力するとともに、前記レコードブロック内で最も前方に位置するブロックを予測用レコードとして取り出す入力部と、
前記複数のレコードブロックのそれぞれに含まれた前記予測用レコードの大小関係に基づいて、前記入力部が前記配置変換部から取得するレコードブロックを選択するレコード列選択部と、
前記レコード列のソート順序と逆のソート順序に従い記憶部からレコードを順に取り出して出力する整列出力部とを備え、
前記入力部は、
前記レコードブロックのレコードを全て取得する前に、前記予測用レコードを前記レコード列選択部へ出力し、
前記レコード列選択部は、
前記入力部から出力された予測用レコードに基づいて、次に前記入力部が前記配置変換部から取得するレコード列を選択する処理を開始するマージ処理装置。 A plurality of record strings composed of a plurality of sorted records, and a separation unit that separates each of the input record strings into a plurality of record blocks including at least one record;
The record block is sequentially input from the record block input later to the separation unit, and input to the storage unit, and the input unit that takes out the block located most forward in the record block as a record for prediction,
Based on the magnitude relationship of the prediction records included in each of the plurality of record blocks, a record string selection unit that selects a record block that the input unit acquires from the arrangement conversion unit;
An alignment output unit that sequentially extracts and outputs records from the storage unit in accordance with a sort order opposite to the record sequence sort order;
The input unit is
Before acquiring all the records of the record block, output the prediction record to the record string selection unit,
The record string selection unit
A merge processing apparatus that starts processing for selecting a record sequence that the input unit acquires from the arrangement conversion unit next based on the prediction record output from the input unit.
前記配置変換部から複数のレコードブロックを取得し、第1の記憶部へ入力する第1の入力部と、
前記レコード列のソート順序と同じソート順序に従い前記第1の記憶部からレコードを順に取り出して出力する第1の整列出力部と、
前記配置変換部へ後から入力された前記レコードブロックから順に前記レコードブロックを取得し、第2の記憶部へ入力するとともに、前記レコードブロック内で最も前方に配置されているブロックを第2の予測用レコードとして取り出す第2の入力部と、
前記レコード列のソート順序と逆のソート順序に従い前記第2の記憶部からレコードを順に取り出して出力する第2の整列出力部と、
前記複数のレコードブロックのそれぞれに含まれた前記第1の予測用レコードの大小関係に基づいて、前記第1の入力部が前記配置変換部から取得するレコード列を選択する第1のレコード列選択部と、
前記複数のレコードブロックのそれぞれに含まれた前記第2の予測用レコードの大小関係に基づいて、前記第2の入力部が前記配置変換部から取得するレコード列を選択する第2のレコード列選択部と、を備え、
前記第1及び第2の入力部は、
前記レコードブロックのレコードを全て取得する前に、前記第1及び第2の予測用レコードを前記第1及び第2のレコード列選択部へ出力し、
前記第1及び第2のレコード列選択部は、
前記第1及び第2の入力部から出力された第1及び第2の予測用レコードに基づいて、次に前記第1及び第2の入力部が前記配置変換部から取得するレコード列を選択する処理を開始するマージ処理装置。 A plurality of record sequences composed of a plurality of sorted records are input, and each of the input record sequences is separated into record blocks including at least one record, and a plurality of records included in each of the record blocks An arrangement conversion unit that changes the order of the records so that the first prediction record arranged at the end of the first prediction record is positioned ahead of the position at which the current prediction is arranged;
A first input unit that obtains a plurality of record blocks from the arrangement conversion unit and inputs them to a first storage unit;
A first alignment output unit that sequentially extracts and outputs records from the first storage unit according to the same sort order as the record sequence;
The record blocks are acquired in order from the record block input later to the arrangement conversion unit, input to the second storage unit, and the block most forwardly arranged in the record block is second predicted. A second input part to be taken out as a record for use,
A second alignment output unit for sequentially extracting and outputting records from the second storage unit in accordance with a sort order opposite to the record sequence sort order;
A first record string selection that selects a record string that the first input unit acquires from the arrangement conversion unit based on the magnitude relationship of the first prediction records included in each of the plurality of record blocks And
Second record sequence selection for selecting a record sequence that the second input unit acquires from the layout conversion unit based on the magnitude relationship of the second prediction records included in each of the plurality of record blocks And comprising
The first and second input units are:
Before acquiring all the records of the record block, the first and second prediction records are output to the first and second record string selection units,
The first and second record string selection units are:
Next, based on the first and second prediction records output from the first and second input units, the first and second input units select a record sequence to be acquired from the arrangement conversion unit. Merge processing device that starts processing.
前記レコードブロックに含まれるレコードの前半の列と、残りのレコードを逆順に並び替えたレコードの列とを交互に配置する請求項5に記載のマージ処理装置。 The arrangement conversion unit
The merge processing apparatus according to claim 5, wherein a first half column of records included in the record block and a column of records in which the remaining records are rearranged in reverse order are alternately arranged.
外部から前記レコードブロックを複数取得するするステップと、
前記取得された複数のレコードブロックの最後方に配置されている予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替えるステップと、
前記順序が入れ替えられたレコードの順に前記レコードを前記マージ処理ユニットに入力するステップと、をコンピュータに実行させる制御プログラム。 A storage unit that stores a plurality of record strings composed of a plurality of records, an alignment output unit that outputs records by taking out the records stored in the storage unit and rearranging them in an order according to a sorting rule, and a plurality of record sequences A record string selection unit that selects a record string to be input next based on a prediction record that is separated into record blocks including at least one record and is arranged at the end of each record block at the time of external input. A control program for causing a computer to execute a process of inputting the record string in a merge processing unit including:
Obtaining a plurality of the record blocks from the outside;
Reordering the records so that the prediction records arranged at the end of the plurality of obtained record blocks are positioned ahead of the currently arranged positions;
A control program for causing a computer to execute the step of inputting the records to the merge processing unit in the order of the records in which the order has been changed.
外部から前記レコードブロックを複数取得するするステップと、
前記取得した複数のレコードブロックに含まれるレコードをソートするステップと、
前記ソートされた複数のレコードブロックの最後方に配置されている予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替えるステップと、
前記順序が入れ替えられたレコードの順に前記レコードを前記マージ処理ユニットに入力するステップと、をコンピュータに実行させる制御プログラム。 A storage unit that stores a plurality of record strings composed of a plurality of records, an alignment output unit that outputs records by taking out the records stored in the storage unit and rearranging them in an order according to a sorting rule, and a plurality of record sequences A record string selection unit that selects a record string to be input next based on a prediction record that is separated into record blocks including at least one record and is arranged at the end of each record block at the time of external input. A control program for causing a computer to execute a process of inputting the record string in a merge processing unit including:
Obtaining a plurality of the record blocks from the outside;
Sorting the records included in the plurality of obtained record blocks;
Reordering the records so that the prediction records arranged at the end of the plurality of sorted record blocks are positioned ahead of the currently arranged positions;
A control program for causing a computer to execute the step of inputting the records to the merge processing unit in the order of the records in which the order has been changed.
前記複数のレコードブロックのそれぞれに含まれる複数のレコードの最後方に配置されている予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替えるステップと、
前記レコードブロックに含まれるレコードのそれぞれを前記順序が入れ替えられたレコードの順に取得するとともに、取得済みの予測用レコードを出力するステップと、
前記出力された予測用レコードの入力に応じて、次に入力されるレコード列を選択する処理を開始するステップと、を備えるレコードマージ方法。 A step of inputting a plurality of record strings composed of a plurality of sorted records, and separating each of the input record strings into record blocks including at least one record;
Reversing the order of the records so that the prediction record arranged at the end of the plurality of records included in each of the plurality of record blocks is positioned ahead of the currently arranged position;
Obtaining each of the records included in the record block in the order of the records in which the order is changed, and outputting the acquired prediction record;
Starting a process of selecting a record string to be input next in response to the input of the output prediction record.
前記レコードブロックに含まれるレコードをソートするステップと、
前記複数のレコードブロックのそれぞれに含まれる複数のレコードの最後方に配置されている予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替えるステップと、
前記レコードブロックに含まれるレコードのそれぞれを前記順序が入れ替えられたレコードの順に取得するとともに、取得済みの予測用レコードを出力するステップと、
前記出力された予測用レコードの入力に応じて、次に入力されるレコード列を選択する処理を開始するステップと、を備えるレコードマージ方法。 A plurality of record strings composed of a plurality of records are input, and each of the input record strings is separated into record blocks including at least one record;
Sorting the records contained in the record block;
Reversing the order of the records so that the prediction record arranged at the end of the plurality of records included in each of the plurality of record blocks is positioned ahead of the currently arranged position;
Obtaining each of the records included in the record block in the order of the records in which the order is changed, and outputting the acquired prediction record;
Starting a process of selecting a record string to be input next in response to the input of the output prediction record.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010104008A JP2011233012A (en) | 2010-04-28 | 2010-04-28 | Merge processor, control program and record merge method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010104008A JP2011233012A (en) | 2010-04-28 | 2010-04-28 | Merge processor, control program and record merge method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2011233012A true JP2011233012A (en) | 2011-11-17 |
Family
ID=45322261
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2010104008A Pending JP2011233012A (en) | 2010-04-28 | 2010-04-28 | Merge processor, control program and record merge method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2011233012A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11200056B2 (en) | 2018-02-08 | 2021-12-14 | Nec Corporation | Parallel union control device, parallel union control method, and storage medium |
-
2010
- 2010-04-28 JP JP2010104008A patent/JP2011233012A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11200056B2 (en) | 2018-02-08 | 2021-12-14 | Nec Corporation | Parallel union control device, parallel union control method, and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6253514B2 (en) | Processor | |
KR102168930B1 (en) | Methods and apparatuses for providing data received by a state machine engine | |
CN107038206B (en) | LSM tree establishing method, LSM tree data reading method and server | |
JP4215606B2 (en) | Disk array device, storage capacity expansion method and program | |
JP6218294B2 (en) | Composite marching memory, computer system and marching memory cell array | |
CN115905233B (en) | Merging tree data ordering system and ordering method | |
US20030037209A1 (en) | Memory engine for the inspection and manipulation of data | |
CN108139867B (en) | For realizing the system and method for the high read rate to data element list | |
CN101923522B (en) | Storage controller and processing method of data operation commands | |
JP7044118B2 (en) | Parallel union controller, parallel union control method, and parallel union control program | |
JP2011233012A (en) | Merge processor, control program and record merge method | |
JP5083367B2 (en) | SEARCH DEVICE, SEARCH METHOD, AND COMPUTER PROGRAM | |
JP2009093556A (en) | Index construction method, document retrieval apparatus and index construction program | |
KR102122406B1 (en) | Method and apparatus for processing shuffle instruction | |
JP5282522B2 (en) | Information management apparatus, information management method, and information management program | |
US20180046400A1 (en) | Columnar data storage on tape partition | |
CN106547490B (en) | Data read-write method and data read-write system | |
JP2016076100A (en) | File division system and method | |
KR102161742B1 (en) | Pipeline system including feedback route and operating method of the same | |
CN101882061A (en) | Memory control methods and storage control device | |
JP6131818B2 (en) | Cache method, cache device, and computer program | |
JPWO2009044486A1 (en) | Method for sorting tabular data, multi-core type apparatus, and program | |
JP2009199439A (en) | Merge sort processing method, merge sort processing device, and merge sort processing program | |
US11789700B2 (en) | Information processing device, information processing system, and non-transitory computer-readable storage medium for storing program | |
JP2017032621A (en) | Pause length control unit, pause length control method, and program |