JP2011233012A - Merge processor, control program and record merge method - Google Patents

Merge processor, control program and record merge method Download PDF

Info

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
Application number
JP2010104008A
Other languages
Japanese (ja)
Inventor
Atsushi Hatao
敦史 幡生
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.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP2010104008A priority Critical patent/JP2011233012A/en
Publication of JP2011233012A publication Critical patent/JP2011233012A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To provide a merge processor, a control program and a record merge method for achieving the efficient input of records.SOLUTION: A merge processor 10 is provided with: an arrangement conversion part 20 for inputting a plurality of record columns consisting of a plurality of sorted records, and for dividing each record column into record blocks each of which includes at least one record, and for replacing a sequence so that a record for prediction included in each of the record blocks can be positioned at the front part; an input part 22 for inputting the record blocks to a storage part 24; and a record column selection part 26 for selecting the record column to be acquired based on the record for prediction. The input part 22 acquires the records in the order of the replacement of the sequence, and outputs the acquired record for prediction before acquiring all the records, and the record column selection part 26 selects the record column to be acquired next based on the record for prediction.

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 Document 1. The rearrangement unit of the data to be sorted is “record”, and a plurality of records rearranged according to the sort order is “run”. The number of runs to be merged is expressed using an integer P of 2 or more. Each series is given a number (serial number) from 1 to P.

マージ処理装置100は、外部の入力供給部150からマージするP個の連のレコードデータを入力し、内部でマージ処理を行った後、得られたマージ済み連のレコードを外部の出力記憶部160へ出力する。マージ処理装置100は、入力供給部150からレコードが入力される入力部110と、入力部110に入力されたレコードを格納する一時記憶部120と、一時記憶部120内のレコードを1個ずつ読み出し、ソート順序に従い並び替えて外部の出力記憶部160に出力する整列出力部140と、を備えている。さらに、入力部が入力する連の選択を行う入力連選択部130を備えている。   The merge processing apparatus 100 inputs P series of record data to be merged from the external input supply unit 150, performs merge processing therein, and then obtains the merged series of records obtained from the external output storage unit 160. Output to. The merge processing apparatus 100 reads the input unit 110 to which a record is input from the input supply unit 150, the temporary storage unit 120 that stores the record input to the input unit 110, and the records in the temporary storage unit 120 one by one. A sort output unit 140 that rearranges them according to the sort order and outputs them to the external output storage unit 160. Further, an input ream selection unit 130 for selecting a ream input by the input unit is provided.

ここで、一時記憶部120は、マージされる連のレコードを全て格納するだけの容量を備えていない。そのため、一時記憶部120は、少しずつレコードデータを取得しながらマージ処理を進行させる。一時記憶部120へのレコード入力処理は、1個または複数のレコードの集まりであるレコードブロックを一単位として行われる。さらに入力部110は、P個の連で共有されている。そのため、一時記憶部120は、P個の連からレコードを同時に入力することはできず、入力する連を切り替えながら入力を進める。具体例としては、マージ処理装置100にメモリバスを介して接続されたSDRAMメモリからバースト転送モードを利用してレコードのデータを読み出す場合がある。このような事例を記載した文献として特許文献1がある。あるいは別の例として、マージ処理装置100に接続されたディスク装置からレコードのデータを所定長のブロック単位でまとめて入力する場合、イーサネット(登録商標)で接続されたストレージサーバからレコードを一定長のレコードブロック単位で読み出す場合などがある。   Here, the temporary storage unit 120 does not have a capacity for storing all of the continuous records to be merged. Therefore, the temporary storage unit 120 proceeds with the merge process while acquiring the record data little by little. The record input process to the temporary storage unit 120 is performed with a record block that is a collection of one or more records as a unit. Further, the input unit 110 is shared by P series. For this reason, the temporary storage unit 120 cannot input records from P reams simultaneously, and advances the input while switching the reams to be input. As a specific example, there is a case where data of a record is read out from an SDRAM memory connected to the merge processing apparatus 100 via a memory bus using a burst transfer mode. There is Patent Document 1 as a document describing such cases. Alternatively, as another example, when record data is collectively input in units of blocks having a predetermined length from a disk device connected to the merge processing apparatus 100, a record of a certain length is stored from a storage server connected by Ethernet (registered trademark). There are cases where data is read in units of record blocks.

マージ処理中に入力部110から一時記憶部120へ出力されるレコードブロックの選択は、入力連選択部によって行われる。整列出力部140の動作を停止させることなくマージ処理を高速に進行させるためには、P個の連の全てに対して一時記憶部120におけるレコード格納個数が空にならないよう十分な速度でレコードが一時記憶部120に入力される必要がある。しかし、各々の連に用いられるバッファからレコードが出力される速度は入力に依存して変化する。そのため、入力連選択部130は、一時記憶部のレコード格納状態を観測しながら入力連の決定を行う。この入力連の選択制御において有効な技法として、非特許文献1、P307及び非特許文献2、APPENDIX2において、予測(forecast)に基づく選択手法が考案されている   Selection of the record block output from the input unit 110 to the temporary storage unit 120 during the merge process is performed by the input continuous selection unit. In order to advance the merge process at high speed without stopping the operation of the alignment output unit 140, the records are stored at a sufficient speed so that the number of records stored in the temporary storage unit 120 is not empty for all of the P series. It is necessary to input to the temporary storage unit 120. However, the speed at which records are output from the buffer used for each series varies depending on the input. Therefore, the input sequence selection unit 130 determines the input sequence while observing the record storage state of the temporary storage unit. As an effective technique in this input selection control, Non-Patent Document 1, P307 and Non-Patent Document 2, APPENDIX 2 have devised a selection method based on prediction.

ここで、非特許文献1及び非特許文献2連番号に開示されている予測(forecast)について具体的に説明する。一時記憶部120の第iのバッファに対して、第iの連からその時点で一時記憶部120に入力し終えた最後のレコードを第iの連の最後方レコードとする。予測に基づく手法では、入力選択部130は、P個ある最後方レコードの中からソート順序が最も前方になるレコードを選び出し、そのレコードを供給した連を、次にレコードを入力する連として選択する。このように選択された連は、その時点で後続のレコード供給を最も早く必要とする連を示している。そのため、予測に基づく入力連の選択手法は、一時記憶部120に必要なレコード記憶領域の容量や、マージ処理遅延を減らす上で好ましい手法である。   Here, the prediction disclosed in Non-Patent Document 1 and Non-Patent Document 2 serial numbers will be described in detail. For the i-th buffer in the temporary storage unit 120, the last record that has been input to the temporary storage unit 120 from the i-th sequence at that time is defined as the last record of the i-th sequence. In the prediction-based method, the input selection unit 130 selects a record that has the most forward sorting order from among the P last records, and selects the sequence that supplied the record as the sequence for inputting the next record. . The ream selected in this way indicates the ream that needs the earliest record supply at that time. Therefore, the input reaming selection method based on prediction is a preferable method for reducing the capacity of the record storage area required for the temporary storage unit 120 and the merge processing delay.

特開平5−298069号公報JP-A-5-298069

The Art of Computer Programming Volume 3 Sorting and Searching Second Edition 日本語版、Donald E.Knuth (著) 、有澤誠 (監訳)、和田英一 (監訳) 、アスキー、2006年The Art of Computer Programming Volume 3 Sorting and Searching Second Edition Japanese Edition, Donald E. Knuth (Author), Makoto Arisawa (Director), Eiichi Wada (Director), ASCII, 2006 E.H. Friend, "Sorting on Electronic Computer Systems," J. ACM, vol. 3, no. 3, 1956, pp. 134-168.E.H.Friend, "Sorting on Electronic Computer Systems," J. ACM, vol. 3, no. 3, 1956, pp. 134-168.

しかし、マージ処理装置において予測に基づく入力連選択を用いる場合、予測自体に要する処理時間や、入力先の連番号を決定してから実際にレコードデータが入力されるまでの遅延時間が大きいときに、レコード入力処理の実行が効率良く行われない。さらに、マージ処理速度の低下が引き起こされる問題がある。この問題について、図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 input supply unit 150, a process for inputting a record from the input supply unit 150, and a process for determining an input sequence. In this figure, it is assumed that there is a delay of 3 records from when the input supply unit 150 is requested to supply records to when record data is input. A record block as an input unit is composed of eight records, which are arranged in the order according to the sorting rule. When an input series is selected based on the prediction, the last input among these records is used. Therefore, as shown in FIG. 19, there is a problem that record input is not performed at all during the input series selection process and during input delay, and the efficiency of the record input process is poor.

この問題を解決するためには、冗長なバッファを用意していくつかのレコードブロックを先読みする手法や、全てのレコード入力を待たずに投機的に次の入力連を予測選択する手法などが考えられる。しかし、必要なバッファ容量と処理遅延時間を増加させる問題や、予測が外れた場合に時間ペナルティが生じるため、妥当ではない。   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 is a configuration diagram of a merge processing apparatus according to a first embodiment; 実施の形態1にかかるマージ処理装置の構成図である。1 is a configuration diagram of a merge processing apparatus according to a first embodiment; 実施の形態1にかかるレコードの並び替えを示す図である。It is a figure which shows the rearrangement of the record concerning Embodiment 1. FIG. 実施の形態1にかかる予測処理のフローチャートである。3 is a flowchart of prediction processing according to the first exemplary embodiment. 実施の形態1にかかるレコード入力要求の動作を示す図である。It is a figure which shows the operation | movement of the record input request concerning Embodiment 1. FIG. 実施の形態2にかかるマージ処理装置の構成図である。FIG. 3 is a configuration diagram of a merge processing apparatus according to a second embodiment; 実施の形態2にかかるレコードの並び替えを示す図である。It is a figure which shows the rearrangement of the record concerning Embodiment 2. FIG. 実施の形態3にかかるマージ処理装置の構成図である。FIG. 10 is a configuration diagram of a merge processing apparatus according to a third embodiment; 実施の形態3にかかるレコードの並び替えを示す図である。It is a figure which shows the rearrangement of the record concerning Embodiment 3. FIG. 実施の形態3にかかるレコードの並び替えを示す図である。It is a figure which shows the rearrangement of the record concerning Embodiment 3. FIG. 実施の形態4にかかるレコードの並び替えを示す図である。It is a figure which shows the rearrangement of the record concerning Embodiment 4. FIG. 実施の形態4にかかるレコードの並び替えを示す図である。It is a figure which shows the rearrangement of the record concerning Embodiment 4. FIG. 実施の形態5にかかるマージ処理装置の構成図である。FIG. 10 is a configuration diagram of a merge processing apparatus according to a fifth embodiment; 実施の形態6にかかるマージ処理装置の構成図である。FIG. 10 is a configuration diagram of a merge processing apparatus according to a sixth embodiment; 実施の形態6にかかるマージ処理装置の構成図である。FIG. 10 is a configuration diagram of a merge processing apparatus according to a sixth embodiment; 実施の形態7にかかるソート処理装置の構成図である。FIG. 10 is a configuration diagram of a sort processing apparatus according to a seventh embodiment; 実施の形態8にかかるソート処理装置の構成図である。FIG. 10 is a configuration diagram of a sort processing apparatus according to an eighth embodiment; 一般的なマージ処理装置の構成図である。It is a block diagram of a general merge processing apparatus. 一般的なマージ処理装置におけるレコード入力要求の動作を示す図である。It is a figure which shows the operation | movement of the record input request in a common merge processing apparatus.

(実施の形態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 merge processing apparatus 10 includes an arrangement conversion unit 20, an input unit 22, a storage unit 24, and a record string selection unit 26.

配置変換部20は、ソートされた複数のレコードから構成されるレコード列が複数入力される。さらに、配置変換部20は、入力された複数のレコード列を、少なくとも1のレコードを含むレコードブロックに分離し、それぞれのレコードブロックに含まれる複数のレコードの最後方に配置されている予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替える。   The arrangement conversion unit 20 receives a plurality of record strings composed of a plurality of sorted records. Furthermore, the arrangement conversion unit 20 separates the input plurality of record strings into record blocks including at least one record, and the prediction record arranged at the end of the plurality of records included in each record block The order of the records is changed so as to be positioned in front of the currently arranged position.

入力部22は、配置変換部20から複数のレコードブロックを取得し、記憶部24へ入力する。入力部22は、配置変換部20から、レコードブロックに含まれるレコードのそれぞれを順序が入れ替えられたレコードの順に取得する。これにより、入力部22は、レコードブロックに含まれる全てのレコードを取得する前に、予測用レコードを取得することができる。入力部22は、レコードブロックに含まれる全てのレコードを取得する前に、取得済みの予測用レコードを、レコード列選択部26へ出力する。   The input unit 22 acquires a plurality of record blocks from the arrangement conversion unit 20 and inputs them to the storage unit 24. The input unit 22 acquires from the layout conversion unit 20 the records included in the record block in the order of the records whose order has been changed. Thereby, the input part 22 can acquire the record for prediction, before acquiring all the records contained in a record block. The input unit 22 outputs the acquired prediction record to the record string selection unit 26 before acquiring all the records included in the record block.

レコード列選択部26は、複数のレコードブロックのそれぞれに含まれた予測用レコードに基づいて、入力部22が配置変換部20から取得するレコード列を選択する。レコード列選択部26によって選択されたレコード列は、入力部22における現在のレコード列の取得が完了後に、入力部22によって配置変換部20から取得される。   The record string selection unit 26 selects a record string that the input unit 22 acquires from the arrangement conversion unit 20 based on the prediction records included in each of the plurality of record blocks. The record sequence selected by the record sequence selection unit 26 is acquired from the layout conversion unit 20 by the input unit 22 after the acquisition of the current record sequence in the input unit 22 is completed.

記憶部24は、入力部22から入力されたレコード列を格納する。   The storage unit 24 stores the record string input from the input unit 22.

以上説明したように、図1において説明したマージ処理装置10を用いることにより、入力部22は、レコードブロックに含まれるレコードを全て取得する前に、予測用レコードを取得することができる。これにより、入力部22は、レコードブロックに含まれるレコードを全て取得する前に、予測用レコードをレコード列選択部26へ出力することができる。よって、レコード列選択部26は、出力された予測用レコードに基づいて、入力部22が配置変換部20からレコードブロックに含まれるレコードを全て取得する前に、次に入力部22が配置変換部20から取得するレコード列を選択する処理を開始することができる。そのため、配置変換部から入力部にレコード列が入力されてから、次のレコード列が入力されるまでの時間を短縮することができるため、レコード列の効率的な入力処理を実現することができる。   As described above, by using the merge processing device 10 described in FIG. 1, the input unit 22 can acquire a prediction record before acquiring all the records included in the record block. Thereby, the input unit 22 can output the prediction record to the record sequence selection unit 26 before acquiring all the records included in the record block. Therefore, before the input unit 22 acquires all the records included in the record block from the arrangement conversion unit 20 based on the output prediction record, the record sequence selection unit 26 next inputs the arrangement conversion unit. The process of selecting the record string acquired from 20 can be started. Therefore, since the time from when the record sequence is input to the input unit from the layout conversion unit until the next record sequence is input can be shortened, efficient input processing of the record sequence can be realized. .

続いて、図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 merge processing apparatus 10 includes an arrangement conversion unit 20, an input unit 22, a storage unit 24, a record string selection unit 26, an input storage unit 30, and an alignment output unit 32. The storage unit 24 includes a first buffer 41, a second buffer 42, and a Pth buffer 43. The merge processing apparatus 10 is connected to the input supply unit 50 and the output storage unit 60. Components of the merge processing apparatus 10 having the same functions as those in FIG. 1 will be described with the same reference numerals as those in FIG. In addition, the term “run” used in the following description has the same meaning as the record string described above.

マージ処理装置10は、外部の入力供給部50から、マージするP個の連のレコードデータが入力される。各々の連は、1からPまでの番号(連番号)を用いて識別される。マージ処理装置10は、装置内部においてP個の連のマージ処理を行った後、得られたマージ済み連のレコードを外部の出力記憶部60へ出力する。   The merge processing apparatus 10 receives P series of record data to be merged from an external input supply unit 50. Each series is identified using a number from 1 to P (serial number). The merge processing apparatus 10 performs merge processing of P series in the apparatus, and then outputs the obtained merged series of records to the external output storage unit 60.

配置変換部20は、入力供給部50から供給されるレコードを取得し、レコードの配置を並び替える。例えば、配置変換部20は、連に含まれる複数のレコードを、予め定められたレコード数を有するレコードブロックに区切り、レコードブロックの最後方に配置されているレコード、つまり予測用レコードを、先頭に位置するように配置する。   The arrangement conversion unit 20 acquires the records supplied from the input supply unit 50, and rearranges the arrangement of the records. For example, the arrangement conversion unit 20 divides a plurality of records included in the series into record blocks having a predetermined number of records, and sets the record arranged at the end of the record block, that is, the prediction record, to the top. Arrange to position.

入力記憶部30は、配置変換部20からレコードが入力され、並び替えられたレコードをレコードブロック単位に記憶する。   The input storage unit 30 receives records from the layout conversion unit 20 and stores the sorted records in units of record blocks.

入力部22は、入力記憶部30から、配置変換部20によって順序が入れ替えられたレコードの順にレコードを取得する。入力部22は、レコード列選択部26によって選択された連から、レコードブロック単位にレコードを取得する。入力部22は、予測用レコードを取得すると、レコードブロックに含まれる全てのレコードを取得する前に、取得した予測用レコードをレコード列選択部26へ出力する。さらに、入力部22は、取得したレコードを、並び替え前のソート順序に復元して、記憶部24へ出力する。   The input unit 22 acquires records from the input storage unit 30 in the order of the records whose order has been changed by the arrangement conversion unit 20. The input unit 22 acquires a record for each record block from the sequence selected by the record string selection unit 26. When the input unit 22 acquires the prediction record, the input unit 22 outputs the acquired prediction record to the record sequence selection unit 26 before acquiring all the records included in the record block. Further, the input unit 22 restores the acquired records to the sort order before rearrangement and outputs the records to the storage unit 24.

記憶部24は、連ごとにレコードを格納するために複数のバッファを有している。例えば、マージ処理装置10にP個の連が入力される場合、連1を格納するバッファを第1のバッファ41とし、連2を格納するバッファを第2のバッファ42とし、連Pを格納するバッファを第Pのバッファ43とする。記憶部24は、連ごとに、復元されたレコードの順にそれぞれのバッファへレコードを格納する。   The storage unit 24 has a plurality of buffers for storing records for each series. For example, when P runs are input to the merge processing apparatus 10, the buffer that stores run 1 is the first buffer 41, the buffer that stores run 2 is the second buffer 42, and the run P is stored. The buffer is a Pth buffer 43. The storage unit 24 stores the records in the respective buffers in the order of the restored records for each series.

整列出力部32は、記憶部24内のレコードをソート順序に従いながら読み出し、外部の出力記憶部60へ出力する。例えば、整列出力部32は、それぞれのバッファの先頭に位置するレコードの値が一番小さいレコードを読み出す。これにより、整列出力部32は、値の小さいレコードから順にレコードをソートして、複数の連をマージすることができる。   The alignment output unit 32 reads the records in the storage unit 24 according to the sort order, and outputs the records to the external output storage unit 60. For example, the alignment output unit 32 reads the record having the smallest record value located at the head of each buffer. Thereby, the alignment output unit 32 can sort the records in order from the record with the smallest value and merge a plurality of sequences.

レコード列選択部26は、入力部22が入力記憶部30から取得するレコードブロックを、予測に基づく手法により選択する。以下に、予測に基づく手法について説明する。   The record string selection unit 26 selects a record block acquired by the input unit 22 from the input storage unit 30 by a method based on prediction. Below, the method based on prediction is demonstrated.

レコード列選択部26に対しては、入力部22が記憶部24へレコードブロックを入力する際に、入力部22から、それぞれのレコードブロックに含まれる予測用レコードが出力され、レコード列選択部26は、最後に出力された予測用レコードをそれぞれの連ごとに1つずつ、合計でP個保持している。レコード列選択部26は、P個ある予測用レコードの中から、ソート順序が最も前方になるレコード、つまり、値が最も小さいレコードを抽出する。レコード列選択部26は、抽出したレコードを供給した連を、次にレコードを入力する連として選択する。このように選択された連は、その時点で後続のレコード供給を最も早く必要とする連を示している。レコード列選択部26は、入力部22及び入力記憶部30の少なくとも一方に対して、選択した連を通知する。   When the input unit 22 inputs a record block to the storage unit 24 to the record sequence selection unit 26, a prediction record included in each record block is output from the input unit 22, and the record sequence selection unit 26 Holds a total of P prediction records output last, one for each series. The record string selection unit 26 extracts a record in which the sort order is the front, that is, a record having the smallest value, from among the P prediction records. The record string selection unit 26 selects a series supplied with the extracted record as a series for inputting the next record. The ream selected in this way indicates the ream that needs the earliest record supply at that time. The record string selection unit 26 notifies the selected ream to at least one of the input unit 22 and the input storage unit 30.

入力記憶部30は、レコード列選択部26によって選択された連が通知されると、選択された連に含まれるレコードブロックを入力部22へ出力する。もしくは、入力部22は、レコード列選択部26によって選択された連が通知されると、入力記憶部30に対して選択された連に含まれるレコードブロックの出力を要求してもよい。   When the input selected by the record string selection unit 26 is notified, the input storage unit 30 outputs the record blocks included in the selected sequence to the input unit 22. Or the input part 22 may request | require the output of the record block contained in the selected continuous with respect to the input memory | storage part 30, if the series selected by the record sequence selection part 26 is notified.

入力部22は、入力記憶部30からレコードブロックを取得すると、予測用レコードをレコード列選択部26へ出力し、レコード列選択部26は、取得した予測用レコードと、保持している他の連の予測用レコードとを用いて、値が最も小さいレコードを抽出する。   When the input unit 22 acquires the record block from the input storage unit 30, the input unit 22 outputs the prediction record to the record sequence selection unit 26, and the record sequence selection unit 26 and the other continuous records that it holds. The record with the smallest value is extracted using the prediction record.

以上説明したように、入力部22が入力記憶部30から取得するレコードブロックは、予測に基づく手法により選択される。   As described above, the record block acquired by the input unit 22 from the input storage unit 30 is selected by a method based on prediction.

次に、マージ処理装置10内の処理動作のタイミングについて説明する。ここで、マージ処理装置10内の、入力部22と、記憶部24と、整列出力部32と、入力連選択部26とをまとめてマージ処理ユニットとする。マージ処理が開始されると各部において必要な初期化が行われる。その後、配置変換部20は、外部の入力供給部50からのレコードデータ入力を待機する。配置変換部20は、レコードデータの入力開始とともにレコードデータの並び替えと、入力記憶部に対するレコードデータの格納を開始する。配置変換部20は、全てのレコードデータの入力を終えるまで処理を続ける。その途中、入力記憶部30に十分な量のレコードデータが蓄積されると、マージ処理ユニットは、マージ処理を開始する。マージ処理ユニットは、全てのレコードを外部の出力記憶部60に出力し終えるまで処理を続ける。配置変換部20とマージ処理ユニットの動作タイミングとは一定の時間差を保ちながら同期して動作しても構わないし、独立したタイミングにより動作しても構わない。ただし、処理すべきレコードデータが未入力である場合、マージ処理ユニットは、処理を行わず待機する。あるいは、入力記憶部30が、全てのレコードデータを記憶可能な容量を持っている場合、マージ処理ユニットは、配置変換部20から入力されるレコードデータの蓄積が全て完了してから、処理を開始しても良い。   Next, the timing of the processing operation in the merge processing apparatus 10 will be described. Here, the input unit 22, the storage unit 24, the alignment output unit 32, and the input continuous selection unit 26 in the merge processing apparatus 10 are collectively referred to as a merge processing unit. When the merge process is started, necessary initialization is performed in each unit. Thereafter, the arrangement conversion unit 20 waits for record data input from the external input supply unit 50. The layout conversion unit 20 starts to rearrange the record data and start storing the record data in the input storage unit when the input of the record data is started. The arrangement conversion unit 20 continues processing until input of all record data is completed. In the middle of the process, when a sufficient amount of record data is accumulated in the input storage unit 30, the merge processing unit starts the merge process. The merge processing unit continues the process until all records are output to the external output storage unit 60. The operation timing of the arrangement conversion unit 20 and the merge processing unit may operate synchronously while maintaining a certain time difference, or may operate at independent timing. However, if the record data to be processed has not been input, the merge processing unit waits without performing processing. Alternatively, when the input storage unit 30 has a capacity capable of storing all the record data, the merge processing unit starts the processing after completing the accumulation of the record data input from the arrangement conversion unit 20 You may do it.

続いて、図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 arrangement conversion unit 20 in accordance with the sort order, as shown in FIG. The arrangement changing unit 20 divides these records into record blocks having eight records such as a1 to a8, a9 to a16, and a17 to a24. Further, the arrangement converting unit 20 positions the records in the record block by placing the last record (prediction record) of each record block at the beginning of the record block as shown in FIG. Rearrange as you do. The arrangement conversion unit 20 stores the series whose record arrangement has been changed in this way in the input storage unit 30 in units of record blocks.

図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 input storage unit 30 to the input unit 22 in units of record blocks, and the records in the record block are supplied in this rearranged order.

また、入力部22は、配置変換部20により並び替えられたレコードブロック内のレコード配置を、元の配置順に戻しながらレコードを記憶部24へ入力する。これにより、ソートされた順序と異なる配置によりレコードが入力されても、記憶部24内ではソートされた順序によりレコードが格納される。そのため、整列出力部32は、それぞれのバッファの先頭レコードを比較して抽出することにより、マージ処理を実行することができる。   The input unit 22 inputs the records to the storage unit 24 while returning the record arrangements in the record blocks rearranged by the arrangement conversion unit 20 to the original arrangement order. As a result, even if records are input in an arrangement different from the sorted order, the records are stored in the storage unit 24 in the sorted order. Therefore, the alignment output unit 32 can execute the merge process by comparing and extracting the top records of the respective buffers.

続いて、図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 string selection unit 26 initializes variables to be held (S1). For example, the record string selection unit 26 initializes the serial number of the prediction record having the minimum value and the minimum value of the prediction record.

次に、記憶部24は、連iのバッファに空きがあるか否かを判定する(S2)。連iのバッファに空きがあると判定された場合、レコード列選択部26は、連iの予測用レコードが入力済みの予測用レコードの中で最小か否かを判定する(S3)。レコード列選択部26は、連iの予測用レコードが最小であると判定した場合、連番号i及び予測用レコードの最小値を示す変数を更新する(S4)。次に、連i+1についても、同様にステップS2乃至4の処理を繰り返し実行する(S5)。   Next, the storage unit 24 determines whether there is a vacancy in the buffer of the sequence i (S2). When it is determined that there is a vacancy in the buffer of the sequence i, the record string selection unit 26 determines whether the prediction record of the sequence i is the smallest among the input prediction records (S3). When the record string selection unit 26 determines that the prediction record for the sequence i is the minimum, the record sequence selection unit 26 updates the variable indicating the sequence number i and the minimum value of the prediction record (S4). Next, the processing of steps S2 to S4 is similarly repeated for the sequence i + 1 (S5).

ステップS2において、記憶部24が、連iのバッファに空きがないと判定した場合、又はステップS3において、レコード列選択部26が、連iの予測用レコードが最小ではないと判定した場合、ステップS5の処理へ移行する。次に、レコード列選択部26は、全ての連について、ステップS2以降の処理を実行したか否かを判定する(S6)。レコード列選択部26によって、全ての連がステップS2以降の処理を実行していないと判定された場合、ステップS2の処理へ移行する。レコード列選択部26によって、全ての連がステップS2以降の処理を実行したと判定された場合、記憶部24が有するバッファに空きのあるバッファがあったか否かを判定する(S8)。レコード列選択部26は、空きのあるバッファがあったと判定した場合、入力部22及び入力記憶部30の少なくともどちらか一方に、更新された連番号を通知し、レコードの入力要求を行う(S9)。レコード列選択部26は、空きのあるバッファがないと判定した場合、処理を終了する。   If the storage unit 24 determines in step S2 that there is no space in the buffer of the sequence i, or if the record sequence selection unit 26 determines in step S3 that the record for prediction of the sequence i is not the minimum, The process proceeds to S5. Next, the record string selection unit 26 determines whether or not the processes after step S2 have been executed for all the series (S6). When it is determined by the record string selection unit 26 that all the reams have not executed the processes after step S2, the process proceeds to step S2. When it is determined by the record string selection unit 26 that all the sequences have executed the processing from step S2 onward, it is determined whether or not there is an empty buffer in the storage unit 24 (S8). When it is determined that there is an empty buffer, the record string selection unit 26 notifies the updated serial number to at least one of the input unit 22 and the input storage unit 30 and makes a record input request (S9). ). If the record string selection unit 26 determines that there is no free buffer, the process ends.

以上説明したように、本発明の実施の形態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 input storage unit 30 to the input unit 22 can be continuously executed. The effect in Embodiment 1 of this invention is demonstrated using FIG. The input unit 22 acquires records whose order has been rearranged by the arrangement conversion unit 20. For example, when the prediction conversion record is arranged by the arrangement conversion unit 20 so as to be positioned at the head of the record block, the input unit 22 selects the prediction record as the record string selection unit before acquiring all the records of the record block. 26 can be output. Thereby, before the input part 22 acquires all the records, the record sequence selection part 26 selects the series to input next, and makes a record input request to at least one of the input part 22 and the input storage part 30. Thereby, there is a time margin for concealing the delay time from when the record input request is made until the input unit 22 actually acquires the record from the input storage unit 30. Therefore, the input storage unit 30 can continuously execute record input processing on the input unit 22.

(実施の形態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 merge processing device 10 in FIG. 6 differs from the merge processing device in FIG. 2 in that the arrangement conversion unit 20 is not provided. The other configurations in FIG. 6 are the same as those in FIG. 2 and will be described using the same reference numerals as those in FIG.

入力記憶部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 input storage unit 30 has a capacity sufficient to store all the merged records from the input supply unit 50. Therefore, when the input storage unit 30 receives all record data from the input supply unit 50, the merge processing by the merge processing unit is started. The input storage unit 30 stores records while maintaining the sort order of records input from the input supply unit 50. Here, a1, a2,..., And the order of input from the records with the smallest values are assumed to be ascending. The reverse order is the descending order. The input storage unit 30 separates the record data input from the input supply unit 50 into record blocks including at least one record. A record block having records a1 to a8 is referred to as a record block 1, a record block having records a9 to a16 is referred to as a record block 2, and a record block having records a41 to a48 is referred to as a record block 6. Record blocks 3 to 5 are set in a17 to a41. FIG. 7A shows an arrangement example in the case where the number of records in the record block is 8 and a series having 48 records is stored in the input storage unit 30.

入力部22は、本発明の実施の形態1と異なり、入力記憶部30から、レコードブロック6、レコードブロック5、・・・レコードブロック1の順(降順)にレコードブロックを取得する。ただし、入力部22は、レコードブロック内のレコードを昇順に取得する。さらに、入力部22は、レコードブロック内のレコードを全て降順に並べ替えながら、取得したレコードを記憶部24へ格納する。図7(b)は、入力部22が入力記憶部30から取得するレコードの順序と、記憶部24へ格納するレコードの順序を示している。   Unlike the first embodiment of the present invention, the input unit 22 acquires record blocks from the input storage unit 30 in the order of record block 6, record block 5,... Record block 1 (descending order). However, the input unit 22 acquires the records in the record block in ascending order. Further, the input unit 22 stores the acquired records in the storage unit 24 while rearranging all the records in the record block in descending order. FIG. 7B shows the order of records acquired by the input unit 22 from the input storage unit 30 and the order of records stored in the storage unit 24.

ここで、レコード列選択部26が予測のために用いる予測用レコードは、ソート順序を降順とした時のレコードブロックの最後方レコード、すなわちソート順序を昇順とした時のレコードブロックの最前方レコードとする。入力部22は、レコードブロック内のレコードを昇順に取得する。そのため、予測用レコードは、レコードブロック内のレコードの中で最初に入力部22に取得される。入力部22は、予測用レコードを取得すると、レコードブロック内のすべてのレコードが入力される前に、取得した予測用レコードをレコード列選択部26へ出力する。これにより、レコード列選択部26は、入力部22がレコードブロック内の全てのレコードを取得する前に、次に取得するレコードブロックの連を決定する処理を開始する。なお、本発明の実施の形態2においては、レコード列選択部26は、予測用レコードの中で最大の値が設定されている予測用レコードの連を選択する。   Here, the prediction record used by the record sequence selection unit 26 for prediction is the last record of the record block when the sort order is descending, that is, the forefront record of the record block when the sort order is ascending To do. The input unit 22 acquires the records in the record block in ascending order. Therefore, the prediction record is first acquired by the input unit 22 among the records in the record block. When the input unit 22 acquires the prediction record, the input unit 22 outputs the acquired prediction record to the record string selection unit 26 before all the records in the record block are input. Thereby, before the input part 22 acquires all the records in a record block, the record sequence selection part 26 starts the process which determines the series of the record block acquired next. In Embodiment 2 of the present invention, the record string selection unit 26 selects a series of prediction records for which the maximum value is set from among the prediction records.

以上説明したように、本発明の実施の形態2にかかるマージ処理装置においては、本発明の第1の実施の形態にかかるマージ処理装置と同様のタイミングにより、入力部22が入力記憶部30からレコードを取得することができる。よって、マージ処理ユニットの可動効率を高めるとともに、マージ処理の処理速度を高めることができる。   As described above, in the merge processing device according to the second exemplary embodiment of the present invention, the input unit 22 moves from the input storage unit 30 at the same timing as the merge processing device according to the first exemplary embodiment of the present invention. Records can be obtained. Therefore, it is possible to increase the moving efficiency of the merge processing unit and increase the processing speed of the merge processing.

(実施の形態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 input unit 22, the storage unit 24, the record string selection unit 26, and the alignment output unit 32 are assumed to be an ascending order merge processing unit, and the ascending order merge processing unit is the same as the merge processing unit according to the first embodiment of the present invention. To work. Further, the input unit 22_1, the storage unit 24_1, the record string selection unit 26_1, and the alignment output unit 32_1 are set as a descending order merge processing unit, and the descending order merge processing unit is a merge processing unit according to the second embodiment of the present invention. The same operation is performed.

入力記憶部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 input storage unit 30 has a capacity enough to store all the merged record data. Therefore, merge processing by the ascending order merging processing unit and descending order merging processing unit is started after all record data is input from the arrangement conversion unit 20 to the input storage unit 30. The record input from the input supply unit 50 is input to the arrangement conversion unit 20 as in the merge processing apparatus 10 according to the first embodiment of the present invention. The layout conversion unit 20 starts with the records input from the input supply unit 50 in the sorted order as shown in FIG. 9A and the last record of each record block as shown in FIG. 9B. Change the order of the records so that The arrangement conversion unit 20 inputs a plurality of rearranged records to the input storage unit 30.

入力記憶部30は、入力されたレコードの総数もしくはレコードデータが占める記憶容量をマージ処理装置内の制御部に通知し、制御部はこれを元に出力記憶部60にマージされたレコード列を書き込む領域を確保する。確保が終わると、昇順マージ処理ユニットと降順マージ処理ユニットにマージ処理を開始するよう指令を出す。   The input storage unit 30 notifies the control unit in the merge processing apparatus of the total number of input records or the storage capacity occupied by the record data, and the control unit writes the merged record sequence in the output storage unit 60 based on this. Reserve space. When the reservation is completed, a command is issued to start the merge process to the ascending order merge processing unit and the descending order merge processing unit.

入力部22は、それぞれの連について、レコードブロック1、レコードブロック2、・・・レコードブロック6の順番にレコードを取得する。以降の処理は、図10(a)に示されるように、本発明の実施の形態1にかかるマージ処理装置と同様であり、入力部22は、レコードを、並び替えられる前の順番に復元して、記憶部24へ入力する。これらのレコードは昇順に並び替えられた上で出力記憶部60に順次出力される。出力されたレコードは、出力記憶部60に確保された領域の先頭から書き込まれる。   The input unit 22 acquires records in the order of record block 1, record block 2,. The subsequent processing is the same as that of the merge processing apparatus according to the first embodiment of the present invention as shown in FIG. 10A, and the input unit 22 restores the records in the order before they are rearranged. To the storage unit 24. These records are rearranged in ascending order and then sequentially output to the output storage unit 60. The output record is written from the beginning of the area secured in the output storage unit 60.

入力部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 record block 5,. Further, in the descending order merge processing unit, the prediction records are a1, a9,..., A41 as in the second embodiment of the present invention. In Embodiment 3 of the present invention, since the order of records is changed in the arrangement conversion unit 20, the prediction record is arranged second in each record block. When acquiring the prediction record, the input unit 22_1 outputs the prediction record to the record string selection unit 26_1 before acquiring all the records in the record block. In the subsequent processing, as in the merge processing apparatus according to the second embodiment of the present invention, the input unit 22 sorts the records in descending order and inputs them to the storage unit 24_1. These records are rearranged in descending order and then sequentially output to the output storage unit 60. The output records are written in reverse order from the rear of the area secured in the output storage unit.

ここで、昇順マージ処理ユニットは、入力された連の前方に位置するレコードブロックから順にマージ処理を行う。これに対して、降順マージ処理ユニットは、入力された連の後方に位置するレコードブロックから順にマージ処理を行う。これより、入力された連のレコードは、昇順マージ処理ユニットもしくは降順マージ処理ユニットのどちらか一方によりマージ処理が実行されるように制御されてもよい。これは例えば、昇順マージ処理ユニットが出力したレコードの個数と、降順マージユニットが出力したレコードの個数をマージ処理装置内の制御部が監視し、両者の個数の和が入力されたレコードの総数に到達した時点で、両ユニットの動作を停止させることで行われてもよい。これにより、出力記憶部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 output storage unit 60.

以上説明したように、本発明の実施の形態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 Embodiments 1 and 2 of the present invention, high-speed merge processing can be realized.

(実施の形態4)
続いて、本発明の実施の形態4にかかる配置変換部20のレコード入れ替えパタンについて説明する。本発明の実施の形態4にかかるマージ処理装置の構成は、図8の構成と同様である。図11を用いて、本発明の実施の形態4にかかる配置変換部20のレコード入れ替えパタンについて説明する。
(Embodiment 4)
Subsequently, a record replacement pattern of the arrangement conversion unit 20 according to the fourth embodiment of the present invention will be described. The configuration of the merge processing apparatus according to the fourth embodiment of the present invention is the same as the configuration of FIG. The record replacement pattern of the arrangement conversion unit 20 according to the fourth embodiment of the present invention will be described with reference to FIG.

図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 series 1 input to the arrangement conversion unit 20. On the other hand, FIG. 11B shows the order of the records in the series 1 after the records are replaced by the arrangement conversion unit 20. The record block 1 will be described as an example. The order of records in the record block before being rearranged by the arrangement conversion unit 20 is arranged in the order of a1 to a8. The order of the records in the record block 1 after being rearranged by the arrangement conversion unit 20 is rearranged in the order of a8, a1, a7, a2, a6, a3, a5, a4. Records are rearranged as follows. First, let a1 to a4 in the record block 1 before being rearranged be the first half, and let a5 to a8 be the second half. Here, the records in the latter half are rearranged in descending order. Next, the first half of the records arranged in ascending order and the second half of the records arranged in descending order are alternately arranged. As a result, the above-described record order is obtained.

図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 input unit 22 to the storage unit 24. As in FIG. 10A, the records are rearranged in ascending order. Is input to the storage unit 24. FIG. 12B shows record rearrangement performed when records are input from the input unit 22_1 to the storage unit 24_1. As in FIG. 10B, the records are arranged in descending order. It is changed and inputted to the storage unit 24.

上述したように、図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は、それぞれP、P、・・・、P個のレコード列をマージする機能を備える。ここで、P=P×P×・・・×Pであるとし、それぞれのマージ処理部は、レコード列を記憶する十分な入力記憶部を備えるとする。第1のマージ処理部71は、外部からソート済みレコード列がP個入力されるとマージ処理を開始し、第2のマージ処理部72の入力記憶部にマージ後のレコード列を出力し、これをP÷P=P×・・・×P回繰り返す。第2のマージ処理部72は、第1のマージ処理部71からレコード列がP個入力されるとマージ処理を開始し、第3のマージ処理部の入力記憶部にマージ後のレコード列を出力し、これをP×・・・×P回繰り返す。このようにして、このマージ処理装置は、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 merge processing unit 71, a second merge processing unit 72, ..., merge processing unit 73 of the N, respectively P 1 , P 2 ,..., PN are provided with a function of merging record strings. Here, it is assumed that P = P 1 × P 2 ×... × PN , and that each merge processing unit includes a sufficient input storage unit for storing a record string. The first merge processing unit 71 starts merge processing when P 1 sorted record sequences are input from the outside, and outputs the merged record sequence to the input storage unit of the second merge processing unit 72, This is repeated P ÷ P 1 = P 2 ×... × P N times. The second merge processing unit 72, a record sequence from the first merge processing unit 71 is input two P starts merging process, the records columns merged into the input storage unit of the third merge processing unit Output, and repeat this for P 3 ×... × P N times. In this way, this merge processing apparatus merges P record strings.

このマージ処理装置において、それぞれのマージ処理部は、本発明の実施の形態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 merge processing unit 71 to the second merge processing unit 72 is descending order. Similarly, the sort order of the record sequence output from the second merge processing unit 72 to the third merge processing unit is ascending order, and the Nth merge processing unit 73 inputs the ascending order record sequence when N is an odd number. A descending record string is output, and when N is an even number, a descending record string is input and an ascending record string is output.

マージ処理部の内部の動作は、実施の形態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 arrangement conversion units 74 and 75 between each merge processing unit, and N pieces The internal configuration and operation of the merge processing unit are different. Here, the first merge processing unit 71 is a general merge processing device, and the second to N-th merge processing units are combined with the arrangement conversion unit in front of the first merge processing unit 71 according to the first or third embodiment of the present invention. The same configuration and operation as in FIG. For example, FIG. 15 shows a configuration when N = 2 and the second merge processing unit 72 has the same configuration as that of the first embodiment of the present invention. In this merge processing apparatus, the sort order of the input record string and the sort order of the output record string are the same in the arrangement conversion unit and all the merge processing units.

ここで、第1のマージ処理部71と第2のマージ処理部72の間の配置変換部74は、第1のマージ処理部71から順に出力されるレコードを、レコードブロックに区切りながら配置変換を同時に行い、変換された配置のレコードブロックデータを第2のマージ処理部72に書き込む。この配置変換処理は、マージ処理部の出力と同時に行われるため、配置変換処理を行うことによるマージ処理時間の増加は少ない。同様に、第Nのマージ処理部73と第(n+1)のマージ処理部の間の配置変換部は、第Nのマージ処理部73のレコード出力と同時に動作するため、配置変換処理を行うことによるマージ処理時間の増加は少ない。よって、本発明の実施の形態のマージ処理装置は、レコード入力の効率を高め、高速な動作を可能としている。   Here, the arrangement conversion unit 74 between the first merge processing unit 71 and the second merge processing unit 72 performs arrangement conversion while separating records sequentially output from the first merge processing unit 71 into record blocks. At the same time, the converted record block data is written to the second merge processing unit 72. Since this arrangement conversion process is performed simultaneously with the output of the merge processing unit, the increase in the merge processing time due to the arrangement conversion process is small. Similarly, the arrangement conversion unit between the Nth merge processing unit 73 and the (n + 1) th merge processing unit operates simultaneously with the record output of the Nth merge processing unit 73, and therefore performs the arrangement conversion process. There is little increase in merge processing time. Therefore, the merge processing apparatus according to the embodiment of the present invention increases the efficiency of record input and enables high-speed operation.

(実施の形態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 sort processing unit 81 is added to the input of the merge processing apparatus according to the fifth embodiment of the present invention. The sort processing unit 81 inputs a plurality of records to an internal storage unit, divides them into groups of P records, and performs sorting within the group. The sorted record string is output to the first merge processing unit 71. The sort order in the sort processing unit 81 is the reverse of the sort order in the first merge processing unit. The sort processing apparatus configured as described above operates at a high speed similarly to the merge processing apparatus of the fifth embodiment.

(実施の形態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 merge processing unit 71 in the merge processing apparatus according to the sixth embodiment of the present invention is replaced with a sort processing unit. The sort processing unit 81 inputs a plurality of records to an internal storage unit, divides them into groups of P records, and performs sorting within the group. The sorted record string is output to the first merge processing unit 71. The sort processing apparatus configured as described above operates at a high speed similarly to the merge processing apparatus according to the sixth embodiment.

なお、上述した実施の形態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 input storage unit 30 and the alignment output unit 32 are composed of SDRAM and its control circuit, and the storage unit 24 is composed of SRAM and its control circuit. The SDRAM can perform high-speed data reading by using the burst transfer mode, and the number of records in the record block is set large so that the reading efficiency from the SDRAM is high. The address where the record block is arranged is aligned with an appropriate multiple of addresses. There is an access delay from the issuance of a command for reading data to the SDRAM until the data is transferred, which causes a reduction in the efficiency of record input processing in the merge processing apparatus. However, since the merge processing device 10 of the present invention rearranges the arrangement when storing the record blocks in the SDRAM, the next read request processing is completed before all the records in the record block are transferred to the input unit 20. Can be performed on SDRAM. Therefore, the access delay until data is transferred from the SDRAM can be hidden. Thus, when the merge processing device is configured by an integrated circuit, the merge processing can be executed faster than the merge device not using the present invention.

続いて、第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 input storage unit 30 and the alignment output unit 32, and a main storage memory inside the computer is used for the storage unit 24. This computer can operate a plurality of threads in parallel, and this program activates a plurality of threads in the arrangement changing unit 20, the input unit 22, the record string selection unit 26, and the alignment output unit 32, and the CPU Describes a command for performing the merge processing according to the present invention. When the record data stored in the hard disk device is read, there is a delay time from when the read command is issued until the data is read. This causes a reduction in the efficiency of the record input process in the merge processing device. However, the merge processing apparatus of the present invention rearranges the arrangement when storing the record blocks on the hard disk. Therefore, the next read request process can be performed on the hard disk before all the records in the record block have been transferred to the input unit 22. Therefore, the access delay until data is read from the hard disk device can be hidden. Thereby, when the merge processing device is configured by a computer device, the merge processing can be executed at a higher speed than the merge processing device not using the present invention.

上述の実施の形態では、本発明をハードウェアの構成として説明したが、本発明は、これに限定されるものではない。本発明は、任意の処理を、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 supplementary note 1, wherein the arrangement conversion unit changes the order of the records so that the prediction record is positioned at a head of the record block.

(付記3)前記入力部は、前記レコードの順序が入れ替えられたレコードブロックの順序を元に戻して、前記順序が元に戻されたレコードブロックを前記記憶部へ入力する、付記1又は2に記載のマージ処理装置。   (Supplementary note 3) In the supplementary note 1 or 2, the input unit restores the order of the record blocks in which the order of the records has been changed, and inputs the record block in which the order has been restored to the storage unit. The merge processing device described.

(付記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 supplementary note 5, wherein the arrangement conversion unit alternately arranges 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.

(付記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 SYMBOLS 10 Merge processing apparatus 20 Arrangement conversion part 22, 22_1 Input part 24, 24_1 Storage part 26, 26_1 Record sequence selection part 30 Input storage part 32, 32_1 Alignment output part 41 1st buffer 42 2nd buffer 43 3rd P buffer 50 Input supply unit 60 Output storage unit

Claims (10)

ソートされた複数のレコードから構成されるレコード列が複数入力され、前記入力されたそれぞれのレコード列を、少なくとも1のレコードを含むレコードブロックに分離し、当該レコードブロックのそれぞれに含まれる複数のレコードの最後方に配置されている予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替える配置変換部と、
前記配置変換部から複数のレコードブロックを取得し、記憶部へ入力する入力部と、
前記複数のレコードブロックのそれぞれに含まれた前記予測用レコードの大小関係に基づいて、前記入力部が前記配置変換部から取得するレコード列を選択するレコード列選択部と、を備え、
前記入力部は、
前記レコードブロックに含まれるレコードのそれぞれを前記順序が入れ替えられたレコードの順に取得し、前記レコードブロックに含まれる全てのレコードを取得する前に、取得済の予測用レコードを前記レコード列選択部へ出力し、
前記レコード列選択部は、
前記入力部から出力された予測用レコードの入力に応じて、次に前記入力部が前記配置変換部から取得するレコード列を選択する処理を開始するマージ処理装置。
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.
ソートされた複数のレコードから構成されるレコード列が複数入力され、当該前記入力されたそれぞれのレコード列を少なくとも1のレコードを含む複数のレコードブロックに分離する分離部と、
前記分離部に後から入力された前記レコードブロックから順に前記レコードブロックを取得し、記憶部へ入力するとともに、前記レコードブロック内で最も前方に位置するブロックを予測用レコードとして取り出す入力部と、
前記複数のレコードブロックのそれぞれに含まれた前記予測用レコードの大小関係に基づいて、前記入力部が前記配置変換部から取得するレコードブロックを選択するレコード列選択部と、
前記レコード列のソート順序と逆のソート順序に従い記憶部からレコードを順に取り出して出力する整列出力部とを備え、
前記入力部は、
前記レコードブロックのレコードを全て取得する前に、前記予測用レコードを前記レコード列選択部へ出力し、
前記レコード列選択部は、
前記入力部から出力された予測用レコードに基づいて、次に前記入力部が前記配置変換部から取得するレコード列を選択する処理を開始するマージ処理装置。
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の入力部と、
前記レコード列のソート順序と同じソート順序に従い前記第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.
複数のレコードから構成されるレコード列を複数格納する記憶部と、前記記憶部に格納されたレコードを取り出してソート規則に従う順序に並び変えてレコードを出力する整列出力部と、複数のレコード列が少なくとも1のレコードを含むレコードブロックに分離され、当該レコードブロックのそれぞれにおいて外部からの入力時に最後方に配置されている予測用レコードに基づいて、次に入力するレコード列を選択するレコード列選択部とを含むマージ処理ユニットに、前記レコード列を入力する処理をコンピュータに実行させる制御プログラムであって、
外部から前記レコードブロックを複数取得するするステップと、
前記取得された複数のレコードブロックの最後方に配置されている予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替えるステップと、
前記順序が入れ替えられたレコードの順に前記レコードを前記マージ処理ユニットに入力するステップと、をコンピュータに実行させる制御プログラム。
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.
複数のレコードから構成されるレコード列を複数格納する記憶部と、前記記憶部に格納されたレコードを取り出してソート規則に従う順序に並び変えてレコードを出力する整列出力部と、複数のレコード列が少なくとも1のレコードを含むレコードブロックに分離され、当該レコードブロックのそれぞれにおいて外部からの入力時に最後方に配置されている予測用レコードに基づいて、次に入力するレコード列を選択するレコード列選択部とを含むマージ処理ユニットに、前記レコード列を入力する処理をコンピュータに実行させる制御プログラムであって、
外部から前記レコードブロックを複数取得するするステップと、
前記取得した複数のレコードブロックに含まれるレコードをソートするステップと、
前記ソートされた複数のレコードブロックの最後方に配置されている予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替えるステップと、
前記順序が入れ替えられたレコードの順に前記レコードを前記マージ処理ユニットに入力するステップと、をコンピュータに実行させる制御プログラム。
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.
ソートされた複数のレコードから構成されるレコード列が複数入力され、前記入力されたそれぞれのレコード列を、少なくとも1のレコードを含むレコードブロックに分離するステップと、
前記複数のレコードブロックのそれぞれに含まれる複数のレコードの最後方に配置されている予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替えるステップと、
前記レコードブロックに含まれるレコードのそれぞれを前記順序が入れ替えられたレコードの順に取得するとともに、取得済みの予測用レコードを出力するステップと、
前記出力された予測用レコードの入力に応じて、次に入力されるレコード列を選択する処理を開始するステップと、を備えるレコードマージ方法。
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.
複数のレコードから構成されるレコード列が複数入力され、前記入力されたそれぞれのレコード列を、少なくとも1のレコードを含むレコードブロックに分離するステップと、
前記レコードブロックに含まれるレコードをソートするステップと、
前記複数のレコードブロックのそれぞれに含まれる複数のレコードの最後方に配置されている予測用レコードを、現在配置されている位置よりも前方に位置するようにレコードの順序を入れ替えるステップと、
前記レコードブロックに含まれるレコードのそれぞれを前記順序が入れ替えられたレコードの順に取得するとともに、取得済みの予測用レコードを出力するステップと、
前記出力された予測用レコードの入力に応じて、次に入力されるレコード列を選択する処理を開始するステップと、を備えるレコードマージ方法。
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.
JP2010104008A 2010-04-28 2010-04-28 Merge processor, control program and record merge method Pending JP2011233012A (en)

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)

* Cited by examiner, † Cited by third party
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

Cited By (1)

* Cited by examiner, † Cited by third party
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