JP2013003695A - Distributed database retrieval device, distributed database retrieval method and program - Google Patents

Distributed database retrieval device, distributed database retrieval method and program Download PDF

Info

Publication number
JP2013003695A
JP2013003695A JP2011131854A JP2011131854A JP2013003695A JP 2013003695 A JP2013003695 A JP 2013003695A JP 2011131854 A JP2011131854 A JP 2011131854A JP 2011131854 A JP2011131854 A JP 2011131854A JP 2013003695 A JP2013003695 A JP 2013003695A
Authority
JP
Japan
Prior art keywords
plan
server
query
distributed
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2011131854A
Other languages
Japanese (ja)
Other versions
JP5318155B2 (en
Inventor
Yosuke Kuroda
洋介 黒田
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.)
Toshiba Corp
Toshiba Digital Solutions Corp
Original Assignee
Toshiba Corp
Toshiba Solutions 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 Toshiba Corp, Toshiba Solutions Corp filed Critical Toshiba Corp
Priority to JP2011131854A priority Critical patent/JP5318155B2/en
Priority to CN201210048380.7A priority patent/CN102831138B/en
Publication of JP2013003695A publication Critical patent/JP2013003695A/en
Application granted granted Critical
Publication of JP5318155B2 publication Critical patent/JP5318155B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To provide a distributed database retrieval device which realizes an effective search without complicating a mechanism of a master server side.SOLUTION: A distributed database retrieval device is composed by connecting plural slave servers each having a data base to a master server searching the data bases based on an input query. The slave server comprises: a second transmitter-receiver to perform data transmission/reception with the master server; a local plan candidate generation part to generate a local plan candidate based on a received dispersion plan; and a local plan selection part to determine a local plan that computing cost is the lowest based on the generated local plan candidate.

Description

本発明の実施形態は、分散データベース検索装置、分散データベース検索方法、及びプログラムに関する。   Embodiments described herein relate generally to a distributed database search device, a distributed database search method, and a program.

表形式やXML形式等の大量のデータを扱うために複数のサーバで構成された分散データベース検索装置が存在する。分散データベース検索装置は通常、ユーザとのやり取りを行うマスターサーバと、実際にデータを管理するスレーブサーバとから構成されている。   There is a distributed database search device composed of a plurality of servers in order to handle a large amount of data such as a table format and an XML format. A distributed database search apparatus is generally composed of a master server that communicates with users and a slave server that actually manages data.

スレーブサーバは全て同一のアーキテクチャのデータベース検索装置から構成されていることもあれば、異なるアーキテクチャのデータベース検索装置から構成されていることもある。   All of the slave servers may be composed of database retrieval apparatuses having the same architecture, or may be composed of database retrieval apparatuses having different architectures.

一般に、分散データベース検索装置に対して検索式(以下、クエリという)が入力された場合、クエリはマスターサーバが受け取る。マスターサーバはクエリを解析して、各スレーブサーバがサーバ内部で実行する部分と、サーバ間で演算する必要がある部分に分割する。各スレーブサーバ内で実行する部分は各スレーブサーバが最適なローカルプランを生成する。サーバ間の演算部分はマスターサーバが最適な分散プランを生成する。なお、ローカルプランとはスレーブサーバがスレーブサーバの有するデータを検索するためのプランであり、分散プランとは対象の分散データベースの有するデータ全体を検索するためのプランである。   Generally, when a search expression (hereinafter referred to as a query) is input to the distributed database search device, the query is received by the master server. The master server analyzes the query and divides it into a part that each slave server executes inside the server and a part that needs to be operated between the servers. Each slave server generates an optimal local plan for the part executed in each slave server. The master server generates an optimal distributed plan for the calculation part between servers. The local plan is a plan for the slave server to search for data held by the slave server, and the distributed plan is a plan for searching the entire data of the target distributed database.

分散プランを生成する際は、JOIN等のサーバ間のデータに対する結合演算処理、SORT等の複数のサーバに対する集合演算処理、分割した部分クエリの結合演算処理等の演算処理の順序と実行するサーバを検索応答時間が最短になるように決定する。さらに演算を実行するサーバへのデータ転送方法やフォーマット等を決定する。   When generating a distributed plan, the order of operation processing such as join operation processing for data between servers such as JOIN, set operation processing for a plurality of servers such as SORT, and join operation processing of divided partial queries is executed. The search response time is determined to be the shortest. Further, a data transfer method, a format, and the like to the server that executes the calculation are determined.

分散データベースでは、検索性能を向上するために分散プランの最適化を強化することで、それらデータベース間でのデータ受け渡し処理におけるデータの転送コストや、サーバ間のデータの演算コストを低減したいという要望がある。   In distributed databases, there is a demand to reduce the data transfer cost in data transfer processing between these databases and the data calculation cost between servers by strengthening the optimization of the distributed plan to improve search performance. is there.

従来、分散プランの最適化は全てマスターサーバによって実現されてきた。しかしながら、マスターサーバが分散プランの全てを決定することには多くの問題がある。   Conventionally, all optimization of distributed plans has been realized by a master server. However, there are many problems for the master server to determine all of the distributed plans.

まず、分散プランの検討範囲は上記で挙げたようにクエリの分割範囲、サーバ間演算の順序と実行場所の決定、分割したクエリの結合方法等と非常に広いため、多くの候補プランが発生してしまい、その中から最適なプランを検索するためには多くの情報を必要とする。このためマスターサーバは各スレーブサーバ側からの索引や統計情報等を密に取得して維持・管理する必要がある。したがってマスターサーバの仕組みは複雑であり、管理コストが多くかかる。   First of all, since the scope of consideration of distributed plans is very wide, such as the query division range, determination of the order and execution location of operations between servers, and the method of joining the divided queries as mentioned above, many candidate plans are generated. Therefore, it takes a lot of information to search for an optimal plan. For this reason, the master server needs to closely acquire, maintain, and manage indexes and statistical information from each slave server. Therefore, the structure of the master server is complicated and requires a high management cost.

また、マスターサーバが欲しい情報を全て取得した場合でも、スレーブサーバ毎に統計量が大きく異なった場合や、アーキテクチャが異なる場合はスレーブサーバ毎に最適な動作が異なる可能性がある。そのようなケースにおいて全てのスレーブサーバに対して統一した分散プランでは一部のスレーブサーバの実行速度がボトルネックとなり全体の性能が低下する可能性がある。しかしながら、スレーブサーバ毎に最適な動作ができるような分散プランを生成するとマスターサーバの分散プラン生成の仕組みが複雑になる。すなわち、マスターサーバの分散プラン処理部の最適化機能を向上させると、マスターサーバの最適化の仕組みは複雑化する。このため、マスターサーバが各スレーブサーバの状態毎に適した形で分散プランを生成することは困難である。   Also, even when all the information desired by the master server is acquired, there is a possibility that the optimum operation may be different for each slave server if the statistics are greatly different for each slave server or if the architecture is different. In such a case, in a distributed plan unified for all slave servers, the execution speed of some slave servers may become a bottleneck and the overall performance may be reduced. However, generating a distributed plan that can perform optimal operation for each slave server complicates the mechanism for generating the distributed plan of the master server. That is, if the optimization function of the distributed plan processing unit of the master server is improved, the mechanism for optimizing the master server becomes complicated. For this reason, it is difficult for the master server to generate a distributed plan in a form suitable for each state of each slave server.

特開2001−331485号公報JP 2001-331485 A 特開平07−141399号公報Japanese Patent Application Laid-Open No. 07-141399

本発明が解決しようとする課題は、マスターサーバ側の仕組みを複雑化することなく効率的な検索を実現する分散データベース検索装置を提供することである。   The problem to be solved by the present invention is to provide a distributed database search device that realizes efficient search without complicating the mechanism on the master server side.

実施形態の分散データベース検索装置は、入力された問合せクエリに基づいてデータベースを検索するマスターサーバと、データベースを具備する複数のスレーブサーバとを接続して構成され、スレーブサーバは、マスターサーバとデータの送受信を行う第2の送受信部と、受信した分散プランに基づいてローカルプラン候補を生成するローカルプラン候補生成部と、生成されたローカルプラン候補に基づいて最も演算コストが低いローカルプランを決定するローカルプラン選択部と、を備える。   The distributed database search apparatus according to the embodiment is configured by connecting a master server that searches a database based on an input query query and a plurality of slave servers that include the database. A second transmission / reception unit that performs transmission / reception, a local plan candidate generation unit that generates a local plan candidate based on the received distributed plan, and a local that determines a local plan with the lowest calculation cost based on the generated local plan candidate A plan selection unit.

第1の実施形態に係る分散データベース検索装置の全体構成図の一例である。It is an example of the whole block diagram of the distributed database search device concerning a 1st embodiment. 第1の実施形態に係るデータベースに登録されるデータの1つであるXMLデータの一例を示す模式図である。It is a schematic diagram which shows an example of the XML data which is one of the data registered into the database which concerns on 1st Embodiment. 第1の実施形態に係るデータベースに登録されるデータの1つであるXMLデータの一例を示す模式図である。It is a schematic diagram which shows an example of the XML data which is one of the data registered into the database which concerns on 1st Embodiment. 第1の実施形態に係るスレーブサーバが保持するデータベース情報の一例を示す模式図である。It is a schematic diagram which shows an example of the database information which the slave server which concerns on 1st Embodiment hold | maintains. 第1の実施形態に係るマスターサーバが保持するスレーブサーバ群情報の一例を示す模式図である。It is a schematic diagram which shows an example of the slave server group information which the master server which concerns on 1st Embodiment hold | maintains. 第1の実施形態に係る分散データベース検索処理の一例を示すフローチャートである。It is a flowchart which shows an example of the distributed database search process which concerns on 1st Embodiment. 第1の実施形態に係るXMLに対する問い合わせ言語XQueryの一例を示す模式図である。It is a schematic diagram which shows an example of the query language XQuery with respect to XML which concerns on 1st Embodiment. 第1の実施形態に係るクエリ分割部において生成される部分クエリの一例を示す図である。It is a figure which shows an example of the partial query produced | generated in the query division part which concerns on 1st Embodiment. 第1の実施形態に係る分散プラン生成部において生成される分散プランの一例を示す図である。It is a figure which shows an example of the dispersion | distribution plan produced | generated in the dispersion | distribution plan production | generation part which concerns on 1st Embodiment. 第1の実施形態に係る分割クエリ結合演算追加部による分散プラン修正処理の一例を示すフローチャート図である。It is a flowchart figure which shows an example of the distributed plan correction process by the division | segmentation query combination calculation addition part which concerns on 1st Embodiment. 第1の実施形態に係る分割クエリ結合演算追加処理が行われた分散プランの一例を示す模式図である。It is a schematic diagram which shows an example of the distributed plan in which the division | segmentation query combination operation addition process which concerns on 1st Embodiment was performed. 第1の実施形態に係るローカルプラン選択部において生成されるローカルプランの一例を示す模式図である。It is a schematic diagram which shows an example of the local plan produced | generated in the local plan selection part which concerns on 1st Embodiment. 第1の実施形態に係るローカルプラン候補生成処理の一例を示すフローチャート図である。It is a flowchart figure which shows an example of the local plan candidate production | generation process which concerns on 1st Embodiment. 第1の実施形態に係るローカルプラン候補生成処理の一例を示すフローチャート図である。It is a flowchart figure which shows an example of the local plan candidate production | generation process which concerns on 1st Embodiment. 第1の実施形態に係るローカルプラン候補生成処理の一例を示すフローチャート図である。It is a flowchart figure which shows an example of the local plan candidate production | generation process which concerns on 1st Embodiment. 第1の実施形態に係るローカルプラン候補生成部において生成されるローカルプランの一例を示す模式図である。It is a schematic diagram which shows an example of the local plan produced | generated in the local plan candidate production | generation part which concerns on 1st Embodiment. 第1の実施形態に係るローカルプラン候補生成部において生成されたローカルプランの一例を示す模式図である。It is a schematic diagram which shows an example of the local plan produced | generated in the local plan candidate production | generation part which concerns on 1st Embodiment. 第1の実施形態に係るローカルプラン候補生成部において生成されたローカルプランの一例を示す模式図である。It is a schematic diagram which shows an example of the local plan produced | generated in the local plan candidate production | generation part which concerns on 1st Embodiment. 第1の実施形態に係るローカルプラン候補生成部において生成されたローカルプランの一例を示す模式図である。It is a schematic diagram which shows an example of the local plan produced | generated in the local plan candidate production | generation part which concerns on 1st Embodiment. 第1の実施形態に係るローカルプラン候補生成部において生成されたローカルプランの一例を示す模式図である。It is a schematic diagram which shows an example of the local plan produced | generated in the local plan candidate production | generation part which concerns on 1st Embodiment. 第1の実施形態に係るローカルプラン候補生成部において生成されたローカルプランの一例を示す模式図である。It is a schematic diagram which shows an example of the local plan produced | generated in the local plan candidate production | generation part which concerns on 1st Embodiment. 第1の実施形態に係るローカルプラン候補生成部で演算コストを算出する際に用いるパラメータの一例を示すフローチャート図である。It is a flowchart figure which shows an example of the parameter used when calculating the calculation cost in the local plan candidate production | generation part which concerns on 1st Embodiment. 第1の実施形態に係る分散プラン更新部が分散プランを更新する処理の一例を示すフローチャート図である。It is a flowchart figure which shows an example of the process in which the distribution plan update part which concerns on 1st Embodiment updates a distribution plan. 第1の実施形態に係る分散プラン更新部において更新される分散プランの一例を示す模式図である。It is a schematic diagram which shows an example of the distribution plan updated in the distribution plan update part which concerns on 1st Embodiment. 第2の実施形態に係る分散データベース検索装置の全体構成図の一例である。It is an example of the whole block diagram of the distributed database search device concerning a 2nd embodiment. 第2の実施形態に係るスキーマ変更部で変更される前のスキーマの一例を示す模式図である。It is a schematic diagram which shows an example of the schema before being changed by the schema change part which concerns on 2nd Embodiment. 第2の実施形態に係る分散データベース検索処理の一例を示すフローチャートである。It is a flowchart which shows an example of the distributed database search process which concerns on 2nd Embodiment. 第2の実施形態に係るローカルプラン順序決定処理が行われたローカルプランの一例を示す模式図である。It is a schematic diagram which shows an example of the local plan with which the local plan order determination process which concerns on 2nd Embodiment was performed. 第2の実施形態に係るスキーマ生成部が分散プランのスキーマを生成する処理の一例を示すフローチャート図である。It is a flowchart figure which shows an example of the process which the schema production | generation part which concerns on 2nd Embodiment produces | generates the schema of a distributed plan. 第2の実施形態に係るスキーマ変更部で変更された新しいスキーマの一例を示す模式図である。It is a schematic diagram which shows an example of the new schema changed in the schema change part which concerns on 2nd Embodiment. 第2の実施形態に係るスキーマ変更部が分散プランの演算に入力されるデータのスキーマを更新する処理の一例を示すフローチャート図である。It is a flowchart figure which shows an example of the process in which the schema change part which concerns on 2nd Embodiment updates the schema of the data input into calculation of a distributed plan. 第2の実施形態に係るスキーマ変更部によるスキーマ生成処理が行われた結果得られる入出力スキーマの一例を示す図。The figure which shows an example of the input-output schema obtained as a result of performing the schema production | generation process by the schema change part which concerns on 2nd Embodiment.

以下、実施形態の分散データベース検索装置について図面を参照して説明する。   Hereinafter, a distributed database search apparatus according to an embodiment will be described with reference to the drawings.

(第1の実施形態)
図1は第1の実施形態の分散データベース検索装置の機能構成を示す構成図である。本実施形態の分散データベース検索装置は、ユーザから入力される検索式(以下、問合せクエリという)に基づいて検索を行い、検索結果を出力する。
(First embodiment)
FIG. 1 is a configuration diagram illustrating a functional configuration of the distributed database search apparatus according to the first embodiment. The distributed database search device of this embodiment performs a search based on a search expression (hereinafter referred to as a query query) input from a user, and outputs a search result.

図1に示すように、本実施形態の分散データベース検索装置は、マスターサーバとして機能する計算機0と、スレーブサーバとして機能する計算機1〜計算機Nとが接続して構成されている。   As shown in FIG. 1, the distributed database search apparatus of this embodiment is configured by connecting a computer 0 that functions as a master server and computers 1 to N that function as slave servers.

マスターサーバである計算機0は、構文解析部11と、クエリ分割部12と、分散プラン生成部13と、分割クエリ結合演算追加部14と、分散プラン更新部15と、分散プラン実行部16と、送受信部17(第1の送受信部)と、情報記憶部20(第1の記憶装置)とを備える。   The computer 0 which is a master server includes a syntax analysis unit 11, a query division unit 12, a distributed plan generation unit 13, a divided query join operation addition unit 14, a distributed plan update unit 15, a distributed plan execution unit 16, A transmission / reception unit 17 (first transmission / reception unit) and an information storage unit 20 (first storage device) are provided.

情報記憶部20は、スレーブサーバ群情報を格納するスレーブサーバ群情報記憶部21と、後述する分散プランを格納する分散プラン記憶部22とを備える。なお、スレープサーバ群情報とは全てのスレーブサーバの名前や位置、及び登録件数等スレーブサーバが持つデータベースに関する情報であり、スレーブサーバが持つデータベースの情報の一部である。マスターサーバはこのスレーブサーバ群情報に基づいてスレーブサーバにどのデータを送信するかを決定する。   The information storage unit 20 includes a slave server group information storage unit 21 that stores slave server group information, and a distributed plan storage unit 22 that stores a distributed plan to be described later. Note that the slave server group information is information about the database held by the slave server, such as the names and positions of all slave servers, and the number of registrations, and is part of the database information held by the slave server. The master server determines which data is to be transmitted to the slave server based on the slave server group information.

構文解析部11は、ユーザから与えられた問合せクエリ51を構文解析する。   The syntax analysis unit 11 parses the query query 51 given by the user.

クエリ分割部12は、問合せクエリ51を分割する機能を備え、構文解析部11による問合せクエリ51の構文解析結果と、スレーブサーバ群情報テーブル21とに基づいて、サーバ内演算及びサーバ間演算の単位で問合せクエリ51を分割する。分割した問合せクエリ51を部分クエリという。なお、サーバ内演算とは問合せクエリ51を各スレーブサーバ内で処理することである。また、サーバ間演算とは複数のスレーブサーバからデータを集めてマスターサーバ内で演算する処理である。   The query dividing unit 12 has a function of dividing the query query 51, and based on the result of the syntax analysis of the query query 51 by the syntax analysis unit 11 and the slave server group information table 21, a unit of intra-server operation and inter-server operation The query query 51 is divided by The divided query 51 is referred to as a partial query. The intra-server operation means that the query 51 is processed in each slave server. The inter-server calculation is a process of collecting data from a plurality of slave servers and calculating in the master server.

分散プラン生成部13は、分散プラン生成手段として機能するものであり、クエリ分割部12により得られた部分クエリと、スレーブサーバ群情報テーブル21の情報とに基づいて分散プランを生成する。すなわち、分散プラン生成部13は、スレーブサーバ群情報記憶部21に格納されているスレーブサーバの名前や位置、及び登録件数等に基づいて、分割されたサーバ内演算とサーバ間演算の、演算順序、演算実行場所及びサーバ間で送受信するデータの内容を決定した分散プランを生成する。なお、サーバ間で送受信するデータの内容とは、例えばスレーブサーバのデータ、スレーブサーバのデータの一部、平均値等のスレーブサーバのデータの演算結果、もしくは最大値や複数のスレーブサーバのデータの組合せ等のサーバ間演算の結果である。   The distributed plan generating unit 13 functions as a distributed plan generating unit, and generates a distributed plan based on the partial query obtained by the query dividing unit 12 and information in the slave server group information table 21. That is, the distributed plan generation unit 13 calculates the operation order of the divided intra-server operation and inter-server operation based on the name and position of the slave server stored in the slave server group information storage unit 21 and the number of registrations. Then, a distributed plan in which the contents of the data to be transmitted / received between the execution location and the server is determined is generated. The contents of data transmitted / received between servers include, for example, slave server data, a part of slave server data, the result of operation of slave server data such as an average value, or the maximum value and data of a plurality of slave servers. It is a result of calculation between servers, such as a combination.

分散プラン生成部13は分割クエリ結合演算追加部14と分散プラン更新部15とを備える。   The distributed plan generating unit 13 includes a divided query join operation adding unit 14 and a distributed plan updating unit 15.

分割クエリ結合演算追加部14は、分散プラン生成部13により得られた分散プランを図10のフローチャートに示す分割クエリ結合演算追加処理に従って修正する。以下、修正された分散プランを修正分散プランという。分割クエリ結合演算追加処理については後述する。   The divided query join operation adding unit 14 modifies the distributed plan obtained by the distributed plan generating unit 13 according to the divided query join operation adding process shown in the flowchart of FIG. Hereinafter, the modified distributed plan is referred to as a modified distributed plan. The split query join operation addition process will be described later.

分散プラン更新部15は、分散プラン更新手段として機能するものでありローカルプラン選択部、スレーブサーバから送られてきたローカルプランに基づいて修正分散プランを更新する分散プラン更新処理を行う。分散プラン修正処理については後述する。   The distributed plan update unit 15 functions as a distributed plan update unit, and performs a distributed plan update process for updating the modified distributed plan based on the local plan selection unit and the local plan sent from the slave server. The distributed plan correction process will be described later.

分散プラン実行部16は、分散プラン更新部15によって更新された分散プランに基づいて演算を実行する。   The distributed plan execution unit 16 executes a calculation based on the distributed plan updated by the distributed plan update unit 15.

送受信部17は、データ送受信手段として機能を有する。   The transmission / reception unit 17 functions as a data transmission / reception unit.

続いてスレーブサーバである計算機1〜Nについて説明する。   Next, computers 1 to N that are slave servers will be described.

計算機1〜Nはスレーブサーバとして機能するものであり、ローカルプラン選択部31と、ローカルプラン候補生成部32と、ローカルプラン実行部33と、送受信部34(第2の送受信部)と、情報記憶部40(第2の記憶装置)とを備える。   The computers 1 to N function as slave servers, and include a local plan selection unit 31, a local plan candidate generation unit 32, a local plan execution unit 33, a transmission / reception unit 34 (second transmission / reception unit), and information storage. Unit 40 (second storage device).

情報記憶部40は、格納したデータのスキーマ情報や件数等の統計情報などのデータベースに格納されたデータに関する情報であるデータベース情報を保持するデータベース情報記憶部41と、ローカルプランを保持するローカルプラン記憶部42と、検索対象の実際のデータ(以下、格納データという)を保持する格納データ記憶部43と、を備える。   The information storage unit 40 includes a database information storage unit 41 that holds database information that is information related to data stored in a database such as schema information of stored data and statistical information such as the number of cases, and a local plan storage that holds a local plan And a storage data storage unit 43 that holds actual data to be searched (hereinafter referred to as storage data).

ローカルプラン選択部31は、ローカルプラン生成手段として機能するものであり、ローカルプラン候補生成部32を備える。ローカルプラン選択部31は、分割クエリ結合演算追加部14により得られた修正分散プランの内、自身のサーバに関連する部分プランからなるローカルプランを生成する。ローカルプラン選択部が生成したローカルプランに基づいて、ローカルプラン候補生成部3がローカルプランの候補をさらに作成する。ローカルプラン選択部31は、自身が作成したローカルプランとローカルプラン候補生成部32に作成されたローカルプラン候補の中から、見積もり実行時間または見積もり実行計算量からなる演算コストを計算する。ローカルプラン選択部31は、算出した演算コストが最小となるプランをローカルプランとして決定する。   The local plan selection unit 31 functions as a local plan generation unit, and includes a local plan candidate generation unit 32. The local plan selection unit 31 generates a local plan made up of partial plans related to its own server among the modified distributed plans obtained by the split query join operation addition unit 14. Based on the local plan generated by the local plan selection unit, the local plan candidate generation unit 3 further creates a local plan candidate. The local plan selection unit 31 calculates a calculation cost including an estimated execution time or an estimated execution calculation amount from the local plan created by itself and the local plan candidate created by the local plan candidate generation unit 32. The local plan selection unit 31 determines the plan that minimizes the calculated calculation cost as the local plan.

ローカルプラン実行部33は、ローカルプラン選択部31によって得られたローカルプランに基づいて演算を実施する。送受信部34はマスターサーバの送受信部17と同一の機能を持つ。   The local plan execution unit 33 performs a calculation based on the local plan obtained by the local plan selection unit 31. The transmission / reception unit 34 has the same function as the transmission / reception unit 17 of the master server.

ここで、図2及び図3に、スレーブサーバの格納データ記憶部43に登録されるデータの一例を示す。なお、本実施形態のスレーブサーバの格納データ記憶部43に登録されるデータはXMLフォーマット形式で記述されている。なお、図2に示すデータは、書籍の発行年数、タイトル、著者、価格に関するデータである。図3に示すデータは、ある賞の受賞年度、受賞者、受賞した書籍のタイトル、受賞者の性別に関するデータである。   Here, FIGS. 2 and 3 show an example of data registered in the stored data storage unit 43 of the slave server. Note that the data registered in the stored data storage unit 43 of the slave server of this embodiment is described in the XML format. The data shown in FIG. 2 is data related to the publication year, title, author, and price of the book. The data shown in FIG. 3 is data relating to the award year of a certain award, the winner, the title of the book that has been awarded, and the gender of the winner.

図4は、スレーブサーバのデータ情報記憶部41が保持するデータベースの情報の一例である。図4に示すように、データベース情報は、「登録ノード」112と、「登録数」113と、「索引情報」114の項目を有するデータベース情報テーブル111として保持される。   FIG. 4 is an example of database information held by the data information storage unit 41 of the slave server. As shown in FIG. 4, the database information is held as a database information table 111 having items of “registration node” 112, “number of registrations” 113, and “index information” 114.

「登録ノード」112は、スレーブサーバの格納データ記憶部43に登録されたXMLデータが有するノード名を示すものであり、ここではどのノードの下にあるかを含めて記述する。なお、ノードとはXMLデータを構成する要素や属性などである。   The “registered node” 112 indicates a node name included in the XML data registered in the stored data storage unit 43 of the slave server, and is described here including under which node. Note that a node is an element or attribute that constitutes XML data.

「登録数」113は、スレーブサーバの格納データ記憶部43に登録されたXMLデータ中に各登録ノード112が出現した回数を示す。   “Registered number” 113 indicates the number of times each registered node 112 appears in the XML data registered in the stored data storage unit 43 of the slave server.

「索引情報」114は、登録ノード112に対して設定した索引の種類を記述したものである。索引の種類は、例えば数値索引や文字索引である。なお、図4には、一例として計算機1乃至計算機4のデータベース情報テーブル111−1〜111−4を示している。   “Index information” 114 describes the type of index set for the registration node 112. The index type is, for example, a numerical index or a character index. FIG. 4 shows database information tables 111-1 to 111-4 of the computers 1 to 4 as an example.

図5は、マスターサーバである計算機0が保持するスレーブサーバ群情報記憶部21に保存されたスレーブサーバ群情報21の一例である。図5に示すように、スレーブサーバ群情報は「サーバ名」122、「Collection情報」123、「登録文書数」124という項目を有するスレーブサーバ群情報テーブル121として保持される。   FIG. 5 is an example of the slave server group information 21 stored in the slave server group information storage unit 21 held by the computer 0 that is the master server. As shown in FIG. 5, the slave server group information is held as a slave server group information table 121 having items of “server name” 122, “Collection information” 123, and “number of registered documents” 124.

「サーバ名」122にはスレーブサーバの名称が格納される。「Collection情報」123には登録するXMLデータの格納場所の名前(以下、Collection名という)が格納される。本実施形態の分散データベースは異なるスレーブサーバでも同じCollection情報123を持つことができるため、ユーザはCollection名を指定することで特定のXMLデータの集合内を検索することが可能となる。「登録文書数」124はCollectionに登録されたXMLデータの数が格納される。   The “server name” 122 stores the name of the slave server. The “Collection information” 123 stores the name of the storage location of the registered XML data (hereinafter referred to as “Collection name”). Since the distributed database of the present embodiment can have the same collection information 123 even in different slave servers, the user can search within a set of specific XML data by specifying the collection name. “Registered document count” 124 stores the number of XML data registered in the collection.

ここで、図6乃至図25を参照して、本実施形態の分散データベース検索装置の処理について説明する。図6は、本実施形態の分散データベース検索装置の検索処理の一例を示すフローチャートである。なお、本実施形態の分散データベース検索装置は、計算機1〜4のデータベース情報記憶部41に、図4に示したデータベース情報が格納されているとする。   Here, with reference to FIG. 6 to FIG. 25, processing of the distributed database search device of this embodiment will be described. FIG. 6 is a flowchart illustrating an example of a search process of the distributed database search apparatus according to this embodiment. In the distributed database search device of this embodiment, it is assumed that the database information shown in FIG. 4 is stored in the database information storage unit 41 of the computers 1 to 4.

まず、ユーザによってマスターサーバに検索式である問合せクエリ51が入力される(ステップS1)。   First, a query query 51, which is a search expression, is input to the master server by the user (step S1).

ここで、図7に、ユーザによって入力される問合せクエリ51の一例を示す。図7に示す問合せクエリ51は、XMLデータの問い合わせ言語であるXQueryによって記述されている。なお、図7に示す問合せクエリ51は、「過去の受賞歴がある男性作家の著書のうち1990年以降に出版された本のタイトルと値段を出力せよ」という意味である。   Here, FIG. 7 shows an example of the query query 51 input by the user. The query 51 shown in FIG. 7 is described in XQuery, which is a query language for XML data. The query 51 shown in FIG. 7 means “output the title and price of a book published since 1990 among the books of male authors who have received awards”.

入力された問合せクエリ51の1行目のforから始まる1文は"publisher"というCollectionに登録されているbookの名前を持つノードのうち、属性ノードyearの値を数値化したものが1990以上のノードを変数$xに格納している。これにより1990年以降に出版した本の一覧を取得している。なお、XQueryにおいて変数は"$"で始まる文字列として表現される。   One sentence starting from “for” in the first line of the input query query 51 is a node having a book name registered in the collection “publisher”, and the value of the attribute node “year” is more than 1990. The node is stored in the variable $ x. As a result, a list of books published since 1990 is acquired. In XQuery, a variable is expressed as a character string starting with “$”.

次に2行目のforから始まる1文は"prizeWinners"というCollectionに登録されているprizeWinnerの名前を持つノードのうち、genderという子ノードの値を文字列化したものが"male"という文字列と等しいものを選択した後、その子ノードであるnameを変数$yに格納しており、これにより受賞歴のある男性作家の名前の一覧を取得している。次に3、4、5行目のletから始まる1文で1行目に取得したbookの子ノードであるauthor、title、priceのノードを各々変数$z、$u、$vに格納しており、これにより本の著者名とタイトルと値段を取得している。次に6行目のwhereから始まる1文で男性作家の名前と本の著者名が一致するものの組合せを取得している。最後に7行目のreturnから始まる1文で、6行目で取得した組合せに対してListの名前のノードで囲んだXMLを作りだしてユーザに返却している。これにより条件を満たした本のタイトルと値段を取得している。   Next, one sentence starting from “for” on the second line is a character string “male” obtained by converting the value of a child node named “generator” into a character string from among the nodes having the name “prizeWinner” registered in the collection “prizeWinners”. Is selected, the child node name is stored in the variable $ y, thereby obtaining a list of names of male writers who have received awards. Next, the author, title, and price nodes that are child nodes of the book acquired on the first line in the first sentence starting from the let on the third, fourth, and fifth lines are stored in the variables $ z, $ u, and $ v, respectively. The book author name, title, and price are obtained. Next, in the first sentence starting with “where” on the 6th line, a combination of a male writer whose name matches the author's name is obtained. Finally, in one sentence starting from “return” on the 7th line, an XML surrounded by a node with the name of List is created for the combination acquired on the 6th line and returned to the user. As a result, the title and price of the book that satisfies the conditions are acquired.

図7に示す問合せクエリ51がマスターサーバに入力されると、マスターサーバの構文解析部11は、問合せクエリ51を構文解析する(ステップS2)。構文解析部11による構文解析結果は、マスターサーバのクエリ分割部12に送信される。   When the query query 51 shown in FIG. 7 is input to the master server, the syntax analysis unit 11 of the master server parses the query query 51 (step S2). The result of parsing by the parsing unit 11 is transmitted to the query dividing unit 12 of the master server.

構文解析結果を受信したクエリ分割部12は、スレーブサーバ群情報テーブル21の情報に基づいて、問合せクエリ51を各スレーブサーバ内で処理するサーバ内演算及び複数スレーブサーバからデータを集めて演算するサーバ間演算の単位の部分クエリに分割する問合せクエリ51分割処理を行う(ステップS3)。   The query division unit 12 that has received the parsing result, based on the information in the slave server group information table 21, performs an in-server operation for processing the query query 51 in each slave server and a server that collects and calculates data from a plurality of slave servers. A query query 51 dividing process is performed to divide into partial queries in the unit of inter-operation (step S3).

すなわち、クエリ分割部12は、構文解析部11の構文解析の結果に基づいて、問合せクエリ51を部分クエリに分割する。クエリ分割部12は、スレーブサーバ群情報テーブル121を参照して、これらの部分クエリ毎に、部分クエリの内容がサーバ間演算かサーバ内演算を判定する。ここで、クエリ分割部12による分割結果である部分クエリの一覧である部分クエリ一欄テーブル131の一例を図8に示す。   That is, the query dividing unit 12 divides the query query 51 into partial queries based on the result of syntax analysis by the syntax analyzing unit 11. The query division unit 12 refers to the slave server group information table 121 to determine whether the partial query content is an inter-server operation or an intra-server operation for each partial query. Here, FIG. 8 shows an example of the partial query one column table 131 that is a list of partial queries that are the results of the division by the query dividing unit 12.

図8に示した部分クエリ一覧テーブル131は、部分クエリに順次振られる番号を格納する「番号」132、分割して得られた部分クエリを格納する「部分クエリ内容」133、部分クエリがサーバ内演算かサーバ間演算であるかを格納する「サーバ間/サーバ内演算」134、演算に必要なデータを保存した計算機名を格納する「対応サーバ」135の項目を有する。   The partial query list table 131 shown in FIG. 8 includes a “number” 132 for storing numbers sequentially assigned to partial queries, a “partial query content” 133 for storing partial queries obtained by division, and partial queries in the server. It has items of “inter-server / intra-server operation” 134 for storing whether the operation is an operation between servers or “corresponding server” 135 for storing the name of a computer storing data necessary for the operation.

以下に、クエリ分割部12による問合せクエリの分割処理について、図7乃至図8を参照して具体的に説明する。   Hereinafter, the query query dividing process by the query dividing unit 12 will be described in detail with reference to FIGS.

クエリ分割部12は、スレーブサーバ群情報テーブル121に基づいて、部分クエリごとの演算に用いるデータを保持する計算機を特定する。図8では図7に示した問合せクエリ51におけるCollection("publisher")とCollection("prizeWinner")の2つのCollection情報に着目する。すなわち、これらのCollection情報を用いて図5に示したスレーブサーバ群情報テーブル121を検索する。   Based on the slave server group information table 121, the query dividing unit 12 specifies a computer that holds data used for calculation for each partial query. In FIG. 8, attention is focused on two pieces of collection information of collection (“publisher”) and collection (“prizeWinner”) in the query query 51 shown in FIG. That is, the slave server group information table 121 shown in FIG. 5 is searched using these collection information.

すなわち、クエリ分割部12は、Collection("publisher")は計算機1乃至3に存在し、Collection("prizeWinner")は計算機4に存在すると判定する。   In other words, the query division unit 12 determines that Collection (“publisher”) exists in the computers 1 to 3 and that Collection (“prizeWinner”) exists in the computer 4.

さらにクエリ分割部12はCollectionに対して実施する"/"、"//"、">="、"="といったXQueryの演算に注目し、演算が複数の異なる計算機からの値が必要かどうかを判定する。演算が複数の異なる計算機からの値を必要とする場合、この演算をサーバ間演算と判定する。なお、一つの計算機からの値で行われる演算の場合、この演算をサーバ内演算と判定する。   Further, the query division unit 12 pays attention to XQuery operations such as “/”, “//”, “> =”, “=” performed on the collection, and whether the operation requires values from a plurality of different computers. Determine. When the operation requires values from a plurality of different computers, this operation is determined as an inter-server operation. In addition, in the case of the calculation performed with the value from one computer, this calculation is determined as the calculation in the server.

図8に示すように、問合せクエリ51においては"/"、"//"、">=1990"といった演算は全て入力となったデータの計算機上で実施できるため$x、$z、$u、$vは全て同一計算機上に演算したデータが格納される。なお、サーバ内演算については幾つかの演算単位で分割する。図8では"for"、"let"といった代入文が発生する単位で分割しており番号1〜5の部分クエリが発生する。なお、"for"、"let"という代入文の単位で分割したのは1例であり、実際にはもっと細かい演算単位で分割しても良いし、もっと大きな演算単位で分割しても良い。   As shown in FIG. 8, in the query 51, operations such as “/”, “//”, “> = 1990” can all be performed on the input data calculator, so that $ x, $ z, $ u , $ V all store data calculated on the same computer. Note that the intra-server computation is divided into several computation units. In FIG. 8, the query is divided in units in which assignment statements such as “for” and “let” are generated, and partial queries of numbers 1 to 5 are generated. Note that the division in units of assignment statements such as “for” and “let” is just an example, and in actuality, the division may be performed in smaller operation units or in larger operation units.

一方、"where$y=$z"という演算において、$yは計算機4のデータであり、$zは計算機1から3にあるデータであるためサーバ間演算であるとする。   On the other hand, in the calculation “where $ y = $ z”, it is assumed that $ y is data of the computer 4 and $ z is data in the computers 1 to 3 and thus is an inter-server operation.

続いて、次の"return<List>{$u}{$v}</List>"の演算は最終結果を返却する演算であるため、$u、$vのデータを持つ計算機1から3のデータを集めて演算するサーバ間演算が必要だと判定する。   Subsequently, since the next “return <List> {$ u} {$ v} </ List>” is an operation that returns the final result, the computers 1 to 3 having data of $ u and $ v It is determined that an inter-server operation that collects and calculates data is necessary.

続いて、分散プラン生成部13が、図8に示した部分クエリ一覧テーブル131と図5に示したスレーブサーバ群情報テーブル121とに基づいて分散プランを生成する(ステップS4)。生成した分散プランは分散プランテーブル141に格納される。   Subsequently, the distributed plan generation unit 13 generates a distributed plan based on the partial query list table 131 shown in FIG. 8 and the slave server group information table 121 shown in FIG. 5 (step S4). The generated distributed plan is stored in the distributed plan table 141.

図9に、分散プランテーブル141の一例を示す。   FIG. 9 shows an example of the distributed plan table 141.

分散プランテーブル141は「演算番号」142、「部分クエリ番号」143、「演算内容」144、「事前実行演算番号」145、「実行場所」146、「送信場所」147、「入力変数」148、「出力変数」149の項目を有する。   The distributed plan table 141 includes “operation number” 142, “partial query number” 143, “operation content” 144, “pre-execution operation number” 145, “execution location” 146, “transmission location” 147, “input variable” 148, It has an item “output variable” 149.

「演算番号」142は、演算毎に割り当てられた番号を示す。「部分クエリ番号」143は、図8に示した部分クエリテーブル131における部分クエリ番号132の項目で割り当てられた番号を格納する。部分クエリ番号132が割り当てられていない場合は空欄とする。   The “calculation number” 142 indicates a number assigned for each calculation. The “partial query number” 143 stores the number assigned in the item of the partial query number 132 in the partial query table 131 shown in FIG. If the partial query number 132 is not assigned, it is left blank.

「演算内容」144は、各演算の内容を格納する。ここでは、分散プラン生成部13は、図8に示した部分クエリ一覧テーブル131におけるサーバ内演算は、そのままサーバ内演算とし、部分クエリ一覧テーブル131におけるサーバ間演算は、具体的な操作を表す演算内容を記述する。さらに、部分クエリ一覧テーブル131におけるサーバ間演算の前後では、データの送信、データ受信の演算が必要となるため、新たに加える。   “Operation content” 144 stores the content of each operation. Here, the distributed plan generation unit 13 uses the intra-server operation in the partial query list table 131 shown in FIG. 8 as the intra-server operation as it is, and the inter-server operation in the partial query list table 131 represents a specific operation. Describe the content. Further, before and after the inter-server calculation in the partial query list table 131, data transmission and data reception calculations are required, and are newly added.

「事前実行演算番号」145は、その演算を実行する前に必ず実行しなければならない演算がある場合に、その演算番号を格納する。「実行場所」146は、演算を実行する場所(計算機)を格納する。データの送信とデータ受信の演算の場合は、演算結果のデータの送信先を「送信場所」147に格納する。すなわち、実行場所146はデータの送信元の計算機であり、送信場所147はデータの送信先の計算機である。   The “pre-execution operation number” 145 stores the operation number when there is an operation that must be executed before the operation is executed. The “execution location” 146 stores a location (computer) where the calculation is executed. In the case of calculation of data transmission and data reception, the transmission destination of the data of the calculation result is stored in “transmission location” 147. That is, the execution location 146 is a computer that is a data transmission source, and the transmission location 147 is a computer that is a data transmission destination.

「入力変数」148は、演算に入力データが必要な場合に格納され、そのデータが格納された変数の名前のリストを格納する。「出力変数」149は、演算が新しい値を作成する場合、その格納先の変数の名前のリストを格納する。   The “input variable” 148 is stored when input data is required for the operation, and stores a list of names of variables in which the data is stored. The “output variable” 149 stores a list of names of variables to be stored when the operation creates a new value.

なお、図9に示した分散プランテーブル141の演算番号1乃至5は、図8に示した部分クエリ一覧テーブル131の番号1乃至5に対応する。また、分散プランテーブル141の演算番号10及び11は、図8に示した部分クエリ一覧テーブル131の番号6、7に対応する。   Note that the operation numbers 1 to 5 in the distributed plan table 141 illustrated in FIG. 9 correspond to the numbers 1 to 5 in the partial query list table 131 illustrated in FIG. The operation numbers 10 and 11 in the distributed plan table 141 correspond to the numbers 6 and 7 in the partial query list table 131 shown in FIG.

また、部分クエリ一覧テーブル131でサーバ内/サーバ間演算134に「サーバ間演算」と格納されている部分クエリ番号6の演算は、演算内容144に「サーバ間JOIN」と格納される。すなわち、部分クエリ内容133に基づいた具体的な演算内容が格納される。同様に、部分クエリ番号7の演算は、演算内容144に「返却データ作成」という具体的な演算が格納されている。なお、「サーバ間JOIN」とは2つの変数に格納されたデータのうち値の等しい組合せを残す演算であり、「返却データ作成」とは入力されたデータを利用して新しいXMLデータを作る演算である。   In addition, in the partial query list table 131, the operation of the partial query number 6 stored in the intra-server / inter-server operation 134 is stored as “inter-server JOIN” in the operation content 144. That is, the specific calculation content based on the partial query content 133 is stored. Similarly, the calculation of partial query number 7 stores a specific calculation “return data creation” in the calculation content 144. Note that “inter-server JOIN” is an operation that leaves the same combination of data stored in two variables, and “return data creation” is an operation that creates new XML data using the input data. It is.

分散プラン生成部13は、「サーバ間演算」にのみ着目し、実行順序や実行場所を決定する。具体的には、図9に示した分散プランテーブル141は、サーバ間演算の演算内容144はサーバ間JOINと返却データ作成の2種類であるため、返却データ作成演算はサーバ間JOINを実行した後の方が対象となるデータが少なくなり効率が良いと判断する。   The distributed plan generation unit 13 pays attention only to “inter-server computation” and determines the execution order and execution location. Specifically, in the distributed plan table 141 shown in FIG. 9, since the calculation contents 144 of the inter-server calculation are two types of JOIN between servers and return data creation, the return data creation calculation is executed after executing the server-to-server JOIN. It is determined that the target is less efficient and the efficiency is better.

また、本実施形態では、サーバ間演算はマスターサーバで実施するものとして実行場所を決定する。なお、サーバ間演算をマスターサーバで実行するためには各スレーブサーバにあるデータを集める必要がある。そのため分散プラン生成部13は、分散プランテーブル141の演算番号6および演算番号8を追加し、それぞれの演算内容144にスレーブサーバがマスターサーバにデータを送る演算である「データ送信」を格納する。続いて、演算番号6および8において送信されたデータをマスターサーバが受信するために、演算番号7および9を追加し、それぞれの演算内容144にマスターサーバがスレーブサーバからデータを受信する演算である「データ受信」を格納する。   Further, in the present embodiment, the execution location is determined on the assumption that the inter-server calculation is performed by the master server. In addition, in order to perform the calculation between servers by a master server, it is necessary to collect the data in each slave server. Therefore, the distribution plan generation unit 13 adds the calculation number 6 and the calculation number 8 of the distribution plan table 141, and stores “data transmission” that is the calculation in which the slave server sends data to the master server in each calculation content 144. Subsequently, in order for the master server to receive the data transmitted in the calculation numbers 6 and 8, the calculation numbers 7 and 9 are added, and the master server receives the data from the slave server in each calculation content 144. Stores “data received”.

なお、本実施形態ではサーバ間演算をマスターサーバで実行するように決定しているが、マスターサーバではなく、例えば複数のスレーブサーバで実行するように決定しても良い。   In the present embodiment, the inter-server calculation is determined to be executed by the master server, but may be determined to be executed by, for example, a plurality of slave servers instead of the master server.

分散プラン生成部13は、図8に記載した部分クエリ内容133に基づいて、入力変数148および出力変数149を格納する。例えば、"for〜in"、"let〜:="の"〜"に書かれた変数が出力変数149であり、それ以外の場所で書かれた変数は入力変数148とする。また、データ送信演算においては入力変数148が出力変数149になる。さらにデータ受信演算においてはデータ送信演算の出力変数149が入力変数148と出力変数149になる。   The distributed plan generation unit 13 stores the input variable 148 and the output variable 149 based on the partial query content 133 described in FIG. For example, a variable written in “for” in “for˜in” and “let˜: =” is an output variable 149, and a variable written elsewhere is an input variable 148. In the data transmission calculation, the input variable 148 becomes the output variable 149. Further, in the data reception calculation, the output variable 149 of the data transmission calculation becomes an input variable 148 and an output variable 149.

なお、サーバ内演算は、分散プラン生成部13によって順序関係が崩れないように任意の順序に配置される。このように、本実施形態の分散プラン生成部13は、部分クエリ一覧テーブル131の「サーバ間演算」のみを検討する。これにより検討範囲が限定されるため、分散プラン生成部131は容易に分散プランを生成可能である。   The intra-server operations are arranged in an arbitrary order so that the order relation is not broken by the distributed plan generation unit 13. As described above, the distributed plan generation unit 13 of this embodiment considers only “inter-server operation” of the partial query list table 131. Since the examination range is thereby limited, the distributed plan generation unit 131 can easily generate a distributed plan.

次に、分割クエリ結合演算追加部14が、分散プラン生成部13が生成した分散プランに対して「分割クエリ結合」演算を追加し、分散プランの修正を行う分割クエリ結合演算追加処理を行う(ステップS5)。   Next, the split query join operation addition unit 14 adds a “split query join” operation to the distributed plan generated by the distributed plan generation unit 13 and performs split query join operation addition processing for correcting the distributed plan ( Step S5).

ここで、図10を参照して、分割クエリ結合演算追加部14が、図9に示した分散プランテーブル141に格納された分散プランに対して、分割クエリ結合演算追加処理を行う際の動作について具体的に説明する。   Here, with reference to FIG. 10, the operation when the split query join operation adding unit 14 performs the split query join operation adding process on the distributed plan stored in the distributed plan table 141 shown in FIG. 9. This will be specifically described.

なお、この分割クエリ結合演算追加処理ではiおよびjという変数を用いる。iは1以上の整数であり、対象の分散プランの演算番号以下である(1≦i≦分散プランの演算番号の最大値)。また、分割クエリ結合演算追加処理の開始時点ではi=1である。また、分散プランの演算番号の最大値を「max」とする。また、演算番号142がiの分散プランの演算を演算Eとする。なお、jはiと同様の性質の変数であり、演算番号142がjの分散プランの演算を演算Sとする。   Note that variables i and j are used in this split query join operation addition process. i is an integer greater than or equal to 1, and is less than or equal to the operation number of the target distributed plan (1 ≦ i ≦ maximum value of operation numbers of the distributed plan). Also, i = 1 at the start of the split query join operation addition process. In addition, the maximum value of the calculation number of the distributed plan is “max”. In addition, the calculation of the distributed plan whose operation number 142 is i is defined as operation E. Note that j is a variable having the same property as i, and an operation of a distributed plan whose operation number 142 is j is an operation S.

分割クエリ結合演算追加部14は、分散プラン生成部13から分散プランを受信すると、まず、初期化処理としてi=1、分散プランの演算番号の最大値=maxとする(ステップS10)。   When the split query join operation addition unit 14 receives the distribution plan from the distribution plan generation unit 13, first, i = 1 is set as the initialization process, and the maximum value of the operation number of the distribution plan is set to max (step S10).

分割クエリ結合演算追加部14は、図9に記載した分散プランテーブル141における演算番号iの演算Eを取得する(ステップS20)。次に、分割クエリ結合演算追加部14は、取得した演算Eがサーバ間演算であり、かつi≠maxであるか否かを判定する(ステップS30)。   The divided query join calculation adding unit 14 acquires the calculation E of the calculation number i in the distributed plan table 141 described in FIG. 9 (Step S20). Next, the divided query join operation adding unit 14 determines whether or not the acquired operation E is an inter-server operation and i ≠ max (step S30).

取得した演算Eがサーバ間演算であり、かつi≠maxである場合、すなわち演算Eが最後の演算以外の場合(ステップS30がYes)、j:=1とする(ステップS40)。   When the acquired operation E is an inter-server operation and i ≠ max, that is, when the operation E is other than the last operation (step S30 is Yes), j: = 1 is set (step S40).

次に、分散プランテーブル141の演算番号jの演算Sを取得する(ステップS50)。分割クエリ結合演算追加部14は、演算Sの演算内容144がデータ送信であり、かつ送信場所147に格納された計算機がスレーブサーバであるか否かを、図9の分散プランテーブル141を参照して判定する(ステップS60)。   Next, the operation S of the operation number j in the distributed plan table 141 is acquired (step S50). The divided query join operation adding unit 14 refers to the distributed plan table 141 of FIG. 9 to determine whether the operation content 144 of the operation S is data transmission and whether the computer stored in the transmission location 147 is a slave server. (Step S60).

演算Sの演算内容144が「データ送信」であり、かつ送信場所147の計算機がスレーブサーバの場合(ステップS60がYes)、分割クエリ結合演算追加部14は、演算Sの入力変数147と演算Eの入力変数147とに共通して現れる変数を格納したリスト(以下、varListという)を作成する(ステップS70)。次に演算Sの入力変数147からvarListにある変数を除いた変数を格納したリスト(以下、newVarListという)を作成する(ステップS80)。分割クエリ結合演算追加部14は、作成したvarListが空でなく、かつこのvarListに含まれる変数が、演算Sの入力変数147と完全に一致しない、かつvarlistの変数を出力する演算とnewVarListの変数を出力する演算とが並列実行可能かを判定する(ステップS90)。   When the calculation content 144 of the calculation S is “data transmission” and the computer at the transmission location 147 is a slave server (Yes in step S60), the split query join calculation addition unit 14 adds the input variable 147 of the calculation S and the calculation E A list (hereinafter referred to as varList) storing variables that appear in common with the input variable 147 is created (step S70). Next, a list (hereinafter referred to as “newVarList”) storing variables excluding variables in varList from the input variable 147 of the operation S is created (step S80). The split query join operation addition unit 14 creates a new VarList variable and a new VarList variable in which the created varList is not empty and the variable included in the varList does not completely match the input variable 147 of the operation S and the variable of the varlist is output. It is determined whether or not the operation for outputting can be executed in parallel (step S90).

なお、ここで図9に示した分散プランテーブル141において、varlistの変数を出力する演算とnewVarListの変数を出力する演算とが並列実行可能かどうかの判定方法について説明する。この方法は、一方の演算の事前実行演算番号145及びこの事前実行演算番号145の演算の事前実行演算番号145を繰り返し遡って調べた際に、もう一方の演算が事前実行演算番号として存在しない場合に、2つの演算は並列実行可能と判定する。すなわち、演算Aの事前実行演算番号145に演算Bの演算番号がある場合は、演算Bを実行した後に演算Aを実行しなくてはいけないため、並列実行できないと判定する。   Here, a description will be given of a method for determining whether or not an operation that outputs a variable of a variable and an operation that outputs a variable of a newVarList can be executed in parallel in the distributed plan table 141 shown in FIG. In this method, when the pre-execution operation number 145 of one operation and the pre-execution operation number 145 of the operation of this pre-execution operation number 145 are repeatedly examined, the other operation does not exist as the pre-execution operation number. In addition, it is determined that the two operations can be executed in parallel. In other words, if there is an operation number of operation B in the pre-execution operation number 145 of operation A, since operation A must be executed after operation B is executed, it is determined that parallel execution is not possible.

図10のステップS90の説明に戻る。varListが空でなく、かつこのvarListに含まれる変数が、演算Sの入力変数147と完全に一致しない、かつvarlistの変数を出力する演算とnewVarListの変数を出力する演算とが並列実行可能な場合(ステップS90がYes)、次の5つの演算を演算Eの後に挿入し、挿入後、iにi+5を代入する(i:=i+5)(ステップS100)。   Returning to the description of step S90 in FIG. When varList is not empty, and the variable included in varList does not completely match the input variable 147 of operation S, and the operation that outputs the variable of variable and the operation that outputs the variable of newVarList can be executed in parallel (Step S90 is Yes), the next five operations are inserted after the operation E, and after the insertion, i + 5 is substituted for i (i: = i + 5) (step S100).

1つ目の演算は、演算内容144が"データ送信"、入力変数148と出力変数149がvarListに含まれる変数、実行場所146が"演算Sの送信場所147、送信場所147が演算Sの実行場所146"である。   In the first calculation, calculation content 144 is “data transmission”, input variable 148 and output variable 149 are variables included in varList, execution location 146 is “transmission location 147 of calculation S, and transmission location 147 is execution of calculation S. Location 146 ".

2つ目の演算は、演算内容144が"データ受信"、入力変数148と出力変数149がvarListに含まれる変数、実行場所146が"演算Sの送信場所147"、"送信場所147が演算Sの実行場所146"である。   In the second calculation, the calculation content 144 is “data reception”, the input variable 148 and the output variable 149 are variables included in the varList, the execution location 146 is “the transmission location 147 of the calculation S”, and the “transmission location 147 is the calculation S. Execution location 146 ".

3つ目の演算は、演算内容144が"分割クエリ結合"、入力変数148がvarListに含まれる変数、実行場所146が"演算Sの実行場所146"である。なお、演算内容が「分割クエリ結合」とは、ある変数に対して別々に並行して処理を行った結果を再び1つにする演算である。   In the third operation, the operation content 144 is “partitioned query combination”, the input variable 148 is a variable included in varList, and the execution location 146 is “the execution location 146 of the operation S”. Note that the operation content “divided query combination” is an operation for re-combining the results obtained by separately processing a certain variable in parallel.

4つ目の演算は、演算内容144が"データ送信"、入力変数148と出力変数149がnewVarListに含まれる変数、実行場所146が"演算Sの実行場所146"、"送信場所147が演算Sの送信場所147"である。   In the fourth calculation, the calculation content 144 is “data transmission”, the input variable 148 and the output variable 149 are variables included in the newVarList, the execution location 146 is “execution location 146 of the calculation S”, and the transmission location 147 is the calculation S. Is the transmission location 147 ".

5つ目の演算は、演算内容144が"データ受信"、入力変数148と出力変数149がnewVarList、実行場所146が"演算Sの実行場所146"送信場所147が"演算Sの送信場所"である。   In the fifth calculation, the calculation content 144 is “data reception”, the input variable 148 and the output variable 149 are newVarList, the execution place 146 is “the execution place 146 of the calculation S”, and the transmission place 147 is “the transmission place of the calculation S”. is there.

次に、演算Sで送信する変数を変更するために3つの処理を実施する(ステップS110)。1つ目は演算Sの入力変数148と出力変数149の内容をvarListの値に変更する。2つ目は演算Sの次の演算Rを取得する。演算Rは演算Sに対応する演算内容144"データ受信"の演算である。3つ目にRの入力変数148と出力変数149リストの内容をvarListの値に変更する。その後ステップS120へ進む。   Next, three processes are performed in order to change the variable transmitted by the calculation S (step S110). The first is to change the contents of the input variable 148 and the output variable 149 of the operation S to the value of varList. The second obtains the next operation R after the operation S. The operation R is an operation of the operation content 144 “data reception” corresponding to the operation S. Third, the contents of the R input variable 148 and output variable 149 lists are changed to the value of varList. Thereafter, the process proceeds to step S120.

なお、演算Sがデータ送信ではない、または実行場所146の計算機がスレーブサーバでない場合(ステップS60がNo)も、ステップS120へと進む。   Note that also when the calculation S is not data transmission or the computer at the execution place 146 is not a slave server (No in step S60), the process proceeds to step S120.

またvarListが空、または演算Sの入力変数リストと完全に一致する、かつvarlistの変数を出力する演算とnewVarListの変数を出力する演算とが並列実行可能でない場合(ステップS90がNoの場合)も、ステップS120に進む。   Also, when varList is empty, or an operation that outputs a variable of varlist and an operation that outputs a variable of newVarList cannot be executed in parallel (when Step S90 is No). The process proceeds to step S120.

ステップS120では、分割クエリ結合演算追加部14は、jにj+1を代入する(j:=j+1)(ステップS120)。すなわち、ステップS120はステップS60がNoの場合もしくはステップS90がNoの場合もしくはステップS110に続いて行われる。   In step S120, the divided query join operation adding unit 14 substitutes j + 1 for j (j: = j + 1) (step S120). That is, step S120 is performed when step S60 is No or when step S90 is No or after step S110.

ステップS120に続いて、分割クエリ結合演算追加部14は、jがiより小さいかを判定する(ステップS130)。jがiより小さい場合(ステップS130がYes)はステップS50に戻り処理を繰り返す。jがiより小さくない場合(ステップS130がNo)はステップS140に進みiにi+1を代入する(i:=i+1)(ステップS140)。   Subsequent to step S120, the split query join operation adding unit 14 determines whether j is smaller than i (step S130). When j is smaller than i (step S130 is Yes), the process returns to step S50 and is repeated. When j is not smaller than i (No in step S130), the process proceeds to step S140, and i + 1 is substituted for i (i: = i + 1) (step S140).

演算Eがサーバ間演算ではない、またはi=maxの場合(ステップS30がNo)、ステップS140に進む。すなわち、ステップS140の処理はステップS130がNoの場合もしくはステップS30がNoの場合に続いて行われる。   When the calculation E is not an inter-server calculation or i = max (No in step S30), the process proceeds to step S140. That is, the process of step S140 is performed subsequently when step S130 is No or when step S30 is No.

ステップS140に続いて、分割クエリ結合演算追加部14は、iがmax以下かを判定する(ステップS150)。すなわち、すべての部分クエリに対して分割クエリ演算追加処理を行ったかを判定する。   Subsequent to step S140, the split query join operation adding unit 14 determines whether i is equal to or less than max (step S150). That is, it is determined whether the divided query calculation addition processing has been performed for all partial queries.

iがmax以下である場合(ステップS150がYes)、分割クエリ結合演算追加部14は、ステップS20に戻り処理を繰り返す。iがmaxよりも大きい場合(ステップS150がNo)、分割クエリ結合演算追加部14は処理を終了する。   When i is less than or equal to max (step S150 is Yes), the divided query join operation adding unit 14 returns to step S20 and repeats the process. When i is larger than max (step S150: No), the split query join operation adding unit 14 ends the process.

ここで、図11に、図9に示した分散プランに対して、分割クエリ結合演算追加部14が上述した分割クエリ結合演算追加処理を行った結果、修正された分散プラン(以下、修正分散プランという)の一例を示す。   Here, in FIG. 11, as a result of the split query join operation addition unit 14 performing the above-described split query join operation addition processing on the distributed plan shown in FIG. An example).

図9の分散プランテーブル141に記載された分散プランは、演算1乃至10はサーバ間演算ではないため、分割クエリ結合演算追加部14、はiが10になるまで1ずつ増やしていく(図10のステップS20、ステップS30、ステップS140、ステップS150)。   In the distributed plan described in the distributed plan table 141 in FIG. 9, since the operations 1 to 10 are not server-to-server operations, the divided query join operation adding unit 14 increases by 1 until i becomes 10 (FIG. 10). Step S20, Step S30, Step S140, Step S150).

i=10になると、演算Eがサーバ間演算であるため(ステップS30がYes)、変数jに1を代入する(ステップS40)。なお、演算Eがサーバ間演算かどうかの判定は、演算Eの部分クエリ番号に基づいて分散プランテーブル141を参照して行われる。   When i = 10, since the operation E is an inter-server operation (Yes in step S30), 1 is substituted into the variable j (step S40). Whether or not the operation E is an inter-server operation is determined with reference to the distributed plan table 141 based on the partial query number of the operation E.

次にjが6になるまではデータ送信ではないためjを1ずつ増やしていく(ステップS50、ステップS60がNo、ステップS120、ステップS130)。   Next, since j is not a data transmission until j reaches 6, j is incremented by 1 (No in step S50 and step S60, step S120 and step S130).

jが6になると、演算Sの演算内容がデータ送信で実行場所146の計算機がスレーブサーバであるため(ステップS60がYes)、演算番号6の入力変数148と演算番号10の入力変数148に共通で現れる変数$zを格納した変数リストvarListを作成する(ステップS70)。   When j is 6, since the operation content of the operation S is data transmission and the computer at the execution place 146 is a slave server (Yes in step S60), the input variable 148 of the operation number 6 and the input variable 148 of the operation number 10 are common. A variable list varList that stores the variable $ z that appears in step S70 is created (step S70).

取得した演算番号6の入力変数148からvarListの変数リストを除いた変数$u、変数$yを格納した変数リストnewVarListを作成する(ステップS80)。   A variable list newVarList storing the variables $ u and $ y obtained by removing the variable list of varList from the obtained input variable 148 of the operation number 6 is created (step S80).

varListが空ではなく、演算番号6の入力変数リストとも完全に一致しない、かつvarlistとnewVarListの変数を出力する演算が並列実行可能であるため図11の演算番号11−15の5つの演算を追加した後iを5加えて15を代入する(ステップS90、ステップS100)。次に演算番号6のデータ送信と演算番号7のデータ送信の入力変数148と出力変数149にvarListの値変数$zを代入する(ステップS110)。   Since varList is not empty, does not completely match the input variable list of operation number 6, and operations that output variables of varlist and newVarList can be executed in parallel, five operations of operation numbers 11-15 in FIG. 11 are added. After that, i is incremented by 5 and 15 is substituted (step S90, step S100). Next, the value variable $ z of varList is substituted into the input variable 148 and the output variable 149 of the data transmission of the operation number 6 and the data transmission of the operation number 7 (step S110).

次にjが8になるまではデータ送信ではないため単純に変数jを1ずつ増やしていく(ステップS50、ステップS60、ステップS120、ステップS130)。jが8の場合は演算内容144がデータ送信で実行場所146がスレーブサーバであるため、演算番号8の入力変数と演算番号10の入力変数リストに共通で現れる変数$y格納した変数リストvarListを取得する(ステップS70)。   Next, since j is not data transmission until j reaches 8, the variable j is simply increased by 1 (step S50, step S60, step S120, step S130). When j is 8, since the operation content 144 is data transmission and the execution place 146 is a slave server, the variable list varList storing the variable $ y that appears in common in the input variable of the operation number 8 and the input variable list of the operation number 10 is stored. Obtain (step S70).

取得したvarListは空ではないが、演算番号8の入力変数リストと完全に一致するため(ステップS90がNo)、jに1を加える(ステップSS120)。以降データ送信演算はないためiを1増やして16を代入する(ステップS120、ステップS130、ステップS140、ステップS150)。   Although the acquired varList is not empty, it completely matches the input variable list of operation number 8 (No in step S90), so 1 is added to j (step SS120). Since there is no further data transmission calculation, i is incremented by 1 and 16 is substituted (step S120, step S130, step S140, step S150).

次にiが16における演算はサーバ間演算であるが、iがmaxと等しいため(ステップS150がYes)、ステップS20にもとり、処理を繰り返す。そして、iの値がmaxを超えると(ステップS150がNo)、分割クエリ結合演算追加部14は処理を終了する。その結果、分散プランが作成される。図11に修正された分散プランのテーブル151を示す。すなわち、分散プラン結合演算追加部14は、サーバ間演算とその他の演算はできるだけ並列に実行して、後で結合する形にプランを書き換える。   Next, the calculation in which i is 16 is an inter-server calculation, but since i is equal to max (Yes in step S150), the process is repeated in step S20. When the value of i exceeds max (No in step S150), the split query join operation adding unit 14 ends the process. As a result, a distributed plan is created. FIG. 11 shows a table 151 of the modified distributed plan. That is, the distributed plan combination operation addition unit 14 executes the inter-server operation and other operations in parallel as much as possible, and rewrites the plan so that it is combined later.

上述したように、分割クエリ結合演算追加部14が分散プランを修正すると、マスターサーバの送受信部17はスレーブサーバに修正された修正分散プランを送信する。このとき、全てのスレーブサーバに修正分散プランを送信してもよい。また、実行場所を参照して、関連のあるスレーブサーバにのみ修正分散プランを送信してもよい。   As described above, when the split query join operation addition unit 14 corrects the distribution plan, the transmission / reception unit 17 of the master server transmits the corrected distribution plan to the slave server. At this time, the modified distribution plan may be transmitted to all slave servers. Alternatively, the modified distribution plan may be transmitted only to the related slave server with reference to the execution location.

スレーブサーバのローカルプラン選択部31は、受信した分割クエリ結合手順追加部14により修正された分散プランの内、自身のサーバに関連する部分に対するローカルプラン候補を生成する(ステップS6)。   The local plan selection unit 31 of the slave server generates a local plan candidate for a portion related to its own server in the distributed plan modified by the received divided query combination procedure adding unit 14 (step S6).

ここで、ローカルプラン選択部31によって生成されたローカルプランの候補を図12に例示する。図12に示したローカルプラン候補2は、計算機2であるスレーブサーバのローカルプラン選択部31が、図11に記載した分散プランと図4に記載したデータベース情報111とに基づいて生成した、計算機2に関するローカルプラン候補の一例である。   Here, the local plan candidates generated by the local plan selection unit 31 are illustrated in FIG. The local plan candidate 2 shown in FIG. 12 is generated by the local plan selection unit 31 of the slave server that is the computer 2 based on the distributed plan shown in FIG. 11 and the database information 111 shown in FIG. It is an example of the local plan candidate regarding.

図12に示したローカルプラン候補2示すように、ローカルプラン候補2は「演算番号」302、「部分クエリ番号」303、「演算内容」304、「事前実行演算番号」305、「実行場所」306、「送信場所」307、「入力変数」308、「出力変数」309の項目を有する。なお、本実施形態のローカルプラン候補および後述するローカルプランが有する項目302〜309は、本実施形態の分散プランテーブルが有する項目142〜149と同一である。   As shown in the local plan candidate 2 shown in FIG. 12, the local plan candidate 2 includes “operation number” 302, “partial query number” 303, “operation content” 304, “pre-execution operation number” 305, and “execution location” 306. , “Transmission location” 307, “input variable” 308, and “output variable” 309. Note that items 302 to 309 included in the local plan candidates of the present embodiment and the local plan described later are the same as the items 142 to 149 included in the distributed plan table of the present embodiment.

なお、図12に示したローカルプラン候補2において、計算機2では図4のデータベース情報からのbookの下のyear属性ノードに対して数値索引が設定されている。そのため、最初の演算番号1で部分クエリ番号1の部分クエリに該当する処理を演算「数値索引」によって実現する。演算「数値索引」はノードが持つ値を数値化したものを索引化した数値索引を設定したノードに対して、与えられた数値との比較条件を満たすノード若しくはそのノードを所有する文書の最初のノードを高速に取得する演算である。   In the local plan candidate 2 shown in FIG. 12, in the computer 2, a numerical index is set for the year attribute node under the book from the database information in FIG. Therefore, the process corresponding to the partial query of the first query number 1 and the partial query number 1 is realized by the calculation “numerical index”. The operation "numerical index" is the first node of a node that satisfies a comparison condition with a given numeric value or the document that owns that node for a node that has a numeric index that is obtained by indexing the values of nodes. This is an operation for acquiring a node at high speed.

具体的には、ローカルプラン選択部31は、属性ノードyearの値が1990以上の条件を満たすbookノードを数値索引内から探し出して変数$xに格納する。   Specifically, the local plan selection unit 31 searches for a book node satisfying the condition that the value of the attribute node “year” is 1990 or more from the numerical index and stores it in the variable $ x.

演算番号2、4、5は各々部分クエリ番号3、4、5の部分クエリを処理する演算「TRAVERSE(トラバース)」を実施する。なお、演算「TRAVERSE」とはXML内の或るノード(入力)から或るノード(出力)へ辿っていく演算である。具体的には演算番号1で求めた$xに格納されたbookノードから、子ノードであるauthor、title、priceを取得して各々変数$z、$u、$vに格納する。演算番号3、6、7、8は分散プランで作成したデータ送信、データ受信、分割クエリ結合演算をそのまま残したものである。   Operation numbers 2, 4, and 5 perform an operation “TRAVERSE” that processes partial queries of partial query numbers 3, 4, and 5, respectively. The operation “TRAVERSE” is an operation that traces from a certain node (input) to a certain node (output) in XML. Specifically, the author node, title, and price as child nodes are acquired from the book node stored in $ x obtained by the operation number 1 and stored in the variables $ z, $ u, and $ v, respectively. The operation numbers 3, 6, 7, and 8 are the data transmission, data reception, and split query join operations created by the distributed plan as they are.

次に、図13を参照して、図12のローカルプラン候補2に基づいてローカルプラン候補生成部32がさらにローカルプラン候補を生成するローカルプラン候補生成処理について説明する(図6のステップS7)。図13はローカルプラン候補生成処理の一例を示すフローチャートである。   Next, a local plan candidate generation process in which the local plan candidate generation unit 32 further generates a local plan candidate based on the local plan candidate 2 in FIG. 12 will be described with reference to FIG. 13 (step S7 in FIG. 6). FIG. 13 is a flowchart illustrating an example of local plan candidate generation processing.

なお、このローカルプラン候補生成処理はiという変数を用いる。iは1以上であり、かつ、対象のローカルプラン選択部31が生成したローカルプラン候補のリスト(以下、inputPlanListという)内の要素数以下である(1≦i≦inputPlanList内の要素数)。   This local plan candidate generation process uses a variable i. i is 1 or more and is equal to or less than the number of elements in the list of local plan candidates (hereinafter referred to as inputPlanList) generated by the target local plan selection unit 31 (1 ≦ i ≦ number of elements in the inputPlanList).

まず、ローカルプラン候補生成部32は、図12に示すローカルプラン候補を取得する(ステップS200)。ローカルプラン候補生成部32は、i=1、inputPlanList内の要素数=maxとする(ステップS210)。   First, the local plan candidate generation unit 32 acquires the local plan candidates shown in FIG. 12 (step S200). The local plan candidate generating unit 32 sets i = 1 and the number of elements in the inputPlanList = max (step S210).

続いてローカルプラン候補生成部32はinputPlanListからi番目のローカルプラン候補planを取得する(ステップS220)。ローカルプラン候補生成部32は、取得したplanに基づいて、後述する分割クエリ結合の実施変数の組合せパターン生成処理を実施し、このplanを含む新規のローカルプラン候補リストを作成する(ステップS230)。分割クエリ結合の実施変数の組合せパターン生成処理とは、分割クエリ結合前後で実施する演算を変化させて様々なローカルプラン候補を生成する処理であり、図14のフローチャートにより詳細を後述する。   Subsequently, the local plan candidate generation unit 32 acquires the i-th local plan candidate plan from the inputPlanList (step S220). Based on the acquired plan, the local plan candidate generation unit 32 performs a combination pattern generation process of an execution variable for split query combination, which will be described later, and creates a new local plan candidate list including this plan (step S230). The combination pattern generation process of the execution variable of the split query combination is a process of generating various local plan candidates by changing the calculation performed before and after the split query combination, and will be described in detail later with reference to the flowchart of FIG.

ローカルプラン候補生成部32は、分割クエリ結合の実施変数の組合せパターン生成処理によって得られた新規のローカルプラン候補リスト(以下、nextPlanListという)を取得する(ステップS240)。ここで、jという変数を用いる。jは1以上であり、かつ、nextPlanList内の要素数以下である(1≦j≦nextPlanList内の要素数)。また、この時j=1であり、nextPlanList内の要素数=finalMaxとする(ステップS250)。   The local plan candidate generation unit 32 acquires a new local plan candidate list (hereinafter, referred to as “nextPlanList”) obtained by the combination pattern generation processing of the execution variables of the split query combination (step S240). Here, a variable called j is used. j is 1 or more and less than or equal to the number of elements in nextPlanList (1 ≦ j ≦ number of elements in nextPlanList). At this time, j = 1 and the number of elements in nextPlanList = finalMax (step S250).

次に、ローカルプラン候補生成部32は、nextPlanListからj番目のローカルプラン候補nextPlanを取得する(ステップS260)。ローカルプラン候補生成部32は、取得したnextPlanに基づいて分割クエリ結合の実施場所パターン生成処理を実施しnextPlanを含む新規のローカルプラン候補リストを作成する(ステップS270)。分割クエリ結合の実施場所パターン生成処理とは、分割クエリ結合演算の実行場所を変化させることで様々なローカルプラン候補を生成する処理であり、図15のフローチャートにより詳細を後述する。   Next, the local plan candidate generation unit 32 acquires the jth local plan candidate nextPlan from the nextPlanList (step S260). The local plan candidate generation unit 32 performs the execution location pattern generation process of the split query combination based on the acquired nextPlan, and creates a new local plan candidate list including the nextPlan (step S270). The execution location pattern generation process for split query join is a process for generating various local plan candidates by changing the execution place of the split query join operation, and will be described in detail later with reference to the flowchart of FIG.

ローカルプラン候補生成部32は、分割クエリ結合の実施場所パターン生成処理結果に基づいて新規のローカルプラン候補リストfinalPlanListを作成する(ステップS280)。作成したfinalPlanList内のローカルプラン候補を最終出力である出力候補プランリストoutputListに追加する(ステップS290)。   The local plan candidate generation unit 32 creates a new local plan candidate list finalPlanList based on the execution location pattern generation processing result of the split query combination (step S280). The local plan candidates in the created finalPlanList are added to the output candidate plan list outputList that is the final output (step S290).

次に、ステップS300に進み、jにj+1を代入する(j:=j+1)(ステップS300)。ローカルプラン候補生成部32は、このjがfinalMax以下であるかを判定する(ステップS310)。jがfinalMax以下の場合(ステップS310がYes)、ステップS260に戻り処理を繰り返す。   Next, proceeding to step S300, j + 1 is substituted for j (j: = j + 1) (step S300). The local plan candidate generation unit 32 determines whether this j is equal to or less than finalMax (step S310). If j is not more than finalMax (step S310 is Yes), the process returns to step S260 and is repeated.

jがfinalMaxより大きい場合(ステップS310がNo)、ステップS320に進みiにi+1を代入する(i:=i+1)(ステップS320)。   When j is larger than finalMax (step S310: No), the process proceeds to step S320, and i + 1 is substituted for i (i: = i + 1) (step S320).

次にiがmax以下かを判定する(ステップS330)。iがmax以下の場合(ステップS330がYes)はステップS220に戻り処理を繰り返す。iがmaxよりも大きい場合は終了する。最終出力はoutputListに格納されたローカルプラン候補リストであり、ローカルプラン選択部31はこのローカルプラン候補リストの中から最終的に1つのローカルプランを選択する。   Next, it is determined whether i is equal to or less than max (step S330). If i is less than or equal to max (step S330 is Yes), the process returns to step S220 and is repeated. If i is larger than max, the process ends. The final output is a local plan candidate list stored in outputList, and the local plan selection unit 31 finally selects one local plan from the local plan candidate list.

次に、図14のフローチャートに従って、ローカルプラン候補生成部32による、図13のステップS230における分割クエリ結合の実施変数の組合せパターン生成処理について説明する。なお、この分割クエリ結合の実施変数の組合せパターン生成処理はiという変数を用いる。iは1以上であり、かつ、入力対象のローカルプラン候補planの演算番号以下である(1≦i≦planの演算番号の最大値)。   Next, according to the flowchart of FIG. 14, the combination pattern generation process of the execution variable of the split query combination in step S230 of FIG. 13 by the local plan candidate generation unit 32 will be described. Note that the variable i is used in the combination pattern generation process of the execution variable of the split query combination. i is 1 or more and is equal to or less than the operation number of the local plan candidate plan to be input (the maximum value of the operation numbers of 1 ≦ i ≦ plan).

まず、ローカルプラン候補生成部32は、planを最終出力である一時候補リストnextPlanListに登録する(ステップS400)。また、ローカルプラン候補生成部32は、i=1、planの演算番号の最大値=maxとする(ステップS410)。   First, the local plan candidate generating unit 32 registers plan in the temporary candidate list nextPlanList that is the final output (step S400). Further, the local plan candidate generating unit 32 sets i = 1 and the maximum value of the operation number of plan = max (step S410).

続いて、ローカルプラン候補生成部32は入力されたローカルプラン候補planの演算番号iの演算Eを取得する(ステップS420)。取得した演算Eが分割クエリ結合演算の場合(ステップS430がYes)、planの演算番号i+1番目のデータ送信演算Sを取得し、さらに演算Sの入力変数の全組合せパターンのリストvarPatternListを取得する(ステップS440)。   Subsequently, the local plan candidate generation unit 32 acquires the operation E of the operation number i of the input local plan candidate plan (step S420). If the acquired operation E is a split query join operation (Yes in step S430), the operation number i + 1 of the plan and the data transmission operation S of the 1st data are acquired, and further, a list varPatternList of all combination patterns of the input variables of the operation S is acquired ( Step S440).

次に、j:=1とし、nextPlanList内の要素数=nextMaxとする(ステップS450)。次に、nextPlanListのj番目のプランnextPlanを取得する(ステップS460)。次に、k:=1とし、varPatternList内の要素数=vtMaxとする(ステップS470)。次に、nextPlanの内容をコピーした新しいローカルプラン候補newPlanを作成する(ステップS480)。   Next, j: = 1, and the number of elements in nextPlanList = nextMax (step S450). Next, the jth plan nextPlan of nextPlanList is acquired (step S460). Next, k: = 1 and the number of elements in varPatternList = vtMax (step S470). Next, a new local plan candidate newPlan is created by copying the contents of nextPlan (step S480).

次に、ローカルプラン候補生成部32は、次の3つの処理を実施する(ステップS490)。1つ目はvarPatternListのk番目の要素targetVarsを取得する処理であり、2つ目はnewPlanの演算番号i+1番目のデータ送信演算ASを取得する処理であり、3つ目はnewPlanの演算番号i−1番目のデータ受信演算ARを取得する処理である。   Next, the local plan candidate generation unit 32 performs the following three processes (step S490). The first is a process for obtaining the k-th element targetVars of varPatternList, the second is the process for obtaining the newPlan operation number i + 1, and the third data transmission operation AS, and the third is the process number i- This is processing for obtaining the first data reception calculation AR.

次に演算ASの入力変数リストとtargetVarsの内容が一致するかを判定する(ステップS500)。   Next, it is determined whether the input variable list of the operation AS matches the contents of targetVars (step S500).

演算ASの入力変数リストが空の場合(ステップS500がYes)、演算E、演算AS、演算ARは不要であるため各演算内容をdummyに変更する。dummyは何もしない演算であり、後で削除する。ここでは演算番号がずれるため削除しない。   If the input variable list of the calculation AS is empty (step S500 is Yes), the calculation E, the calculation AS, and the calculation AR are unnecessary, so that each calculation content is changed to dummy. Dummy is an operation that does nothing, and is deleted later. Here, the calculation number is shifted, so it is not deleted.

次に、分割クエリ結合をしない変数を事前に送るように、演算Eより前にあるデータ送信演算の入出力変数と事前実行演算番号を変更するために次の4つの処理を実施する(ステップS520)。1つ目は演算Eの入力変数を入力変数とするデータ送信演算BSを取得する処理であり、2つ目はBSの入出力変数リストへtargetVarsに含まれる変数を追加する処理であり、3つ目はtargetVarsの変数を出力する演算の演算番号リストpreExeListを取得する処理であり、4つ目はBSの事前実行演算番号にpreExeListの値を代入する処理である。   Next, the following four processes are performed in order to change the input / output variable and the pre-execution operation number of the data transmission operation before the operation E so as to send the variable that does not perform the split query combination in advance (step S520). ). The first is a process of acquiring a data transmission calculation BS using the input variable of the calculation E as an input variable, and the second is a process of adding a variable included in the targetVars to the input / output variable list of the BS. The fourth is a process of acquiring the operation number list preExeList of the operation for outputting the variable of targetVars, and the fourth is the process of substituting the value of preExeList for the pre-execution operation number of the BS.

ローカルプラン候補生成部32は、ステップS520の処理を行ったnewPlanをnewPlanListに追加する(ステップS530)。   The local plan candidate generation unit 32 adds newPlan that has been subjected to the process of step S520 to the newPlanList (step S530).

その後、kにk+1を代入し(k:=k+1)(ステップS540)、kがvtMax以下であるかを判定する(ステップS550)。kがvtMax以下の場合(ステップS550がYes)、ステップS480に戻り処理を繰り返す。kがvtMaxより大きい場合(ステップS550がNo)、ステップS560に進みjにj+1を代入する(j:=j+1)(ステップS560)。   Thereafter, k + 1 is substituted for k (k: = k + 1) (step S540), and it is determined whether k is equal to or less than vtMax (step S550). When k is less than or equal to vtMax (step S550 is Yes), the process returns to step S480 and the process is repeated. When k is larger than vtMax (step S550: No), the process proceeds to step S560, and j + 1 is substituted for j (j: = j + 1) (step S560).

ローカルプラン候補生成部32は、jがnextMax以下であるかを判定する(ステップS570)。jがnextMax以下の場合(ステップS570がYes)、ステップS460に戻り処理を繰り返す。jがnextMaxより大きい場合(ステップS570がNo)、ステップS580に進みnewPlanList内の要素をnextPlanListに全て移す(ステップS580)。その後、ステップS590へと進み、iにi+1を代入する(i:=i+1)(ステップS590)。   The local plan candidate generation unit 32 determines whether j is equal to or less than nextMax (step S570). When j is less than or equal to nextMax (step S570 is Yes), the process returns to step S460 and is repeated. If j is larger than nextMax (No in step S570), the process proceeds to step S580, and all the elements in newPlanList are moved to nextPlanList (step S580). Thereafter, the process proceeds to step S590, where i + 1 is substituted for i (i: = i + 1) (step S590).

なお、演算Eが分割クエリ結合ではない場合も(ステップS430がNo)、ステップS590に進みiにi+1を代入する(i:=i+1)(ステップS590)。すなわちステップS590の処理はステップS430がNoまたはステップS580に続いて行われる。   Even when the operation E is not a split query join (No in step S430), the process proceeds to step S590 and i + 1 is substituted for i (i: = i + 1) (step S590). That is, the process of step S590 is performed after step S430 is No or step S580.

ローカルプラン候補生成部32は、iがmax以下であるかを判定する(ステップS600)。iがmax以下の場合(ステップS600がYes)、ステップS420に戻り処理を繰り返す。iがmaxより大きい場合は終了する。処理の終了後の最終出力はnextPlanListに格納されたローカルプラン候補リストであり、図13のステップS240に戻ってローカルプラン候補生成部32の処理が続けられる。   The local plan candidate generation unit 32 determines whether i is equal to or less than max (step S600). If i is less than or equal to max (step S600 is Yes), the process returns to step S420 and is repeated. If i is larger than max, the process ends. The final output after the processing is the local plan candidate list stored in nextPlanList, and the processing of the local plan candidate generating unit 32 is continued by returning to step S240 in FIG.

次に、図15のフローチャートに従って分割クエリ結合の実施場所パターン生成処理について説明する。なお、この分割クエリ結合の実施場所パターン生成処理はiという変数を用いる。iは1以上であり、かつ、入力対象のローカルプラン候補nextPlanの演算番号以下である(1≦i≦nextPlanの演算番号の最大値)。   Next, the execution location pattern generation process for split query combination will be described with reference to the flowchart of FIG. Note that the variable location i is used in the execution location pattern generation process of the split query combination. i is 1 or more and is equal to or smaller than the operation number of the local plan candidate nextPlan to be input (the maximum value of the operation numbers of 1 ≦ i ≦ nextPlan).

ローカルプラン候補生成部32は、nextPlanを最終出力である最終候補リストfinalPlanListに登録する(ステップS700)。   The local plan candidate generation unit 32 registers nextPlan in the final candidate list finalPlanList that is the final output (step S700).

また、処理の開始時点ではi=1、nextPlanの演算番号の最大値=maxとする(ステップS710)。   Further, i = 1 and the maximum value of the nextPlan operation number = max at the start of processing (step S710).

まず、分割クエリ結合の実施場所パターン生成処理は入力されたローカルプラン候補nextPlanの演算番号iの演算Eを取得する(ステップS720)。取得した演算Eが分割クエリ結合演算の場合(ステップS730がYes)、nextPlanの演算番号i+1番目の演算Sを取得する(ステップS740)。次に、j:=1とし、finalPlanList内の要素数=finalMaxとする(ステップS750)。次に、finalPlanListのj番目のプランfinalPlanを取得する(ステップS760)。次に、finalPlanの内容をコピーした新しいローカルプラン候補newPlanを作成する(ステップS770)。   First, the execution location pattern generation process of split query combination acquires the operation E of the operation number i of the input local plan candidate nextPlan (step S720). When the acquired operation E is a split query join operation (Yes in step S730), the operation number i + 1 of the nextPlan is acquired (step S740). Next, j: = 1 and the number of elements in finalPlanList = finalMax (step S750). Next, the jth plan finalPlan of finalPlanList is acquired (step S760). Next, a new local plan candidate newPlan is created by copying the contents of finalPlan (step S770).

次にローカルプラン候補生成部32は、分割クエリ結合の実行場所をマスターサーバに変更するために次の5つの処理を実施する(ステップS780)。1つ目は分割結合演算Eの直後の送信データ演算Sを取得する処理である。2つ目は分割クエリ結合演算Eの直前の受信データ演算Rを取得する処理である。3つ目は演算Rの演算内容を送信データ演算に、入出力変数にSの入力変数を追加したものに、実行場所を演算Sの送信先→Sの送信元に変更する処理である。4つ目の処理は不要になった演算Sの演算内容をdummyに変更する処理である。5つ目の処理は、演算Eの実行場所をSの送信元に変更する処理である。   Next, the local plan candidate generating unit 32 performs the following five processes in order to change the execution location of the split query combination to the master server (step S780). The first is a process of acquiring the transmission data calculation S immediately after the split / join calculation E. The second is a process of acquiring the received data calculation R immediately before the split query join calculation E. The third is a process of changing the execution location from the transmission destination of the calculation S to the transmission source of the S, with the calculation content of the calculation R being the transmission data calculation and the input variable of S being added to the input / output variable. The fourth process is a process of changing the calculation content of the calculation S that is no longer necessary to “dummy”. The fifth process is a process of changing the execution location of the operation E to the S transmission source.

次に、ステップS790に進みステップS780で修正したnewPlanを新規プランリストnewPlanListに追加する(ステップS790)。次に、ステップS800に進みjにj+1を代入する(j:=j+1)(ステップS800)。次にjがfinalMax以下であるかを判定する(ステップS810)。jがfinalMax以下の場合(ステップS810がYes)、ステップS760に戻り処理を繰り返す。jがfinalMaxより大きい場合(ステップS810がNo)、ステップS820に進みnewPlanList内の要素を全てfinalPlanListに移す(ステップS820)。さらにステップS830へと進む。   Next, the process proceeds to step S790, and newPlan corrected in step S780 is added to the new plan list newPlanList (step S790). Next, proceeding to step S800, j + 1 is substituted for j (j: = j + 1) (step S800). Next, it is determined whether j is equal to or less than finalMax (step S810). If j is not more than finalMax (step S810 is Yes), the process returns to step S760 and the process is repeated. When j is larger than finalMax (step S810: No), the process proceeds to step S820, and all the elements in newPlanList are moved to finalPlanList (step S820). Further, the process proceeds to step S830.

また演算Eが分割クエリ結合ではない場合も(ステップS730がNo)、ステップS830に進みiにi+1を代入する(i:=i+1)(ステップS830)。すなわちステップS830の処理はステップS730がNoまたはステップS820に続いて行われる。   When the calculation E is not a split query combination (No in step S730), the process proceeds to step S830 and i + 1 is substituted for i (i: = i + 1) (step S830). That is, the process of step S830 is performed after step S730 is No or step S820.

次にiがmax以下であるかを判定する(ステップS840)。iがmax以下の場合(ステップS840がYes)、ステップS720に戻り処理を繰り返す。iがmaxより大きい場合はステップS850に進む。   Next, it is determined whether i is equal to or less than max (step S840). If i is less than or equal to max (step S840 is Yes), the process returns to step S720 and is repeated. If i is larger than max, the process proceeds to step S850.

ステップS850はfinalPlanList内にある全てのローカルプラン候補内の演算で、演算内容がdummyとなっているものを削除して終了する(ステップS850)。最終出力はfinalPlanListに格納されたローカルプラン候補リストであり、図13のステップS280に戻ってローカルプラン候補生成部32の処理が続けられる。   In step S850, all the calculations in the local plan candidates in finalPlanList are deleted with the calculation content being dummy (step S850). The final output is a local plan candidate list stored in finalPlanList, and the process returns to step S280 of FIG. 13 to continue the processing of the local plan candidate generation unit 32.

図12に示したローカルプラン候補2が、ローカルプラン選択部31で得られたローカルプラン候補の場合において、上述したローカルプラン候補生成処理が行われた結果、得られる新たなローカルプラン候補2−1乃至2−6を図16乃至図21に示す。   When the local plan candidate 2 shown in FIG. 12 is a local plan candidate obtained by the local plan selection unit 31, a new local plan candidate 2-1 obtained as a result of the above-described local plan candidate generation processing is performed. 1 to 6 are shown in FIGS.

ローカルプラン候補生成部32が、これらのローカルプラン候補2−1乃至2−6を生成する処理を具体的に説明する。まず、図12のローカルプラン候補2が、分割クエリ結合の実施変数の組合せパターン処理の入力として渡される(図13のステップS200、S210、S220、S230)。   A process in which the local plan candidate generating unit 32 generates these local plan candidates 2-1 to 2-6 will be specifically described. First, the local plan candidate 2 in FIG. 12 is passed as an input for combination pattern processing of the execution variable of the split query combination (steps S200, S210, S220, and S230 in FIG. 13).

次に分割クエリ結合の実施変数の組合せパターン処理において、入力された図12のローカルプラン候補2(以下、planとする)を一時候補リスト(以下、nextPlanListとする)に登録する(図14のステップS400)。次にplanではiが7になるまでは分割クエリ結合演算ではないので変数iを1ずつ増やしていく(ステップS420、S430、S550、S540)。iが7の時の演算Eは分割クエリ結合であるため演算番号が8の演算Sを取得し、Sの入力変数($u、$v)の全組合せとして3つの組合せ($u)、($v)、($u、$v)をvarPatternListに格納する(ステップS440)。次に、j:=1としてnextPlanList内の1番目の要素として最初に登録した図12のplanをnextPlanとして取得する(ステップS450、S460)。次にnextPlanをコピーしたnewPlanを作成する(ステップS480)。   Next, in the combination pattern processing of the execution variables of the split query join, the input local plan candidate 2 (hereinafter referred to as “plan”) in FIG. 12 is registered in the temporary candidate list (hereinafter referred to as “nextPlanList”) (step in FIG. 14). S400). Next, in plan, since i is not a split query join operation until i becomes 7, the variable i is incremented by 1 (steps S420, S430, S550, and S540). Since the operation E when i is 7 is a split query join, the operation S with the operation number 8 is acquired, and three combinations ($ u), ( $ V) and ($ u, $ v) are stored in varPatternList (step S440). Next, the plan of FIG. 12 registered first as the first element in the nextPlanList with j: = 1 is acquired as the nextPlan (steps S450 and S460). Next, newPlan is created by copying nextPlan (step S480).

次に、varPatternListの1番目の要素($u)を取得し、newPlanの演算番号8のデータ送信演算ASと演算番号6のデータ受信演算ARを取得する(ステップS490)。ASの入力変数($u、$v)と($u)は一致しないため、分割クエリ結合の入力変数を送信する演算番号3のデータ送信演算を取得し入出力変数に分割クエリ結合の対象から外した変数$uを追加する。さらに変数$uを出力する演算番号4を演算番号3の事前実行演算番号に追加する(ステップS500、S520)。これによって得られたnewPlanをnewPlanListに追加する(ステップS530)。newPlanであるローカルプラン候補2−1の内容を図16に示す。但し図16に示したローカルプラン候補2−1では演算内容dummyの演算は削除済みである。次にkに2を代入し再び図12のplanをコピーしたnewPlanを作成する(ステップS480)。   Next, the first element ($ u) of varPatternList is acquired, and the data transmission operation AS of operation number 8 and the data reception operation AR of operation number 6 are acquired (step S490). Since the AS input variables ($ u, $ v) and ($ u) do not match, the data transmission operation of operation number 3 for transmitting the input variable of the split query combination is acquired and the input / output variable is selected from the target of the split query connection. Add the removed variable $ u. Further, the operation number 4 for outputting the variable $ u is added to the pre-execution operation number of the operation number 3 (steps S500 and S520). The newPlan obtained in this way is added to the newPlanList (step S530). The contents of the local plan candidate 2-1 that is newPlan are shown in FIG. However, in the local plan candidate 2-1 shown in FIG. 16, the calculation of the calculation content dummy has been deleted. Next, 2 is substituted for k, and a newPlan is created by copying the plan of FIG. 12 again (step S480).

次に、varPatternListの2番目の要素($v)を取得し、newPlanの演算番号8のデータ送信演算ASと演算番号6のデータ受信演算ARを取得する(ステップS490)。ASの入力変数($u、$v)と($v)は一致しないため、分割クエリ結合の入力変数$zを送信する演算番号3のデータ送信演算を取得し入出力変数に分割クエリ結合の対象から外した変数$vを追加する。さらに変数$vを出力する演算番号5を演算番号3の事前実行演算番号に追加する(ステップS500、S520)。これによって得られたnewPlanをnewPlanListに追加する(ステップS530)。newPlanであるローカルプラン候補2−2の内容を図17に示す。但し図17に示したローカルプラン候補2−2では演算内容dummyの演算は削除済みである。次にkに3を代入し再び図12のplanをコピーしたnewPlanを作成する(ステップS480)。   Next, the second element ($ v) of varPatternList is acquired, and the data transmission operation AS of operation number 8 and the data reception operation AR of operation number 6 are acquired (step S490). Since the AS input variables ($ u, $ v) and ($ v) do not match, the data transmission operation of operation number 3 for transmitting the input variable $ z of the split query combination is acquired, and the split query connection is input to the input / output variable. Add the variable $ v excluded from the target. Further, the operation number 5 for outputting the variable $ v is added to the pre-execution operation number of the operation number 3 (steps S500 and S520). The newPlan obtained in this way is added to the newPlanList (step S530). The contents of the local plan candidate 2-2 which is newPlan are shown in FIG. However, in the local plan candidate 2-2 shown in FIG. 17, the calculation of the calculation content dummy has been deleted. Next, newPlan is created by substituting 3 for k and copying the plan of FIG. 12 again (step S480).

次に、varPatternListの3番目の要素($u、$v)を取得し、newPlanの演算番号8のデータ送信演算ASと演算番号6のデータ受信演算ARを取得する(ステップS490)。ASの入力変数($u、$v)とvarPatternListの3番目の要素($u、$v)は完全に一致するため、演算E、AS、ARの演算内容をdummyに変更する(ステップS510)。次に分割クエリ結合の入力変数を送信する演算番号3のデータ送信演算を取得し入出力変数に分割クエリ結合の対象から外した変数$u、$vを追加する。さらに変数$u、$vを出力する演算番号4、5を演算番号3の事前実行演算番号に追加する(ステップS520)。これによって得られたnewPlanをnewPlanListに追加する(ステップS530)。このnewPlanであるローカルプラン候補2−3の内容を図18に示す。但し図18に示したローカルプラン候補2−3では演算内容dummyの演算は削除済みである。次にkに4を代入する(ステップS540)。   Next, the third element ($ u, $ v) of varPatternList is acquired, and the data transmission operation AS of operation number 8 and the data reception operation AR of operation number 6 are acquired (step S490). Since the AS input variables ($ u, $ v) and the third element ($ u, $ v) of varPatternList completely match, the computation contents of computations E, AS, AR are changed to dummy (step S510). . Next, the data transmission operation of operation number 3 for transmitting the input variable of the split query combination is acquired, and the variables $ u and $ v excluded from the target of the split query connection are added to the input / output variables. Further, the operation numbers 4 and 5 for outputting the variables $ u and $ v are added to the pre-execution operation number of the operation number 3 (step S520). The newPlan obtained in this way is added to the newPlanList (step S530). The contents of the local plan candidate 2-3 that is the newPlan are shown in FIG. However, in the local plan candidate 2-3 shown in FIG. 18, the calculation of the calculation content dummy has been deleted. Next, 4 is substituted for k (step S540).

次にvarPatternListは要素数が3までしかないためjに2を代入する(ステップS590、S580)。次にnextPlanListは要素数が1しかないため、今まで得られたnewPlanList内の3つのローカルプラン候補図16、17、18に示したローカルプラン候補をnextPlanListに移す(ステップS570、S560)。nextPlanListはこの時点で図12、図16乃至図18のローカルプラン候補を要素として持つ。次にiに8以降の値を代入しても分割クエリ結合は存在しないため分割クエリ結合の実施変数の組合せパターン生成処理を終了する(ステップS550、S540、S420、S430)。   Next, since varPatternList has only 3 elements, 2 is substituted for j (steps S590 and S580). Next, since nextPlanList has only one element, the three local plan candidates in the newPlanList obtained so far are transferred to the nextPlanList (steps S570 and S560). NextPlanList has the local plan candidates shown in FIGS. 12, 16 to 18 as elements at this time. Next, even if a value after 8 is substituted for i, there is no split query combination, and therefore the combination pattern generation processing of the execution variable of the split query combination is ended (steps S550, S540, S420, S430).

次に分割クエリ結合の実施変数の組合せパターン生成処理の出力リストとして図12、図16乃至図18のローカルプラン候補を格納したnextPlanListを取得する(図13のステップS240)。次にjに1を代入し、nextPlanListの1番目の要素である図12のローカルプラン候補nextPlanを取得する(ステップS250、S260)。次にnextPlanは分割クエリ結合の実施場所パターン生成処理の入力として渡される(ステップS270)。   Next, nextPlanList in which the local plan candidates shown in FIGS. 12, 16 to 18 are stored is acquired as an output list of the combination pattern generation process of the execution variable of the split query combination (step S240 in FIG. 13). Next, 1 is substituted into j, and the local plan candidate nextPlan of FIG. 12 which is the first element of nextPlanList is acquired (steps S250 and S260). NextPlan is then passed as an input for the execution location pattern generation process for split query join (step S270).

次に、分割クエリ結合の実施場所パターン生成処理の入力として渡された図12のローカルプラン候補nextPlanを、最終候補リストfinalPlanListに登録する(図15のステップS700)。次にiに1を代入する(ステップS710)。   Next, the local plan candidate nextPlan in FIG. 12 passed as the input of the execution location pattern generation process for split query combination is registered in the final candidate list finalPlanList (step S700 in FIG. 15). Next, 1 is substituted into i (step S710).

nextPlanではiが7になるまでは分割クエリ結合演算ではないので変数iを1ずつ増やしていく(ステップS720、S730、S830、S840)。iが7の時の演算Eは分割クエリ結合であるため演算番号が8のデータ送信演算Sを取得する(ステップS740)。次にjに1を代入し、finalPlanList内の1番目の要素として最初に登録した、図12に示したローカルプラン候補nextPlanをfinalPlanとして取得する(ステップS750、S760)。次にfinalPlanをコピーしたnewPlanを作成する(ステップS770)。   Since nextPlan is not a split query join operation until i becomes 7, variable i is incremented by 1 (steps S720, S730, S830, and S840). Since the operation E when i is 7 is a split query combination, the data transmission operation S with the operation number 8 is acquired (step S740). Next, 1 is substituted into j, and the local plan candidate nextPlan shown in FIG. 12 that is first registered as the first element in finalPlanList is obtained as finalPlan (steps S750 and S760). Next, newPlan is created by copying finalPlan (step S770).

部分クエリ番号の実行場所をマスターサーバに変更するために以下の処理を行う(ステップS780)。最初に演算番号8の送信データ演算Sと演算番号6の受信データ演算Rを取得する。次にRを送信データ演算に、入出力変数はSの入力変数$u、$vを加えたものに、実行場所を"計算機2→0"に変更する。さらにSの演算内容をdummyに変更する。最後にEの実行場所を計算機0に変更する。   The following processing is performed to change the execution location of the partial query number to the master server (step S780). First, the transmission data calculation S of calculation number 8 and the reception data calculation R of calculation number 6 are acquired. Next, the execution location is changed to “computer 2 → 0”, with R being the transmission data calculation, the input / output variables being the addition of the S input variables $ u and $ v. Further, the calculation content of S is changed to dummy. Finally, the execution location of E is changed to computer 0.

次に、これによって得られたnewPlanをnewPlanListに追加する(ステップS790)。newPlanであるローカルプラン候補2−4の内容を図19に示す。但し図19に示したローカルプラン候補2−4では演算内容dummyの演算は削除済みである。   Next, newPlan obtained in this way is added to newPlanList (step S790). The contents of the local plan candidate 2-4, which is newPlan, are shown in FIG. However, in the local plan candidate 2-4 shown in FIG. 19, the calculation of the calculation content dummy has been deleted.

次にjに2を代入するが、finalPlanListは要素数が1しかないため、今まで得られたnewPlanList内の1つのローカルプラン候補2−4をfinalPlanListに移す(ステップS800、S810、S820)。次にiに8以降の値を代入しても分割クエリ結合は存在しないため、今までfinalPlanListで得られた各ローカルプラン候補内に存在する演算内容がdummyの演算を削除して分割クエリ結合の実施場所パターン生成処理終了する(ステップS830、S840、S850)。   Next, 2 is substituted for j. Since finalPlanList has only one element, one local plan candidate 2-4 in newPlanList obtained so far is transferred to finalPlanList (steps S800, S810, and S820). Next, even if a value after 8 is substituted for i, there is no split query join. Therefore, the operation contents existing in each local plan candidate obtained by finalPlanList until now delete the operation of dummy and the split query join The execution location pattern generation process ends (steps S830, S840, S850).

次に分割クエリ結合の実施場所パターン生成処理の出力リストとして図12、図19のローカルプラン候補を格納したfinalPlanListを取得する(図13のステップS280)。次にfinalPlanList内の要素図12、図19のローカルプラン候補を出力候補プランリストoutputListに移す(ステップS290)。次にjに2を代入し、nextPlanListの2番目の要素である図16のローカルプラン候補nextPlanを取得する(ステップS300、S310、S260)。次にnextPlanは分割クエリ結合の実施場所パターン生成処理の入力として渡される(ステップS270)。   Next, finalPlanList that stores the local plan candidates shown in FIGS. 12 and 19 is acquired as an output list of the execution location pattern generation process for split query combination (step S280 in FIG. 13). Next, the local plan candidates shown in FIGS. 12 and 19 in the finalPlanList are moved to the output candidate plan list outputList (step S290). Next, 2 is substituted for j, and the local plan candidate nextPlan of FIG. 16 which is the second element of nextPlanList is acquired (steps S300, S310, and S260). NextPlan is then passed as an input for the execution location pattern generation process for split query join (step S270).

分割クエリ結合の実施場所パターン生成処理において図16に示したローカルプラン候補2−1は、図12に示したローカルプラン候補2とプランの形が入出力変数149を除きほぼ同じであり、図12に示したローカルプラン候補2が入力の場合と同じ動作となるため図16に示したローカルプラン候補2−1が入力の場合の詳細は省略する。分割クエリ結合の実施場所パターン生成処理の出力リストfinalPlanListの内容は図16、図20のローカルプラン候補リストとなる。   The local plan candidate 2-1 shown in FIG. 16 in the execution location pattern generation process of split query join is almost the same as the local plan candidate 2 shown in FIG. 12 except for the input / output variable 149. FIG. Since the operation is the same as when the local plan candidate 2 shown in FIG. 16 is input, the details when the local plan candidate 2-1 shown in FIG. 16 is input are omitted. The contents of the output list finalPlanList of the execution location pattern generation process of the split query combination are the local plan candidate lists of FIGS.

次にfinalPlanList内の要素図16、図20のローカルプラン候補を出力候補プランリストoutputListに移す(ステップS290)。次にjに3を代入し、nextPlanListの3番目の要素である図17のローカルプラン候補nextPlanを取得する(ステップS300、S310、S260)。次に、nextPlanは分割クエリ結合の実施場所パターン生成処理の入力として渡される(ステップS270)。   Next, the local plan candidates shown in FIGS. 16 and 20 in finalPlanList are moved to the output candidate plan list outputList (step S290). Next, 3 is substituted into j, and the local plan candidate nextPlan of FIG. 17 that is the third element of nextPlanList is acquired (steps S300, S310, and S260). NextPlan is passed as an input of the execution location pattern generation process for split query join (step S270).

分割クエリ結合の実施場所パターン生成処理において図17に示したローカルプラン候補2−2は図12に示したローカルプラン候補2とプランの形が入出力変数149を除きほぼ同じであり、図12に示したローカルプラン候補2が入力の場合と同じ動作となるため図17に示したローカルプラン候補2−2が入力の場合の詳細は省略する。分割クエリ結合の実施場所パターン生成処理の出力リストfinalPlanListの内容は図17、図21のローカルプラン候補リストとなる。   In the execution location pattern generation process of split query combination, the local plan candidate 2-2 shown in FIG. 17 is almost the same as the local plan candidate 2 shown in FIG. 12 except for the input / output variable 149. Since the operation is the same as that in the case where the local plan candidate 2 shown in FIG. 17 is input, details in the case where the local plan candidate 2-2 shown in FIG. 17 is input are omitted. The contents of the output list finalPlanList of the execution location pattern generation process of the split query combination are the local plan candidate lists of FIGS.

finalPlanList内の要素図17、図21のローカルプラン候補を出力候補プランリストoutputListに移す(ステップS290)。次にjに4を代入し、nextPlanListの4番目の要素である図18のローカルプラン候補nextPlanを取得する(ステップS300、S310、S260)。次にnextPlanは分割クエリ結合の実施場所パターン生成処理の入力として渡される(ステップS270)。   Elements in finalPlanList The local plan candidates in FIGS. 17 and 21 are moved to the output candidate plan list outputList (step S290). Next, 4 is substituted into j, and the local plan candidate nextPlan of FIG. 18 that is the fourth element of nextPlanList is acquired (steps S300, S310, and S260). NextPlan is then passed as an input for the execution location pattern generation process for split query join (step S270).

分割クエリ結合の実施場所パターン生成処理の入力として渡された図18のローカルプラン候補nextPlanを最終候補リストfinalPlanListに登録する(図15のステップS700)。次にiに1を代入する(ステップS720)。次にnextPlanでは変数iを1ずつ増やしていくが最後まで分割クエリ結合演算が存在しないのでステップS850に移る(ステップS720、S730、S830、S840)。ステップS850でfinalPlanListに登録された図18に示したローカルプラン候補2−3内において存在する演算内容がdummyの演算を削除して分割クエリ結合の実施場所パターン生成処理終了する(ステップS850)。分割クエリ結合の実施場所パターン生成処理の出力リストfinalPlanListの内容は、図19のローカルプラン候補リストとなる。   The local plan candidate nextPlan shown in FIG. 18 passed as an input for the execution location pattern generation process for split query join is registered in the final candidate list finalPlanList (step S700 in FIG. 15). Next, 1 is substituted into i (step S720). Next, in nextPlan, the variable i is incremented by 1, but since there is no split query join operation until the end, the process proceeds to step S850 (steps S720, S730, S830, S840). In step S850, the calculation content existing in the local plan candidate 2-3 shown in FIG. 18 registered in finalPlanList shown in FIG. 18 is deleted, and the split query join execution location pattern generation process ends (step S850). The content of the output list finalPlanList of the execution location pattern generation process of the split query combination is the local plan candidate list of FIG.

finalPlanList内の要素図19のローカルプラン候補2−4を出力候補プランリストoutputListに移す(ステップS290)。次にjに5を代入する(ステップS300)。nextPlanListに登録された要素数は4しかないためiに2を代入する(ステップS310、S320)。inputPlanListの要素数は1しかないためローカルプラン候補生成処理を終了する。最終的に得られたローカルプラン候補リストoutputListに登録されたローカルプラン候補は図16乃至図21である。   Element in finalPlanList The local plan candidate 2-4 in FIG. 19 is moved to the output candidate plan list outputList (step S290). Next, 5 is substituted for j (step S300). Since there are only four elements registered in nextPlanList, 2 is substituted for i (steps S310 and S320). Since the number of elements of inputPlanList is only 1, the local plan candidate generation process is terminated. The local plan candidates registered in the finally obtained local plan candidate list outputList are shown in FIGS.

図12のローカルプラン候補2では、サーバ間演算に必要な為演算番号3のデータ送信演算によって送信される変数$zとサーバ間演算と並列に実行する演算4,5によって得られる変数$u,$vを演算番号7によって計算機2で分割結合している。   In the local plan candidate 2 in FIG. 12, since it is necessary for the calculation between servers, the variable $ z transmitted by the data transmission calculation of the calculation number 3 and the variables $ u, obtained by the calculations 4 and 5 executed in parallel with the calculation between the servers. $ V is divided and combined in the computer 2 by the operation number 7.

図16に示したローカルプラン候補2−1は、図12に示したローカルプラン候補2に対し演算番号4をサーバ間演算と並列実行しないことで演算番号3のデータ送信演算において変数$zと$uを送信し、演算番号7の分割結合で$vと分割結合するようにしたローカルプラン候補である。   The local plan candidate 2-1 shown in FIG. 16 does not execute the operation number 4 in parallel with the inter-server operation for the local plan candidate 2 shown in FIG. This is a local plan candidate that transmits u and is divided and combined with $ v by the division and combination of operation number 7.

図17に示したローカルプラン候補2−2、図12に示したローカルプラン候補2に対し演算番号5をサーバ間演算と並列実行しないことで演算番号3のデータ送信演算において変数$zと$vを送信し、演算番号7の分割結合で$uと分割結合するようにしたローカルプラン候補である。   17 is not executed in parallel with the inter-server operation for the local plan candidate 2-2 shown in FIG. 17 and the local plan candidate 2 shown in FIG. , And a local plan candidate that is divided and combined with $ u by the division and combination of operation number 7.

図18に示したローカルプラン候補2−3は、図12に示したローカルプラン候補2に対し、演算番号4、5をサーバ間演算と並列実行しないことで演算番号3のデータ送信演算において変数$zと$vと$uを送信し分割結合をしないようにしたローカルプラン候補である。   The local plan candidate 2-3 shown in FIG. 18 does not execute the operation numbers 4 and 5 in parallel with the inter-server operation for the local plan candidate 2 shown in FIG. This is a local plan candidate in which z, $ v, and $ u are transmitted so as not to be divided and combined.

図19に示したローカルプラン候補2−4は、図12に示したローカルプラン候補2に対し実行場所が計算機2ではなく計算機0の場合のローカルプラン候補である。   The local plan candidate 2-4 shown in FIG. 19 is a local plan candidate when the execution location is not the computer 2 but the computer 0 with respect to the local plan candidate 2 shown in FIG.

図20に示したローカルプラン候補2−5は、図16に示したローカルプラン候補2−1に対し実行場所が計算機2ではなく計算機0の場合のローカルプラン候補である。   A local plan candidate 2-5 shown in FIG. 20 is a local plan candidate when the execution location is not the computer 2 but the computer 0 with respect to the local plan candidate 2-1 shown in FIG.

図21に示したローカルプラン候補2−6は、図17に示したローカルプラン候補2−2に対し実行場所が計算機2ではなく計算機0の場合のローカルプラン候補である。   The local plan candidate 2-6 shown in FIG. 21 is a local plan candidate when the execution location is not the computer 2 but the computer 0 with respect to the local plan candidate 2-2 shown in FIG.

以上のようにして、図12及び図16乃至図21に示したローカルプラン候補では、分割結合演算をする場合としない場合のローカルプラン候補、及び分割結合演算をする場合は分割結合する際に対象となる全ての変数の組合せと分割結合の実施場所がマスターサーバかスレーブサーバかの組合せを網羅したローカルプラン候補が生成される。   As described above, in the local plan candidates shown in FIG. 12 and FIGS. 16 to 21, the local plan candidates with and without the split / join operation, and the target when split / join when the split / join operation is performed. Local plan candidates are generated that cover all combinations of variables and combinations of whether the location of the split / join is the master server or the slave server.

ローカルプラン選択部31はこれらのローカルプラン候補の中から見積もり実行時間または見積もり実行計算量からなるコストを計算し、コストが最小となるローカルプランを選択する(ステップS8)。   The local plan selection unit 31 calculates a cost consisting of the estimated execution time or the estimated execution calculation amount from these local plan candidates, and selects a local plan that minimizes the cost (step S8).

ここで、ローカルプラン候補の見積もり実行時間算出の一例を説明する。ローカルプラン候補の見積もり実行時間は、例えば、図22に挙げた各演算の処理見積もり時間用のパラメータと、ローカルプランに含まれる演算に基づいて算出される。   Here, an example of calculating the estimated execution time of the local plan candidate will be described. The estimated execution time of the local plan candidate is calculated based on, for example, the parameters for the estimated processing time of each calculation listed in FIG. 22 and the calculation included in the local plan.

各演算のパラメータは、例えば、「数値索引:0.001msec/出力変数の件数」、「TRAVERSE:1msec/入力変数の件数」、「分割クエリ結合:1msec/入力変数の件数」、「サーバ間JOIN:1msec/入力変数の件数」、「データ送信5msec+(0.001msec/入力変数の件数)×変数の数」、「データ受信5msec+(0.001msec/入力変数の件数)×変数の数」、などである。なお、演算内容によって出力変数に格納する件数をあらかじめ設定する。   The parameters of each operation are, for example, “numerical index: 0.001 msec / number of output variables”, “TRAVERSE: 1 msec / number of input variables”, “partition query combination: 1 msec / number of input variables”, “JOIN between servers” : 1 msec / number of input variables ”,“ data transmission 5 msec + (0.001 msec / number of input variables) × number of variables ”,“ data reception 5 msec + (0.001 msec / number of input variables) × number of variables ”, etc. It is. The number of items to be stored in the output variable is set in advance according to the calculation contents.

ここで、図12に示したローカルプラン候補2における見積もり時間の算出処理の一例を以下に説明する。なお、図4から計算機2では1万件のXMLデータが登録されていることがわかるため、これにより各演算の見積もり実行時間を計算する。   Here, an example of an estimated time calculation process in the local plan candidate 2 shown in FIG. 12 will be described below. Since it can be seen from FIG. 4 that 10,000 pieces of XML data are registered in the computer 2, the estimated execution time of each calculation is calculated by this.

(1)数値索引で">="演算を利用する場合は、全体の10%がヒットすると見積もる。そのため1万件の10%で1000件ヒットすると見積もる。したがって、数値索引の見積もり計算時間は、0.001msec/出力変数の件数×1000件=1msecとなる。   (1) When using a “> =” operation in a numerical index, it is estimated that 10% of the total hits. Therefore, it is estimated that 1000 hits in 10% of 10,000 cases. Therefore, the estimated calculation time of the numerical index is 0.001 msec / number of output variables × 1000 cases = 1 msec.

(2)TRAVERSEの入力変数の件数は(1)の結果から1000件と見積もる。出力は変わらないものと想定して1000件と見積もる。したがって、TRAVERSEの見積もり計算時間は、1msec/入力変数の件数×1000件=1000msecとなる。   (2) The number of input variables of TRAVELS is estimated to be 1000 from the result of (1). Assuming that the output will not change, the number is estimated to be 1000. Therefore, the estimated calculation time of TRAVELSE is 1 msec / number of input variables × 1000 cases = 1000 msec.

(3)データ送信の入力変数の件数は、(2)の結果から1000件と見積もる。したがって、データ送信の見積もり計算時間は、5msec+0.001msec/入力変数の件数×1000× 1=6msecとなる。   (3) The number of input variables for data transmission is estimated to be 1000 from the result of (2). Therefore, the estimated calculation time for data transmission is 5 msec + 0.001 msec / number of input variables × 1000 × 1 = 6 msec.

(4)TRAVERSEの入力変数の件数は(2)の結果から1000件と見積もる。出力は変わらないものと想定して1000件と見積もる。したがって、TRAVERSEの見積もり計算時間は、1msec/入力変数の件数×1000件=1000msecとなる。   (4) The number of input variables of TRAVERS is estimated to be 1000 from the result of (2). Assuming that the output will not change, the number is estimated to be 1000. Therefore, the estimated calculation time of TRAVELSE is 1 msec / number of input variables × 1000 cases = 1000 msec.

(5)TRAVERSEの入力変数の件数は(4)の結果から1000件と見積もる。出力は変わらないものと想定して1000件と見積もる。したがって、TRAVERSEの見積もり計算時間は、1msec/入力変数の件数×1000件=1000msecとなる。   (5) The number of input variables of TRAVERS is estimated to be 1000 from the result of (4). Assuming that the output will not change, the number is estimated to be 1000. Therefore, the estimated calculation time of TRAVELSE is 1 msec / number of input variables × 1000 cases = 1000 msec.

(6)データ受信の入力変数の件数は、マスターサーバでサーバ間JOINが実行されて40%に削減されて400件と見積もる。したがって、データ受信の見積もり計算時間は、5msec+0.001msec/入力変数の件数×400× 1≒6msecとなる。   (6) The number of input variables for data reception is estimated to be 400, which is reduced to 40% by executing the server-to-server JOIN on the master server. Therefore, the estimated calculation time for data reception is 5 msec + 0.001 msec / number of input variables × 400 × 1≈6 msec.

(7)分割クエリ結合の入力件数は(5),(6)から計1400件と見積もる。したがって、分割クエリ結合の見積もり計算時間は、1msec/入力変数の件数×1400件=1400msecとなる。   (7) The number of input queries for split query is estimated to be 1400 in total from (5) and (6). Therefore, the estimated calculation time for the split query combination is 1 msec / number of input variables × 1400 cases = 1400 msec.

(8)(3)でマスターサーバへデータ送信後、マスターサーバでは図11の分散プランの演算番号10のサーバ間JOINが実行される。ここではサーバ間JOINの見積もり計算時間は、分散プラン生成部13でローカルプラン候補の見積もり計算時間と同様の考え方で計算された後、スレーブサーバに分散プランと共に送られているものとする。分散プラン生成部13では、サーバ間JOINの入力件数は各スレーブサーバの登録データ数の1/3程度と仮定して計算する。したがって、サーバ間JOINの見積もり時間は1msec/入力変数の件数×11250件÷3=3750msecとなる。   (8) After data transmission to the master server in (3), the master server executes the server-to-server JOIN with the operation number 10 in the distributed plan of FIG. Here, it is assumed that the estimated calculation time of the server-to-server JOIN is calculated by the distributed plan generation unit 13 in the same way as the estimated calculation time of the local plan candidate, and then sent to the slave server together with the distributed plan. The distributed plan generation unit 13 calculates the number of input JOINs between servers on the assumption that the number of registered data of each slave server is about 1/3. Therefore, the estimated time for JOIN between servers is 1 msec / number of input variables × 11250/3 = 3750 msec.

なお、図11において、分割クエリ結合演算追加部14により演算番号10のサーバ間JOINと並列に実行可能な演算として挙げられた、演算番号4,5のサーバ内演算は、ローカルプラン候補2の演算番号4,5のTRAVERSEに該当する。このため演算番号4,5と、演算番号3,6及びサーバ間JOINは並行して実施することが分かるので、ローカルプラン候補2の見積もり時間は以下の2つの見積もり時間の長い方になる。   In FIG. 11, the intra-server operations of operation numbers 4 and 5, which are listed as operations that can be executed in parallel with the inter-server JOIN of operation number 10 by the divided query join operation addition unit 14, are the operations of the local plan candidate 2. It corresponds to TRAVERSE of numbers 4 and 5. For this reason, it can be seen that the operation numbers 4 and 5, the operation numbers 3 and 6, and the inter-server JOIN are executed in parallel, so the estimated time of the local plan candidate 2 is the longer of the following two estimated times.

(1)+(2)+(3)+(8)+(6)+(7)=6163msec
(1)+(2)+(4)+(5)+(7)=4401msec
結果として6163msecと見積もる。
(1) + (2) + (3) + (8) + (6) + (7) = 6163 msec
(1) + (2) + (4) + (5) + (7) = 4401 msec
As a result, it is estimated to be 6163 msec.

別の例としてローカルプラン候補2−3を計算機2で実行する際は全処理が並列に実行できないので、見積もり時間は、(1)、(2)、(3)、(4)、および(5)の演算とサーバ間JOINを合わせたものになる。すなわち、
1msec+1000msec+1000msec+1000msec+6msec+3750msec=6757msec
となりローカルプラン候補2の方がサーバ間JOINを含めると速くなると計算される。このようにローカルプラン候補の見積もり計算時間に、マスターサーバで実行するサーバ間演算の見積もり時間も加えることで、分割クエリ結合演算追加部で追加した分割クエリ結合による最適化が有効かを判断できる。
As another example, when the local plan candidate 2-3 is executed by the computer 2, since all the processes cannot be executed in parallel, the estimated times are (1), (2), (3), (4), and (5 ) And the server-to-server JOIN. That is,
1 msec + 1000 msec + 1000 msec + 1000 msec + 6 msec + 3750 msec = 6757 msec
It is calculated that the local plan candidate 2 is faster when including the server-to-server JOIN. In this way, by adding the estimated time of the inter-server calculation executed on the master server to the estimated calculation time of the local plan candidate, it is possible to determine whether the optimization by the divided query combination added by the divided query join calculation adding unit is effective.

本実施形態では、計算機1は図18に示すローカルプラン候補2−3を、計算機2は図12に示すローカルプラン候補2を、計算機3は図19に示すローカルプラン候補2−4をそれぞれローカルプランとして選んだものとする。   In the present embodiment, the computer 1 is a local plan candidate 2-3 shown in FIG. 18, the computer 2 is a local plan candidate 2 shown in FIG. 12, and the computer 3 is a local plan candidate 2-4 shown in FIG. As chosen.

各計算機のローカルプラン選択部31は、選択したローカルプランをマスターサーバの分散プラン更新部15に送信する。ローカルプラン選択部31が、選択したローカルプランを分散プラン更新部15に送信すると、スレーブサーバは、対象のローカルプランを実行する(ステップS9)。   The local plan selection unit 31 of each computer transmits the selected local plan to the distributed plan update unit 15 of the master server. When the local plan selection unit 31 transmits the selected local plan to the distributed plan update unit 15, the slave server executes the target local plan (step S9).

スレーブサーバの行うステップS9と並行して、ローカルプランを受信したマスターサーバの分散プラン更新部15は分散プラン更新処理を行う(ステップS10)。   In parallel with step S9 performed by the slave server, the distributed plan update unit 15 of the master server that has received the local plan performs distributed plan update processing (step S10).

ここで、マスターサーバの分散プラン更新部15が、図11の分散プランに対し、計算機1、計算機2、計算機3がそれぞれ図18、図12、図19のローカルプラン候補を選んだ場合に、図23のフローチャートに従って分散プランの更新を行う場合の分散プラン更新処理について説明する。なお、この分散プラン更新処理はiという変数を用いる。iは1以上であり、かつ、対象のスレーブサーバ数以下である(1≦i≦スレーブサーバ数)。   Here, when the distributed plan update unit 15 of the master server selects the local plan candidates shown in FIGS. 18, 12, and 19 for the distributed plan shown in FIG. The distributed plan update process when the distributed plan is updated according to the flowchart of FIG. This distributed plan update process uses a variable i. i is 1 or more and less than or equal to the number of target slave servers (1 ≦ i ≦ number of slave servers).

処理の開始時点ではi=1である。また、スレーブサーバ数=maxとする(ステップS900)。   I = 1 at the start of the process. Further, the number of slave servers = max is set (step S900).

分散プラン更新部15は、計算機番号iのローカルプランLPlanを取得する(ステップS910)。次に分散プランとローカルプランの分割クエリ結合に関する差分をチェックする(ステップS920)。差分チェックによりLPlanでは分割クエリ結合が完全に削除されているかを判定する(ステップS930)。   The distributed plan update unit 15 acquires the local plan LPlan for the computer number i (step S910). Next, the difference regarding the split query combination between the distributed plan and the local plan is checked (step S920). Based on the difference check, the LPlan determines whether the split query combination is completely deleted (step S930).

LPlanで分割クエリ結合が完全に削除されていた場合(ステップS930がYes)、分散プランにある分割クエリ結合及びその前後にあるデータ送信演算、データ受信演算の実行場所から計算機iを削除する(ステップS940)。次に削除した結果分割クエリ結合演算の実行場所が空かを判定する(ステップS950)。   If the split query join is completely deleted in LPlan (step S930 is Yes), the computer i is deleted from the execution place of the split query join in the distributed plan and the data transmission operation and the data reception operation before and after that (step S930). S940). Next, it is determined whether the execution location of the deleted result divided query join operation is empty (step S950).

分割クエリ結合演算の実行場所が空の場合(ステップS950がYes)、分散プランにある分割クエリ結合及びその前後にあるデータ送信演算、データ受信演算を削除する(ステップS960)。次に、ステップS970に進む。   If the execution location of the split query join operation is empty (step S950 is Yes), the split query join in the distributed plan, the data transmission operation and the data reception operation before and after that are deleted (step S960). Next, the process proceeds to step S970.

また分割クエリ結合演算の実行場所が空でない場合(ステップS950がNo)、ステップS970に進む。さらにLPlanで分割クエリ結合が完全に削除されていない場合(ステップS930がNo)、ステップS970に進む。すなわちステップS970の処理は、ステップS930がNoの場合、もしくはステップS950がNoの場合、もしくはステップS960に続いて行われる。ステップS970では、LPlanで分割クエリ結合の実行場所が変更されたかを判定する。   If the execution location of the split query join operation is not empty (No in step S950), the process proceeds to step S970. Further, when the split query combination is not completely deleted in LPlan (step S930 is No), the process proceeds to step S970. That is, the process of step S970 is performed when step S930 is No, when step S950 is No, or after step S960. In step S970, it is determined whether the execution location of the split query combination is changed in LPlan.

LPlanで分割クエリ結合の実行場所が変更された場合(ステップS970がYes)、分散プランにある分割クエリ結合、その前後にあるデータ送信演算、およびデータ受信演算の実行場所から計算機iを削除する(ステップS980)。次に削除した結果分割クエリ結合演算の実行場所が空かを判定する(ステップS990)。   When the execution location of the split query join is changed in LPlan (step S970 is Yes), the computer i is deleted from the execution location of the split query join in the distributed plan, the data transmission operation before and after that, and the data reception operation ( Step S980). Next, it is determined whether or not the execution location of the deleted result divided query join operation is empty (step S990).

分割クエリ結合演算の実行場所が空の場合(ステップS990がYes)、分散プランにある分割クエリ結合及びその前後にあるデータ送信演算、データ受信演算を削除する(ステップS1000)。次に、ステップS990に進む。   When the execution location of the split query join operation is empty (Yes in step S990), the split query join in the distributed plan, the data transmission operation and the data reception operation before and after that are deleted (step S1000). Next, the process proceeds to step S990.

また分割クエリ結合演算の実行場所が空でない場合(ステップS990がNo)、ステップS1010に進む。すなわちステップS1010の処理はステップS990がNoの場合もしくはステップS1000に続いて行われる。ステップS1010ではLPlanの実行場所を変更した分割クエリ結合が分散プラン内に既に存在するかを判定する。   If the execution location of the split query join operation is not empty (No in step S990), the process proceeds to step S1010. That is, the process of step S1010 is performed when step S990 is No or subsequent to step S1000. In step S1010, it is determined whether a split query combination in which the execution location of LPlan has been changed already exists in the distributed plan.

LPlanの実行場所を変更した分割クエリ結合が分散プラン内に既に存在しない場合(ステップS1010がNo)、実行場所を変更した分割クエリ結合、及びその前後にあるデータ送信、データ受信の演算を分散プランに追加する(ステップS1030)。次にステップS1040に進む。   If the split query join whose LPlan execution location has been changed does not already exist in the distributed plan (No in step S1010), the split query join whose execution location has been changed, and the data transmission and data reception operations before and after the split query join are distributed plan. (Step S1030). Next, the process proceeds to step S1040.

またLPlanの実行場所を変更した分割クエリ結合が分散プラン内に既に存在する場合(ステップS1010がNo)、実行場所に計算機iを追加する(ステップS1020)。次にステップS1040に進む。   If a split query combination whose LPlan execution location has been changed already exists in the distributed plan (No in step S1010), the computer i is added to the execution location (step S1020). Next, the process proceeds to step S1040.

さらにLPlanで分割クエリ結合の実行場所が変更なかった場合(ステップS970がNo)、ステップS1040に進む。すなわちステップS1040の処理はステップS970がNoの場合、またはステップS1020に続いて、またはステップS1030に続いて行われる。ステップS1040ではiにi+1を代入する(i:=i+1)(ステップS1040)。   Further, when the execution location of the split query combination is not changed in LPlan (No in step S970), the process proceeds to step S1040. That is, the process of step S1040 is performed when step S970 is No, subsequent to step S1020, or subsequent to step S1030. In step S1040, i + 1 is substituted for i (i: = i + 1) (step S1040).

次にiがmax以下かを判定する(ステップS1050)。iがmax以下の場合(ステップS1050がYes)、ステップS910に戻り処理を繰り返す。iがmaxより大きい場合は終了する。   Next, it is determined whether i is equal to or less than max (step S1050). When i is less than or equal to max (step S1050 is Yes), the process returns to step S910 and is repeated. If i is larger than max, the process ends.

図11に示した分散プランに対して、計算機1、2、3のローカルプランがそれぞれローカルプラン候補2−3、ローカルプラン候補2、ローカルプラン候補2−4の場合において、上述した分散プラン更新処理が行われた結果、得られる分散プランを図24に示す。   With respect to the distributed plan shown in FIG. 11, when the local plans of the computers 1, 2, and 3 are the local plan candidate 2-3, the local plan candidate 2, and the local plan candidate 2-4, respectively, the distributed plan update process described above is performed. FIG. 24 shows a dispersion plan obtained as a result of the above.

図24に示した分散プラン3は、「演算番号」312、「部分クエリ番号」313、「演算内容」314、「事前実行演算番号」315、「実行場所」316、「送信場所」317、「入力変数」318、「出力変数」319の項目を有する。この分散プラン3は有する項目312乃至319は、分散プランテーブル141の有する項目142乃至149及びローカルプラン候補2、2−1乃至2−6が有する項目302乃至309と同一である。   The distribution plan 3 shown in FIG. 24 includes “operation number” 312, “partial query number” 313, “operation content” 314, “pre-execution operation number” 315, “execution location” 316, “transmission location” 317, “ It has items of “input variable” 318 and “output variable” 319. The items 312 to 319 included in the distribution plan 3 are the same as the items 142 to 149 included in the distribution plan table 141 and the items 302 to 309 included in the local plan candidates 2, 2-1 to 2-6.

まずiに1を代入して、計算機1の選択したローカルプランであるローカルプラン候補2−3と図11の分散プランの分割クエリ結合に関する差分をチェックする(ステップS900、S910、S920)。ローカルプラン候補2−3では、計算機1の分割クエリ結合は完全に削除されているため、図11の分散プランの分割クエリ結合及びその前後にあるデータ送信、データ受信演算(図24の演算番号11−15)の実行場所から計算機1を削除する(ステップS940)。   First, 1 is assigned to i, and the difference regarding the split query combination between the local plan candidate 2-3, which is the local plan selected by the computer 1, and the distributed plan of FIG. 11 is checked (steps S900, S910, S920). In the local plan candidate 2-3, since the split query combination of the computer 1 is completely deleted, the split query combination of the distributed plan of FIG. 11 and the data transmission and data reception operations before and after that (operation number 11 of FIG. 24). -15), the computer 1 is deleted from the execution location (step S940).

次に、分散プラン更新部15は分割クエリ結合の実行場所は空ではないため、ローカルプラン候補2−3をチェックして分割クエリ結合の実行場所が変更されていないかチェックする(ステップS950、S970)。実行場所は変更されていないため、iに2を代入する(ステップS1040、S1050)。   Next, since the execution location of the split query join is not empty, the distributed plan update unit 15 checks the local plan candidate 2-3 to check whether the execution location of the split query join has been changed (Steps S950 and S970). ). Since the execution location has not been changed, 2 is substituted for i (steps S1040 and S1050).

次にiが2として図11の分散プランと、計算機2の選択したローカルプランであるローカルプラン候補2とにおける分割クエリ結合に関する差分をチェックする(ステップS920)。図12に示したローカルプラン候補2は、計算機2の分割クエリ結合は削除もされず、実行場所も変わらないため、iに3を代入する(ステップS930、S970、S1040、S1050)。   Next, i is set to 2, and the difference regarding the split query combination between the distributed plan of FIG. 11 and the local plan candidate 2 which is the local plan selected by the computer 2 is checked (step S920). In the local plan candidate 2 shown in FIG. 12, since the split query combination of the computer 2 is not deleted and the execution location is not changed, 3 is substituted for i (steps S930, S970, S1040, and S1050).

次にiが3として図11の分散プランと計算機3の選択したローカルプランであるローカルプラン候補2−4の分割クエリ結合に関する差分をチェックする(ステップS920)。ローカルプラン候補2−4は、計算機3の分割クエリ結合は削除されていないため、次に分割クエリ結合の実行場所が変更されているかをチェックする(ステップS930、S970)。   Next, i is set to 3, and the difference regarding the split query combination between the distributed plan of FIG. 11 and the local plan candidate 2-4 which is the local plan selected by the computer 3 is checked (step S920). Since the local query candidate 2-4 has not deleted the split query join of the computer 3, it next checks whether the execution location of the split query join has been changed (steps S930 and S970).

また、ローカルプラン候補2−4は、分割クエリ結合の実行場所が変更されているため、分散プランの分割クエリ結合及びその前後にあるデータ送信、データ受信演算(図24の演算番号11−15)の実行場所から計算機3を削除する(ステップS980)。分割クエリ結合の実行場所は空ではないため、分散プラン更新部15は、次に実行場所を変更した分割クエリ結合が分散プランに挿入されているかを確認する(ステップS980、S1010)。分散プランには挿入されていないため、実行場所を変更した分割クエリ結合及びその前後にあるデータ送信、データ受信演算を分散プランに挿入する(図24の演算番号14、15、16)(ステップS1030)。次にiに4を代入するが、計算機数は3までなので処理を終了する(ステップS1040、S1050)。最終的に図24の分散プラン3が得られる。   In addition, since the execution location of the split query join is changed in the local plan candidate 2-4, the split query join of the distributed plan and the data transmission and data reception calculations before and after the split query join (operation numbers 11-15 in FIG. 24) The computer 3 is deleted from the execution location (step S980). Since the execution location of the split query join is not empty, the distributed plan update unit 15 confirms whether the split query join whose execution location has been changed next is inserted in the distributed plan (steps S980 and S1010). Since it is not inserted in the distributed plan, the split query combination whose execution location has been changed and the data transmission and data reception operations before and after that are inserted into the distributed plan (operation numbers 14, 15, and 16 in FIG. 24) (step S1030). ). Next, 4 is substituted for i. Since the number of computers is up to 3, the processing is terminated (steps S1040 and S1050). Finally, the distribution plan 3 of FIG. 24 is obtained.

分散プラン実行部16は、分散プラン3の演算を実行する(図6のステップS11)。なお、分散プラン3の実行と、スレーブサーバのローカルプラン実行部33の実行とは、お互いデータの送受信で依存関係にあり、例えば並列に実行したり、相手からデータが送信されるのを待ったりする。すなわち、マスターサーバの送受信部17とスレーブサーバの送受信部34とがデータのやり取りを行いながら分散プランは実行される。   The distributed plan execution unit 16 executes the calculation of the distributed plan 3 (step S11 in FIG. 6). The execution of the distributed plan 3 and the execution of the local plan execution unit 33 of the slave server are dependent on each other in data transmission / reception. For example, they are executed in parallel or waiting for data to be transmitted from the other party. To do. That is, the distributed plan is executed while data is exchanged between the transmission / reception unit 17 of the master server and the transmission / reception unit 34 of the slave server.

上述したように、本実施形態によれば、ユーザによってマスターサーバに入力された問合せクエリに対して、マスターサーバは部分クエリの結合処理を除いたサーバ間演算に関連する部分の最適化のみを実施し、部分クエリの結合の最適化はスレーブサーバが実施する。すなわち、マスターサーバは部分クエリの結合処理を最適化の範囲から除外することが可能となるため、全てをマスターサーバ側で最適化する場合と比較して単純な仕組みで実現することが可能となる。   As described above, according to the present embodiment, for the query query input to the master server by the user, the master server performs only the optimization of the portion related to the inter-server operation excluding the join processing of the partial queries. However, the slave server performs optimization of partial query joins. In other words, since the master server can exclude partial query join processing from the scope of optimization, it can be realized with a simple mechanism as compared with the case where everything is optimized on the master server side. .

すなわち、マスターサーバはスレーブサーバが決定する部分クエリの結合処理に依存しない形で部分クエリの結合処理を仮に決定する。スレーブサーバは、サーバ毎のデータベース情報に基づいて部分クエリの結合処理を最適化する。さらに、マスターサーバは、スレーブサーバがこの部分クエリの結合処理の結果をマスターサーバに通知することよって、効率の良い分散プランを生成する。また、分割クエリ結合演算に関してスレーブサーバ側が最適化するため、各スレーブサーバに適した効率のよいプランの生成が可能となる。   That is, the master server tentatively determines the partial query join processing without depending on the partial query join processing determined by the slave server. The slave server optimizes the partial query join processing based on the database information for each server. Further, the master server generates an efficient distributed plan by the slave server notifying the master server of the result of the join processing of the partial query. In addition, since the slave server side optimizes the split query join operation, an efficient plan suitable for each slave server can be generated.

したがって、本発明の実施形態によれば、問合せクエリ51について、マスターサーバが決定する分散プランの範囲から、分割クエリ結合演算に関する演算を取り除くことで、マスターサーバの分散プラン最適化の仕組みを簡素化した上で、スレーブサーバが各々に最適な形で上記の範囲の最適化を実施する。これにより、効率的なクエリ処理を実現することが可能となる。   Therefore, according to the embodiment of the present invention, for the query query 51, by removing the operation related to the split query join operation from the range of the distributed plan determined by the master server, the mechanism for optimizing the distributed plan of the master server is simplified. After that, the slave server performs the optimization in the above range in an optimal manner for each. Thereby, efficient query processing can be realized.

(第2の実施形態)
第2の実施形態の分散データベース検索装置について図面を参照して説明する。なお、第1の実施形態の分散データベース検索装置と同一の構成には同一の符号を付し、説明は省略する。
(Second Embodiment)
A distributed database search apparatus according to a second embodiment will be described with reference to the drawings. In addition, the same code | symbol is attached | subjected to the structure same as the distributed database search device of 1st Embodiment, and description is abbreviate | omitted.

図25は、第2の実施形態の分散データベース検索装置の機能構成を示す構成図である。図25に示すように、本実施形態の分散データベース検索装置は、図1に示した分散データベース検索装置の構成にスキーマ生成部18、35とスキーマ変更部19、36をさらに有する構成である。   FIG. 25 is a configuration diagram illustrating a functional configuration of the distributed database search device according to the second embodiment. As shown in FIG. 25, the distributed database search device of the present embodiment is configured to further include schema generation units 18 and 35 and schema change units 19 and 36 in the configuration of the distributed database search device shown in FIG.

スキーマとは格納するデータの種類や位置情報を保持するものデータの構造のことである。   A schema is a data structure that holds the type and position information of data to be stored.

スキーマ生成部18、35は各サーバにおいて行われる演算の結果、入出力されるデータのスキーマを生成する。例えば、マスターサーバが備えるスキーマ生成部18は、分散プランの各演算の入出力データのスキーマを生成する。また、スレーブサーバが備えるスキーマ生成部35は、ローカルプランの各演算の入出力データのスキーマを生成する。   The schema generation units 18 and 35 generate schemas of input and output data as a result of operations performed in each server. For example, the schema generation unit 18 included in the master server generates an input / output data schema for each operation of the distributed plan. Further, the schema generation unit 35 provided in the slave server generates a schema of input / output data of each calculation of the local plan.

スキーマ変更部19、36は、分散プランまたはローカルプランの各演算によって得られたデータを次の演算に渡す際に、当該データのスキーマを変更する。マスターサーバのスキーマ変更部19は、分散プランまたはローカルプランの各演算の出力によって得られたデータを、分散プランの次の演算の入力に渡す際にデータのスキーマを変更する。スレーブサーバのスキーマ変更部36は、分散プランまたはローカルプランの各演算の出力によって得られたデータを、ローカルプランの次の演算に渡す際に、当該データのスキーマを変更する。   The schema changing units 19 and 36 change the schema of the data when passing the data obtained by each calculation of the distributed plan or the local plan to the next calculation. The schema change unit 19 of the master server changes the data schema when passing the data obtained by the output of each operation of the distributed plan or the local plan to the input of the next operation of the distributed plan. The schema change unit 36 of the slave server changes the schema of the data when passing the data obtained by the output of each operation of the distributed plan or the local plan to the next operation of the local plan.

ここで、図26に本実施形態におけるスキーマ変更部19によって変更される前のスキーマに含まれる項目の一例を示す。変更される前のスキーマとは、すなわち後述するスキーマ生成部18によって生成されるスキーマである。スキーマとは格納するデータの種類や位置情報を保持するものであり、図26に示すように本実施形態では、「可変領域」401と、「変数〜」402−i(iは1以上の整数)と「拡張変数$#e(V1・・・,Vn)」403の項目を有する。   Here, FIG. 26 shows an example of items included in the schema before being changed by the schema changing unit 19 in the present embodiment. The schema before being changed is a schema generated by the schema generation unit 18 described later. The schema holds the type and position information of data to be stored. As shown in FIG. 26, in this embodiment, “variable area” 401 and “variable˜” 402-i (i is an integer of 1 or more). ) And “extended variable $ # e (V1..., Vn)” 403.

「拡張変数$#e(V1,・・・,Vn)」403の「$#e」は「変数〜」402−iの「〜」に一致しない一意の文字列が入り、「(V1,・・・,Vn)」には「,」で区切られたn個の一意になる任意の文字列が入る。「可変領域」401とはサーバ間でデータを送る際にカラム数の違いを吸収するためのデータを格納する項目である。「変数〜」402−iは各変数のデータを格納する項目で「拡張変数$#e(V1,・・・,Vn)」403は変数「V1」から変数「Vn」の全変数のデータを格納する項目である。なお、「変数〜」402−iは入出力されるデータ毎にさまざまな変数が格納される。   “$ # E” of “extended variable $ # e (V1,..., Vn)” 403 contains a unique character string that does not match “~” of “variable˜” 402-i, and “(V1,. .., Vn) ”includes n unique character strings separated by“, ”. The “variable area” 401 is an item for storing data for absorbing the difference in the number of columns when data is transmitted between servers. “Variable˜” 402-i is an item for storing data of each variable, and “Extended variable $ # e (V1,..., Vn)” 403 is data of all variables from variable “V1” to variable “Vn”. The item to store. Note that “variable˜” 402-i stores various variables for each input / output data.

ここで、図27を参照して、本実施形態の分散データベース検索装置の検索処理の一例について説明する。図27は、本実施形態の分散データベース検索装置の検索処理の一例を示すフローチャートである。なお、ステップS1至S8及び,S10の処理については図6に示したフローチャートと同じであるため説明を割愛する。   Here, with reference to FIG. 27, an example of the search processing of the distributed database search device of this embodiment will be described. FIG. 27 is a flowchart showing an example of search processing of the distributed database search device of this embodiment. Note that the processing of steps S1 to S8 and S10 is the same as that in the flowchart shown in FIG.

ローカルプラン選択部37は、図27のステップS1−S8でローカルプランを決定した後、決定したローカルプランに実行順序が非決定的な部分を確定するローカルプラン順序決定処理を実施する(ステップS12)。ここで、実行順序が非決定的な部分とはローカルプランの各演算の事前実行番号が等しい演算の集合である。これらの演算はどの順序で実行するかの指定がないため任意の順序で実行可能である。すなわち、ローカルプラン順序決定処理によって、でこれらの演算の実行順序を一意に決定される。   After determining the local plan in steps S1 to S8 in FIG. 27, the local plan selection unit 37 performs a local plan order determination process for determining a portion in which the execution order is non-deterministic in the determined local plan (step S12). Here, the portion whose execution order is non-deterministic is a set of operations in which the prior execution numbers of the operations in the local plan are equal. Since these operations are not specified in any order, they can be executed in any order. That is, the execution order of these operations is uniquely determined by the local plan order determination process.

図28に、図12で示したローカルプラン候補2がローカルプラン順序決定処理(ステップS12)により非決定的な演算集合の順序を一意に決定された結果を示す。図12に示したローカルプラン候補2では演算番号2、4、5の各演算の事前実行番号は1であり実行順序が非決定的である。図29では演算番号2、4、5の順序で実行するように決定し、演算番号4の事前実行番号を1から2、演算番号5の事前実行番号を1から4に書き換えている。   FIG. 28 shows a result of the local plan candidate 2 shown in FIG. 12 having the non-deterministic operation set order uniquely determined by the local plan order determination process (step S12). In the local plan candidate 2 shown in FIG. 12, the prior execution number of each operation of operation numbers 2, 4, and 5 is 1, and the execution order is non-deterministic. In FIG. 29, the execution numbers are determined to be executed in the order of operation numbers 2, 4, and 5, and the pre-execution number of operation number 4 is rewritten from 1 to 2, and the pre-execution number of operation number 5 is rewritten from 1 to 4.

ステップS12におけるローカルプラン順序決定処理後、演算の順序が決定されたローカルプランは送信部34によってマスターサーバに送信される。マスターサーバは当該ローカルプランを受信すると、分散プラン更新部10が分散プラン更新処理を行う(ステップS10)。ステップS10と並行して、スレーブサーバのスキーマ生成部35が、当該ローカルプラン内の各演算の入力スキーマおよび出力スキーマ(以下、入出力スキーマという)を生成する(ステップS14)。入力スキーマとは、入力されるデータのスキーマである。出力スキーマとは演算で出力されるデータのスキーマである。   After the local plan order determination process in step S12, the local plan whose operation order has been determined is transmitted to the master server by the transmission unit 34. When the master server receives the local plan, the distributed plan update unit 10 performs distributed plan update processing (step S10). In parallel with step S10, the schema generation unit 35 of the slave server generates an input schema and an output schema (hereinafter referred to as an input / output schema) for each operation in the local plan (step S14). The input schema is a schema of input data. The output schema is a schema of data output by calculation.

ここで図29を参照して、スキーマ生成部35が、図28に示したローカルプランに対して、スキーマ生成処理(ステップS14)を行う際の動作について具体的に説明する。   Here, with reference to FIG. 29, the operation | movement at the time of the schema production | generation part 35 performing a schema production | generation process (step S14) with respect to the local plan shown in FIG. 28 is demonstrated concretely.

なお、このスキーマ生成処理ではiという変数を用いる。iは1以上の整数であり、対象のローカルプランの演算番号以下である(1≦i≦ローカルプランの演算番号の最大値)。また、スキーマ生成処理の開始時点ではi=1である。また、ローカルプランの演算番号の最大値を「max」とする。また、演算番号301がiのローカルプランの演算を演算Sとする。   In this schema generation process, a variable i is used. i is an integer of 1 or more and is equal to or smaller than the operation number of the target local plan (1 ≦ i ≦ maximum value of the operation number of the local plan). Also, i = 1 at the start of the schema generation process. In addition, the maximum value of the operation number of the local plan is “max”. In addition, the calculation of the local plan whose calculation number 301 is i is defined as calculation S.

スキーマ生成部35は、ローカルプラン選択部31からローカルプランを受信すると、まず、初期化処理としてi=1、ローカルプランの演算番号の最大値=maxとする(ステップS1110)。次に、iがmax以下であるか否かを判定する(ステップS1110)。   When receiving the local plan from the local plan selection unit 31, the schema generation unit 35 first sets i = 1 as the initialization process and sets the maximum value of the local plan operation number = max (step S1110). Next, it is determined whether i is equal to or less than max (step S1110).

iがmax以下である場合(ステップS1110がYes)、演算番号iの演算Sを取得する(ステップS1120)。次に演算Sに出力変数があるかを判定する(ステップS1130)。   If i is less than or equal to max (step S1110 is Yes), the calculation S of the calculation number i is acquired (step S1120). Next, it is determined whether or not the operation S has an output variable (step S1130).

演算Sに出力変数がある場合(ステップS1130がYes)、演算Sの出力変数を出力スキーマと変数リストVLに追加する。さらに変数毎に到達番号リストRLと利用番号リストULを用意する(ステップS1140)。次に各演算の事前実行番号から、演算Sと演算Sより後に実行される演算番号のリストALを取得する(ステップS1150)。次に、演算Sの各出力変数に対して、変数毎に用意した到達演算番号リストRLにリストALに格納された演算番号を登録する(ステップS1160)。その後ステップS1170に進む。なお、演算Sに出力変数がない場合(ステップS1130がNo)もステップS1170に進む。   If there is an output variable in the operation S (Yes in step S1130), the output variable of the operation S is added to the output schema and the variable list VL. Further, an arrival number list RL and a usage number list UL are prepared for each variable (step S1140). Next, a list AL of operation numbers to be executed after the operation S and the operation S is obtained from the prior execution numbers of the operations (step S1150). Next, for each output variable of the operation S, the operation numbers stored in the list AL are registered in the arrival operation number list RL prepared for each variable (step S1160). Thereafter, the process proceeds to step S1170. Note that if the calculation S has no output variable (No in step S1130), the process also proceeds to step S1170.

ステップS1170では演算Sに入力変数があるかを判定する(ステップS1170)。   In step S1170, it is determined whether there is an input variable in operation S (step S1170).

演算Sに入力変数がある場合(ステップS1170がYes)、演算Sの事前実行演算番号を辿り、演算Sより前に実行される演算番号のリストBLを取得する(ステップS1180)。次に演算Sの各入力変数に対して、変数毎に用意した利用演算番号リストULにリストBLに格納された演算番号を登録する(ステップS1200)。その後ステップS1210に進む。なお、演算Sに入力変数がない場合(ステップS1170がNo)もステップS1210に進む。   When there is an input variable in the operation S (step S1170 is Yes), the pre-execution operation number of the operation S is traced, and a list BL of operation numbers executed before the operation S is acquired (step S1180). Next, the operation numbers stored in the list BL are registered in the use operation number list UL prepared for each variable for each input variable of the operation S (step S1200). Thereafter, the process proceeds to step S1210. Note that if the calculation S has no input variable (No in step S1170), the process also proceeds to step S1210.

ステップS1210ではiにi+1を代入する(i:=i+1)(ステップS1210)。次にステップS1110に戻る。   In step S1210, i + 1 is substituted for i (i: = i + 1) (step S1210). Next, the process returns to step S1110.

iがmaxより大きい場合(ステップS1110がNo)、ステップS1220に進む。   If i is greater than max (No in step S1110), the process proceeds to step S1220.

ここで、jという変数を用いる。jは1以上であり、かつ、変数リストVL内の要素数以下である(1≦j≦VL内の要素数)。また、この時j=1であり、VL内の要素数=vmaxとする(ステップS1220)。次に、jがvmax以下であるか否かを判定する(ステップS1230)。   Here, a variable called j is used. j is 1 or more and less than or equal to the number of elements in the variable list VL (1 ≦ j ≦ number of elements in VL). At this time, j = 1 and the number of elements in the VL = vmax (step S1220). Next, it is determined whether j is equal to or less than vmax (step S1230).

jがvmax以下である場合(ステップS1230がYes)、変数リストVLからj番目の変数varを取得する(ステップS1240)。次に変数varの到達演算番号リストRLと利用番号リストULに共通して出現する演算番号リストCLを取得する(ステップS1250)。次にリストCL内の演算番号の各演算の出力スキーマに変数varを追加する(ステップS1260)。次にjにj+1を代入する(j:=j+1)(ステップS1270)。次にステップS1230に戻る。   If j is equal to or less than vmax (step S1230 is Yes), the j-th variable var is acquired from the variable list VL (step S1240). Next, the operation number list CL that appears in common in the reaching operation number list RL and the usage number list UL of the variable var is acquired (step S1250). Next, a variable var is added to the output schema of each operation of the operation number in the list CL (step S1260). Next, j + 1 is substituted for j (j: = j + 1) (step S1270). Next, the process returns to step S1230.

jがvmaxより大きい場合(ステップS1230がNo)、iに1を代入する(i:=1)(ステップS1280)。次に、iがmax以下であるか否かを判定する(ステップS1290)。   If j is greater than vmax (No in step S1230), 1 is substituted for i (i: = 1) (step S1280). Next, it is determined whether i is equal to or less than max (step S1290).

iがmax以下である場合(ステップS1290がYes)、演算番号iの演算Sを取得する(ステップS1300)。次に演算Sの入力スキーマに事前実行演算番号の演算の出力スキーマをコピーする(ステップS1310)。次に演算Sの出力スキーマの先頭に可変領域を、最後尾に拡張変数$#e()を追加する(ステップS1320)。次にiにi+1を代入する(i:=i+1)(ステップS1330)。次にステップS1290に戻る。   When i is less than or equal to max (step S1290 is Yes), the calculation S of the calculation number i is acquired (step S1300). Next, the operation output schema of the pre-execution operation number is copied to the operation S input schema (step S1310). Next, the variable area is added to the head of the output schema of the operation S, and the extension variable $ # e () is added to the tail (step S1320). Next, i + 1 is substituted for i (i: = i + 1) (step S1330). Next, the process returns to step S1290.

iがmaxより大きい場合(ステップS1290がNo)、処理を終了する。なお、図29で示したフローチャートは、スレーブサーバのスキーマ生成部18におけるスキーマ生成処理S15においても対象がローカルプランであるか分散プランであるかの違いのみで同様に動作する。   If i is greater than max (No in step S1290), the process ends. Note that the flowchart shown in FIG. 29 operates in the same way only in the schema generation process S15 in the schema generation unit 18 of the slave server, except for whether the target is a local plan or a distributed plan.

ここで、図30に、図28で示したローカルプラン順序決定処理で得られたローカルプランにおいて、上述したスキーマ生成処理が行われた結果得られる入出力スキーマの一例を示す。図30に示した入出力スキーマテーブル500は、演算番号500、入力スキーマ1、入力スキーマ2、出力スキーマ502の項目を示す。   Here, FIG. 30 shows an example of an input / output schema obtained as a result of the above-described schema generation processing in the local plan obtained by the local plan order determination processing shown in FIG. The input / output schema table 500 shown in FIG. 30 shows items of operation number 500, input schema 1, input schema 2, and output schema 502.

入出力スキーマテーブル500の演算番号501には、スキーマ生成処理が行われたプランの演算番号と対応した演算番号が格納される。   The operation number 501 of the input / output schema table 500 stores an operation number corresponding to the operation number of the plan for which the schema generation processing has been performed.

入力スキーマ1は、スキーマ生成処理において生成された入力スキーマの1つ目が格納される。入力スキーマ2は、スキーマ生成処理において生成された入力スキーマの2つ目の入力スキーマが格納される。   The input schema 1 stores the first input schema generated in the schema generation process. The input schema 2 stores the second input schema of the input schema generated in the schema generation process.

出力スキーマ504は、スキーマ生成処理において生成された出力スキーマが格納される。   The output schema 504 stores the output schema generated in the schema generation process.

スキーマ生成処理部18が、この入出力スキーマテーブル500を算出する処理を具体的に説明する。まず図28のローカルプランが、スキーマ生成処理の入力として渡される。次にiに1を、maxに8を代入する(ステップS1100)。次にiがmax以下であるため演算番号1の演算Sを取得する(ステップS1110、S1120)。演算Sは出力変数$xを持つ為$xを出力スキーマ504と変数リストVLに追加する。さらに$xに対する到達番号リストRLと利用番号リストULを用意する(ステップS1130、S1140)。次に事前実行番号を辿り演算Sの演算番号1と演算Sより後に実行される演算番号2−8を到達番号リストRLに格納する(ステップS1150、S1160)。演算Sは入力変数を持たないためiに2を代入し、演算番号2の演算Sを取得する(ステップS1210、S1110、S1120)。   A process in which the schema generation processing unit 18 calculates the input / output schema table 500 will be specifically described. First, the local plan of FIG. 28 is passed as an input of the schema generation process. Next, 1 is substituted for i and 8 is substituted for max (step S1100). Next, since i is equal to or less than max, the operation S with the operation number 1 is acquired (steps S1110 and S1120). Since the operation S has the output variable $ x, $ x is added to the output schema 504 and the variable list VL. Further, an arrival number list RL and a usage number list UL for $ x are prepared (steps S1130 and S1140). Next, the advance execution number is traced, and the operation number 1 of the operation S and the operation number 2-8 executed after the operation S are stored in the arrival number list RL (steps S1150 and S1160). Since the calculation S has no input variable, 2 is substituted for i, and the calculation S of the calculation number 2 is acquired (steps S1210, S1110, S1120).

演算Sは出力変数$zを持つ為$zを出力スキーマ504と変数リストVLに追加する。さらに$zに対する到達番号リストRLと利用番号リストULを用意する(ステップS1130、S1140)。次に事前実行番号を辿り演算Sの演算番号2と演算Sより後に実行される演算番号3−8を到達番号リストRLに格納する(ステップS1150、S1160)。次に演算Sは入力変数$xを持つ為、Sより前に実行された演算番号1を利用演算番号ULに登録する。(ステップS1170、S1180、S1200)。次に演算番号3の演算Sを取得する(ステップS1210、S1110、S1120)。   Since the operation S has the output variable $ z, $ z is added to the output schema 504 and the variable list VL. Further, an arrival number list RL and usage number list UL for $ z are prepared (steps S1130 and S1140). Next, the advance execution number is traced, and the operation number 2 of the operation S and the operation number 3-8 executed after the operation S are stored in the arrival number list RL (steps S1150 and S1160). Next, since the operation S has the input variable $ x, the operation number 1 executed before S is registered in the use operation number UL. (Steps S1170, S1180, S1200). Next, the operation S with the operation number 3 is acquired (steps S1210, S1110, S1120).

演算Sは出力変数$zを持つ為$zを出力スキーマ504と変数リストVLに追加する。さらに$zに対する到達番号リストRLと利用番号リストULを用意する(ステップS1130、S1140)。次に事前実行番号を辿り演算Sの演算番号3と演算Sより後に実行される演算番号3、6−8を到達番号リストRLに格納する(ステップS1150、S1160)。次に入力変数$zを持つ為、Sより前に実行された演算番号1、2を$zの利用演算番号ULに登録する。(ステップS1130、S1170、S1180、S1200)。次に演算番号4の演算Sを取得する(ステップS1210、S1110、S1120)。   Since the operation S has the output variable $ z, $ z is added to the output schema 504 and the variable list VL. Further, an arrival number list RL and usage number list UL for $ z are prepared (steps S1130 and S1140). Next, the advance execution number is traced, and the operation number 3 of the operation S and the operation numbers 3 and 6-8 executed after the operation S are stored in the arrival number list RL (steps S1150 and S1160). Next, since it has the input variable $ z, the operation numbers 1 and 2 executed before S are registered in the utilization operation number UL of $ z. (Steps S1130, S1170, S1180, S1200). Next, the operation S with the operation number 4 is acquired (steps S1210, S1110, S1120).

演算Sは出力変数$uを持つ為$uを出力スキーマ504と変数リストVLに追加する。さらに$uに対する到達番号リストRLと利用番号リストULを用意する(ステップS1130、S1140)。次に事前実行番号を辿り演算Sの演算番号4と演算Sより後に実行される演算番号5、7、8を到達番号リストRLに格納する(ステップS1150、S1160)。次に演算Sは入力変数$xを持つ為、Sより前に実行された演算番号1、2を利用演算番号ULに登録する。(ステップS1170、S1180、S1200)。次に演算番号5の演算Sを取得する(ステップS1210、S1110、S1120)。   Since the operation S has the output variable $ u, $ u is added to the output schema 504 and the variable list VL. Further, a reaching number list RL and a usage number list UL for $ u are prepared (steps S1130 and S1140). Next, the advance execution number is traced, and the operation number 4 of the operation S and the operation numbers 5, 7, and 8 executed after the operation S are stored in the arrival number list RL (steps S1150 and S1160). Next, since the operation S has the input variable $ x, the operation numbers 1 and 2 executed before S are registered in the use operation number UL. (Steps S1170, S1180, S1200). Next, the operation S with the operation number 5 is acquired (steps S1210, S1110, S1120).

演算Sは出力変数$vを持つ為$vを出力スキーマ504と変数リストVLに追加する。さらに$vに対する到達番号リストRLと利用番号リストULを用意する(ステップS1130、S1140)。次に事前実行番号を辿り演算Sの演算番号5と演算Sより後に実行される演算番号7、8を到達番号リストRLに格納する(ステップS1150、S1160)。次に演算Sは入力変数$xを持つ為、Sより前に実行された演算番号1、2、4を利用演算番号ULに登録する。(ステップS1170、S1180、S1200)。次に演算番号6の演算Sを取得する(ステップS1210、S1110、S1120)。   Since the operation S has the output variable $ v, $ v is added to the output schema 504 and the variable list VL. Further, an arrival number list RL and usage number list UL for $ v are prepared (steps S1130 and S1140). Next, the advance execution number is traced, and the operation number 5 of the operation S and the operation numbers 7 and 8 executed after the operation S are stored in the arrival number list RL (steps S1150 and S1160). Next, since the operation S has the input variable $ x, the operation numbers 1, 2, and 4 executed before S are registered in the use operation number UL. (Steps S1170, S1180, S1200). Next, the calculation S of the calculation number 6 is acquired (steps S1210, S1110, S1120).

演算Sは出力変数$zを持つ為$zを出力スキーマ504と変数リストVLに追加する。さらに$zに対する。到達番号リストRLと利用番号リストULを用意する(ステップS1130、S1140)。次に事前実行番号を辿り演算Sの演算番号6と演算Sより後に実行される演算番号7、8を到達番号リストRLに格納する(ステップS1150、S1160)。次に、入力変数$zを持つ為、Sより前に実行された演算番号1−3を$zの利用演算番号ULに登録する。(ステップS1130、S1170、S1180、S1200)。次に演算番号7の演算Sを取得する(ステップS1210、S1110、S1120)。   Since the operation S has the output variable $ z, $ z is added to the output schema 504 and the variable list VL. Furthermore, for $ z. A reachable number list RL and a use number list UL are prepared (steps S1130 and S1140). Next, the advance execution number is traced, and the operation number 6 of the operation S and the operation numbers 7 and 8 executed after the operation S are stored in the arrival number list RL (steps S1150 and S1160). Next, since it has the input variable $ z, the operation numbers 1-3 executed before S are registered in the utilization operation number UL of $ z. (Steps S1130, S1170, S1180, S1200). Next, the calculation S of the calculation number 7 is acquired (steps S1210, S1110, S1120).

演算Sは出力変数を持たず、入力変数$zを持つ為、Sより前に実行された演算番号1−6を$zの利用演算番号ULに登録する。(ステップS1130、S1170、S1180、S1200)。次に演算番号8の演算Sを取得する(ステップS1210、S1110、S1120)。   Since the operation S has no output variable and has the input variable $ z, the operation numbers 1-6 executed before S are registered in the usage operation number UL of $ z. (Steps S1130, S1170, S1180, S1200). Next, the operation S with the operation number 8 is acquired (steps S1210, S1110, S1120).

演算Sは出力変数$uと$vを持つ為$uと$vを出力スキーマ504と変数リストVLに追加する。さらに$uと$vに対する。到達番号リストRLと利用番号リストULを用意する(ステップS1130、S1140)。次に事前実行番号を辿り演算Sの演算番号8を到達番号リストRLに格納する(ステップS1150、S1160)。次に、入力変数$u、$vを持つ為、Sより前に実行された演算番号1−7を$u、$vの利用演算番号ULに登録する。(ステップS1130、S1170、S1180、S1200)。次にiがmaxを超えたためjに1を、vmaxにVLの要素数4を代入する(ステップS1210、S1110、S1220)。次に変数リストの1番目の要素である変数$xを取得する(ステップS1230,S1240)。   Since the operation S has output variables $ u and $ v, $ u and $ v are added to the output schema 504 and the variable list VL. Furthermore, for $ u and $ v. A reachable number list RL and a use number list UL are prepared (steps S1130 and S1140). Next, the advance execution number is traced, and the operation number 8 of the operation S is stored in the arrival number list RL (steps S1150 and S1160). Next, since there are input variables $ u and $ v, the operation numbers 1-7 executed before S are registered in the use operation numbers UL of $ u and $ v. (Steps S1130, S1170, S1180, S1200). Next, since i exceeds max, 1 is substituted for j, and the number of VL elements 4 is substituted for vmax (steps S1210, S1110, S1220). Next, the variable $ x which is the first element of the variable list is acquired (steps S1230 and S1240).

変数$xの利用番号リストULの各要素は1、2、4、到達演算番号RLは1−8であるため共通して出現する演算番号1、2、4の出力スキーマ504に$xを追加する(ステップS1250、S1260)。次にVLの2番目の変数$zを取得する(ステップS1270、S1230、S1240)。   $ X is added to the output schema 504 of operation numbers 1, 2, and 4 that appear in common because each element of the usage number list UL of the variable $ x is 1, 2, and 4, and the reaching operation number RL is 1-8. (Steps S1250 and S1260). Next, the second variable $ z of VL is acquired (steps S1270, S1230, S1240).

変数$zの利用番号リストULの各要素は1−6、到達演算番号RLは2−8であるため共通して出現する演算番号2−6、の出力スキーマ504に$zを追加する(ステップS1250、S1260)。次にVLの3番目の変数$uを取得する(ステップS1270、S1230、S1240)。   Since each element of the usage number list UL of the variable $ z is 1-6 and the reaching operation number RL is 2-8, $ z is added to the output schema 504 of the operation number 2-6 that appears in common (step) S1250, S1260). Next, the third variable $ u of VL is acquired (steps S1270, S1230, S1240).

変数$uの利用番号リストULの各要素は1−7、到達演算番号RLは4、5、7、8であるため共通して出現する演算番号4、5、7、の出力スキーマ504に$uを追加する(ステップS1250、S1260)。次にVLの4番目の変数$vを取得する(ステップS1270、S1230、S1240)。   Since each element of the usage number list UL of the variable $ u is 1-7 and the reaching operation number RL is 4, 5, 7, 8, the output schema 504 of the operation numbers 4, 5, 7 appearing in common is $ u is added (steps S1250 and S1260). Next, the fourth variable $ v of VL is acquired (steps S1270, S1230, S1240).

変数$vの利用番号リストULの各要素は1−7、到達演算番号RLは5、7、8であるため共通して出現する演算番号5、7、の出力スキーマ504に$vを追加する(ステップS1250、S1260)。次にiに1を代入し、演算番号1の演算Sを取得する(ステップS1270、S1230、S1280)。   Since each element of the usage number list UL of the variable $ v is 1-7 and the reaching operation number RL is 5, 7, 8, $ v is added to the output schema 504 of the operation numbers 5, 7 that appear in common. (Steps S1250 and S1260). Next, 1 is substituted into i, and the operation S with the operation number 1 is acquired (steps S1270, S1230, and S1280).

演算番号1は入力がないため、出力スキーマ504に可変領域と拡張変数$#e()を追加して、演算番号2の演算Sを取得する(ステップS1300−S1320、S1280、S1290)。   Since the operation number 1 is not input, the variable S and the extended variable $ # e () are added to the output schema 504 to obtain the operation S of the operation number 2 (steps S1300 to S1320, S1280, and S1290).

演算番号2の入力スキーマ1に演算番号1の出力スキーマ504をコピーし、出力スキーマ504に可変領域と拡張変数$#e()を追加して、演算番号3の演算Sを取得する(ステップS1300−S1320、S1280、S1290)。   Copy the output schema 504 of the operation number 1 to the input schema 1 of the operation number 2, add the variable area and the extension variable $ # e () to the output schema 504, and acquire the operation S of the operation number 3 (step S1300). -S1320, S1280, S1290).

演算番号3の入力スキーマ1に演算番号2の出力スキーマ504をコピーし、出力スキーマ504に可変領域と拡張変数$#e()を追加して、演算番号4の演算Sを取得する(ステップS1300−S1320、S1280、S1290)。   Copy the output schema 504 of operation number 2 to the input schema 1 of operation number 3, add the variable area and the extension variable $ # e () to the output schema 504, and obtain the operation S of operation number 4 (step S1300). -S1320, S1280, S1290).

演算番号4の入力スキーマ1に演算番号2の出力スキーマ504をコピーし、出力スキーマ504に可変領域と拡張変数$#e()を追加して、演算番号5の演算Sを取得する(ステップS1300−S1320、S1280、S1290)。   The output schema 504 with the operation number 2 is copied to the input schema 1 with the operation number 4, and the variable area and the extension variable $ # e () are added to the output schema 504 to obtain the operation S with the operation number 5 (step S1300). -S1320, S1280, S1290).

演算番号5の入力スキーマ1に演算番号4の出力スキーマ504をコピーし、出力スキーマ504に可変領域と拡張変数$#e()を追加して、演算番号6の演算Sを取得する(ステップS1300−S1320、S1280、S1290)。   The output schema 504 with the operation number 4 is copied to the input schema 1 with the operation number 5, the variable region and the extension variable $ # e () are added to the output schema 504, and the operation S with the operation number 6 is acquired (step S1300). -S1320, S1280, S1290).

演算番号6の入力スキーマ1に演算番号3の出力スキーマ504をコピーし、出力スキーマ504に可変領域と拡張変数$#e()を追加して、演算番号7の演算Sを取得する(ステップS1300−S1320、S1280、S1290)。   The output schema 504 with the operation number 3 is copied to the input schema 1 with the operation number 6, and the variable region and the extension variable $ # e () are added to the output schema 504 to obtain the operation S with the operation number 7 (step S1300). -S1320, S1280, S1290).

演算番号7の入力スキーマ1に演算番号5の出力スキーマ504を、入力スキーマ2に演算番号6の出力スキーマ504を各々コピーし、出力スキーマ504に可変領域と拡張変数$#e()を追加して、演算番号8の演算Sを取得する(ステップS1300−S1320、S1280、S1290)。   Copy the output schema 504 of operation number 5 to the input schema 1 of operation number 7, copy the output schema 504 of operation number 6 to the input schema 2, and add the variable area and extension variable $ # e () to the output schema 504. Thus, the operation S with the operation number 8 is acquired (steps S1300-S1320, S1280, S1290).

演算番号8の入力スキーマ1に演算番号7の出力スキーマ504をコピーし、出力スキーマ504に可変領域と拡張変数$#e()を追加して終了する(ステップS1300−S1320、S1280、S1290)。スキーマ生成処理の出力結果の一例は、図30にした入出力スキーマテーブル500である。なお、図30では入力スキーマが1つだけの場合は入力スキーマ1の項目に、2つある場合は2つ目を入力スキーマ2の項目に格納しているが、入力スキーマの項目は必要に応じて増やしたり減らしたりしても良い。   The output schema 504 with the operation number 7 is copied to the input schema 1 with the operation number 8, the variable area and the extension variable $ # e () are added to the output schema 504, and the process ends (steps S1300 to S1320, S1280, and S1290). An example of the output result of the schema generation process is the input / output schema table 500 shown in FIG. In FIG. 30, when there is only one input schema, it is stored in the input schema 1 item, and when there are two, the second is stored in the input schema 2 item. It may be increased or decreased.

ここで、ステップS14と並行して実行されるマスターサーバの処理について説明する。分散プラン生成部23は、分散プラン更新処理を行い(ステップS10)、分散プランを更新した後、更新した分散プランに基づいて実行順序が非決定的な部分を確定する分散プラン順序決定処理を実施する(ステップS13)。ステップS13の分散プラン順序決定処理は対象のプランがローカルプランではなく分散プランである以外はステップS12と同じである。   Here, the process of the master server executed in parallel with step S14 will be described. The distributed plan generation unit 23 performs a distributed plan update process (Step S10), updates the distributed plan, and then executes a distributed plan order determination process that determines a portion whose execution order is non-deterministic based on the updated distributed plan. (Step S13). The distributed plan order determination process in step S13 is the same as step S12 except that the target plan is not a local plan but a distributed plan.

次に、スキーマ生成部18は、決定した分散プラン内の各演算の入出力スキーマを生成する(ステップS15)。ステップS15のスキーマ生成処理は対象のプランがローカルプランではなく分散プランである以外はステップS14と同じである。   Next, the schema generation unit 18 generates an input / output schema for each operation in the determined distributed plan (step S15). The schema generation process in step S15 is the same as step S14 except that the target plan is not a local plan but a distributed plan.

マスターサーバとスレーブサーバのそれぞれで、スキーマ生成処理が行われると、マスターサーバとスレーブサーバのそれぞれは生成された入出力スキーマに基づいてプランを実行する。すなわち、スレーブサーバのローカルプラン実行部36は、スキーマ生成処理(ステップS14)で生成された入出力スキーマを元にローカルプランを実行する(ステップS9)。また、マスターサーバの分散プラン実行部16は、スキーマ生成処理(ステップS15)で生成されたスキーマを元に、分散プランを実行する(ステップS11)。   When the schema generation processing is performed in each of the master server and the slave server, each of the master server and the slave server executes a plan based on the generated input / output schema. That is, the local plan execution unit 36 of the slave server executes the local plan based on the input / output schema generated in the schema generation process (step S14) (step S9). Further, the distributed plan execution unit 16 of the master server executes the distributed plan based on the schema generated by the schema generation process (step S15) (step S11).

ローカルプラン実行(ステップS9)では、ローカルプラン実行部33は、ローカルプランの各演算を実施する際に、入力されるデータと用意した入力スキーマをスキーマ変更部36に渡してスキーマ変更処理を実施する(ステップS16)。また分散プラン実行(ステップS11)においても同様に、分散プラン実行部16が分散プランの各演算を実施する際に、入力されるデータと用意した入力スキーマをスキーマ変更部19に渡してスキーマ変更処理を実施する(ステップS16)。   In the local plan execution (step S9), the local plan execution unit 33 performs the schema change processing by passing the input data and the prepared input schema to the schema change unit 36 when performing each calculation of the local plan. (Step S16). Similarly, in the distributed plan execution (step S11), when the distributed plan executing unit 16 performs each calculation of the distributed plan, the input data and the prepared input schema are passed to the schema changing unit 19, and the schema changing process is performed. (Step S16).

ここで、図31を参照して、ステップS16においてマスターサーバのスキーマ変更部19が、分散プランを実行する際に行うスキーマ変更処理について説明する。   Here, with reference to FIG. 31, the schema changing process performed when the schema changing unit 19 of the master server executes the distributed plan in step S16 will be described.

スキーマ変更部19は、分散プラン実行部16が次に実行する演算の入力であるスキーマSを持つデータDと、スキーマ生成部18で予め用意した演算の入力スキーマTを取得する(ステップS1400)。次にスキーマSとスキーマTの変数の項目が一致しているかを判定する(ステップS1410)。   The schema changing unit 19 acquires the data D having the schema S that is the input of the operation to be executed next by the distributed plan executing unit 16 and the operation input schema T prepared in advance by the schema generating unit 18 (step S1400). Next, it is determined whether the items of the variables of the schema S and the schema T match (step S1410).

スキーマSとスキーマTの変数の項目が一致していない場合(ステップS1410がNo)、スキーマSの拡張変数$#eの変数リストVLを取得し、リストが空であるかを判定する(ステップS1420)。   If the items of the variables of the schema S and the schema T do not match (No in step S1410), the variable list VL of the extension variable $ # e of the schema S is acquired, and it is determined whether the list is empty (step S1420). ).

スキーマSの拡張変数$#eの変数リストVLが空でない場合(ステップS1420がNo)、拡張変数リストVL内の各変数をスキーマSの変数の項目として追加し、VLを空に変更する(ステップS1430)。次にスキーマSに存在し、スキーマTに存在しない変数の項目のリストDLを取得する(ステップS1430)。次にステップS1450に進む。なお、スキーマSの拡張変数$#eの変数リストVLが空の場合(ステップS1420がYes)も、ステップS1450に進む。   If the variable list VL of the extended variable $ # e in the schema S is not empty (No in step S1420), each variable in the extended variable list VL is added as a variable item in the schema S, and the VL is changed to empty (step) S1430). Next, a list DL of variable items that exist in the schema S and do not exist in the schema T is acquired (step S1430). Next, the process proceeds to step S1450. If the variable list VL of the extended variable $ # e in the schema S is empty (step S1420 is Yes), the process proceeds to step S1450.

ステップS1450では、変数の項目リストDL内の変数がスキーマSにおいて非連続に並んでいるかを判定する(ステップS1450)。   In step S1450, it is determined whether the variables in the variable item list DL are discontinuously arranged in the schema S (step S1450).

変数の項目リストDL内の変数がスキーマSにおいて非連続に並んでいる場合、(ステップS1450がYes)、変数の項目リストDL内の変数が連続するようにスキーマSとデータDの各データを書き換える(ステップS1460)。次にステップS1470に進む。なお、変数の項目リストDL内の変数がスキーマSにおいて非連続に並んでいない場合(ステップS1420がNo)も、ステップS1470に進む。   When the variables in the variable item list DL are discontinuously arranged in the schema S (Yes in step S1450), the data in the schema S and the data D are rewritten so that the variables in the variable item list DL are continuous. (Step S1460). Next, the process proceeds to step S1470. If the variables in the variable item list DL are not discontinuously arranged in the schema S (No in step S1420), the process also proceeds to step S1470.

ステップS1470では、スキーマSの変数の項目からリストDL内の変数を削除し、拡張変数$#eの変数リストに追加する(ステップS1470)。次にデータDの可変領域の項目にリストDL内の変数の合計サイズを格納して終了する(ステップS1480)。なおスキーマSとスキーマTの変数の項目が一致している場合(ステップS1410がYes)も終了する。なお、図31で示したフローチャートは、ローカルプラン実行部33における演算に対するスキーマ変更部36の処理時においても、対象がローカルプランであるか分散プランであるかの違いのみで同様に動作する。   In step S1470, the variable in list DL is deleted from the variable item of schema S and added to the variable list of extension variable $ # e (step S1470). Next, the total size of the variables in the list DL is stored in the variable area item of the data D, and the process ends (step S1480). Note that when the items of the variables of the schema S and the schema T match (Yes in step S1410), the process is also ended. Note that the flowchart shown in FIG. 31 operates in the same manner only when the target is a local plan or a distributed plan even when the schema change unit 36 processes a calculation in the local plan execution unit 33.

ここで図31を参照して、スキーマ変更部19が、図26に示した、計算機0の演算番号7の入力スキーマと、計算機1、計算機2、計算機3から送信された各データのスキーマに対し、スキーマ変更処理を行う際の動作について具体的に説明する。このスキーマ変更処理は分散プランが図24、計算機1、計算機2、計算機3のローカルプランが図12、図18、図16に示したローカルプラン候補における分散プランの演算番号7の受信演算の実施時に行うものである。   Referring to FIG. 31, the schema changing unit 19 applies the input schema of the operation number 7 of the computer 0 and the schema of each data transmitted from the computer 1, the computer 2, and the computer 3 shown in FIG. 26. The operation when the schema change process is performed will be specifically described. This schema change process is performed when the reception plan of the distributed plan operation number 7 in the local plan candidate shown in FIG. 24, computer 1, computer 2, and computer 3 is shown in FIG. 12, FIG. 18, FIG. Is what you do.

まず図26の計算機0の演算番号7の入力スキーマTと、計算機1から送信されたデータのスキーマSを取得する(ステップS1400)。スキーマSとスキーマTの変数項目が一致しているため処理を終了する(ステップS1410)。   First, the input schema T of operation number 7 of the computer 0 in FIG. 26 and the schema S of the data transmitted from the computer 1 are acquired (step S1400). Since the variable items of the schema S and the schema T match, the process ends (step S1410).

次に計算機0の演算番号7の入力スキーマTと、計算機2から送信されたデータのスキーマSを取得する(ステップS1400)。スキーマSとスキーマTの変数項目が一致せず、Sの拡張変数$#eの変数リストが空であるためスキーマSに存在し、スキーマTに存在しない変数として$uと$vを取得する(ステップS1410、ステップS1420、ステップS1440)。変数$uと$vはスキーマSにおいて連続して並んでいる為、スキーマSの項目から変数$uと$vを削除し、拡張変数$#eの変数リストに追加する(ステップS1450、ステップS1470)。最後に$uと$vの変数の合計サイズを拡張領域に格納する(ステップS1480)。   Next, the input schema T of the calculation number 7 of the computer 0 and the schema S of the data transmitted from the computer 2 are acquired (step S1400). Since the variable items of the schema S and the schema T do not match and the variable list of the extension variable $ # e of S is empty, $ u and $ v are acquired as variables that exist in the schema S and do not exist in the schema T ( Step S1410, Step S1420, Step S1440). Since the variables $ u and $ v are continuously arranged in the schema S, the variables $ u and $ v are deleted from the items of the schema S and added to the variable list of the extended variable $ # e (steps S1450 and S1470). ). Finally, the total size of the variables of $ u and $ v is stored in the extension area (step S1480).

次に計算機0の演算番号7の入力スキーマTと、計算機3から送信されたデータのスキーマSを取得する(ステップS1400)。スキーマSとスキーマTの変数項目が一致せず、Sの拡張変数$#eの変数リストが空であるためスキーマSに存在し、スキーマTに存在しない変数として$uを取得する(ステップS1410、ステップS1420、ステップS1440)。変数$uはスキーマSにおいて連続して並んでいる為、スキーマSの項目から変数$uを削除し、拡張変数$#eの変数リストに追加する(ステップS1450、ステップS1470)。最後に$uの変数の合計サイズを拡張領域に格納する(ステップS1480)。スキーマ変更処理の結果を図32に示す。図32は、スキーマ変更処理後のスキーマが含む項目を示す一例である。図32に示すように本実施形態では、スキーマ変更処理後は、「可変領域」401と、「変数〜」402と「拡張変数$#e(V1・・・,Vn)」403の項目を有する。   Next, the input schema T of the calculation number 7 of the computer 0 and the schema S of the data transmitted from the computer 3 are acquired (step S1400). Since the variable items of the schema S and the schema T do not match and the variable list of the extension variable $ # e of S is empty, $ u is acquired as a variable that exists in the schema S and does not exist in the schema T (step S1410, Step S1420, Step S1440). Since the variable $ u is continuously arranged in the schema S, the variable $ u is deleted from the items of the schema S and added to the variable list of the extended variable $ # e (steps S1450 and S1470). Finally, the total size of the variable of $ u is stored in the extension area (step S1480). The result of the schema change process is shown in FIG. FIG. 32 is an example showing items included in the schema after the schema change processing. As shown in FIG. 32, in the present embodiment, after the schema change process, there are items of “variable area” 401, “variable˜” 402, and “extended variable $ # e (V1..., Vn)” 403. .

なお上記のスキーマ変更処理は、マスターサーバの分散プランの演算とスレーブサーバのローカルプランの演算でデータを受け渡す際に実施する事例を説明したが、同一サーバ内、或いはスレーブサーバ間の演算でデータを受け渡す際にも適用できる。図24では演算番号6のサーバ間JOINの前に変数$zを受信することになっている。   Note that the schema change process described above is an example that is performed when data is transferred in the master server's distributed plan calculation and slave server's local plan calculation, but the data is calculated in the same server or between slave servers. It can also be applied when handing over. In FIG. 24, the variable $ z is received before the server-to-server JOIN with the operation number 6.

しかしながら図18、図12、図19のローカルプラン候補から分かるように、計算機1は変数$z、$u、$vの3組のデータを、計算機2は変数$zを、計算機3は変数$z、$uの2組のデータを送信している。このため、そのままではカラム数の異なるテーブルを扱うことになってしまう。したがってマスターサーバのスキーマ変更部18では、図26に示す各計算機のデータのスキーマを、図32に示すように全ての計算機のデータが同じスキーマとみなすことができるようにスキーマを変更している。図24では演算番号6のサーバ間JOINでは変数$zのみ必要であるため、他に変数が含まれていた場合は全て1つの可変長データを格納した拡張変数$#eのカラムとして扱うようになっている。そして可変領域で可変長領域のサイズを記憶している。これによりサーバ間JOINの実行時に全て同じ形のテーブルとして扱うことが可能になっている。   However, as can be seen from the local plan candidates in FIGS. 18, 12, and 19, the computer 1 has three sets of data $ z, $ u, and $ v, the computer 2 has the variable $ z, and the computer 3 has the variable $. Two sets of data of z and $ u are transmitted. For this reason, a table with a different number of columns will be handled as it is. Therefore, the schema change unit 18 of the master server changes the schema of the data of each computer shown in FIG. 26 so that the data of all the computers can be regarded as the same schema as shown in FIG. In FIG. 24, since only the variable $ z is necessary in the server-to-server JOIN with the operation number 6, all other variables are handled as columns of the extended variable $ # e storing one variable length data. It has become. The variable area stores the size of the variable length area. As a result, all of the tables can be handled as the same table when executing the JOIN between servers.

本実施形態の分散データベース検索装置によると、スレーブサーバ毎にローカルプランを作成するため、スレーブサーバ毎に分散プランの一部が異なる可能性がある。すなわち、スレーブサーバ毎に送られるデータのスキーマが異なる可能性がある。本実施形態は、このような場合に、スキーマ変更部18、20においてデータを受け渡す際に送信する側のデータのスキーマ(入力スキーマ)と、受信するデータのスキーマ(出力スキーマ)の違いを変更することで、同一スキーマのデータとして扱うことを実現する。   According to the distributed database search apparatus of the present embodiment, a local plan is created for each slave server, so there is a possibility that part of the distributed plan differs for each slave server. That is, the schema of data sent to each slave server may be different. In this case, the present embodiment changes the difference between the schema (input schema) of the data to be transmitted and the schema of the received data (output schema) when the schema changing units 18 and 20 deliver the data. By doing so, it can be handled as data of the same schema.

すなわち、スレーブサーバ毎に効率の良いローカルプランを作成する場合、複数の異なるスキーマのデータが存在する場合がある。このように、スレーブサーバ毎に効率の良いローカルプランを作成する場合は、複数の異なるスキーマのデータを統一的に扱う処理が必要になる。   That is, when creating an efficient local plan for each slave server, there may be a plurality of different schema data. As described above, when an efficient local plan is created for each slave server, it is necessary to process the data of a plurality of different schemas uniformly.

上述のように本実施形態によると、複数の異なるスキーマのデータを統一的に扱うことが可能となる。また、本実施形態ではスキーマのみ、あるいはスキーマとデータの一部の領域の書き換えのみで複数の異なるスキーマのデータを統一的に扱うこと実現することが可能である。   As described above, according to the present embodiment, data of a plurality of different schemas can be handled in a unified manner. Further, in the present embodiment, it is possible to realize unified handling of data of a plurality of different schemas only by rewriting only a schema or a partial area of the schema and data.

以上、本発明の実施形態を説明したが、これら実施形態は例として提示したものであり、発明の範囲を限定することは意図していない。これら新規な実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や要旨に含まれるとともに、特許請求の範囲に記載された発明とその均等の範囲に含まれる。   As mentioned above, although embodiment of this invention was described, these embodiment is shown as an example and is not intending limiting the range of invention. These novel embodiments can be implemented in various other forms, and various omissions, replacements, and changes can be made without departing from the scope of the invention. These embodiments and modifications thereof are included in the scope and gist of the invention, and are included in the invention described in the claims and the equivalents thereof.

11…構文解析部、12…クエリ分割部、13…分散プラン生成部、14…分散プラン結合演算追加部、15…分散プラン更新部、16…分散プラン実行部、17…送受信部、18…スキーマ生成部、19…スキーマ変更部、31…ローカルプラン選択部、32…ローカルプラン候補生成部、33…ローカルプラン実行部、34…送受信部、35…スキーマ生成部、36…スキーマ変更部   DESCRIPTION OF SYMBOLS 11 ... Syntax analysis part, 12 ... Query division part, 13 ... Distributed plan production | generation part, 14 ... Distributed plan combination calculation addition part, 15 ... Distributed plan update part, 16 ... Distributed plan execution part, 17 ... Transmission / reception part, 18 ... Schema Generation unit, 19 ... schema change unit, 31 ... local plan selection unit, 32 ... local plan candidate generation unit, 33 ... local plan execution unit, 34 ... transmission / reception unit, 35 ... schema generation unit, 36 ... schema change unit

Claims (7)

データを記憶するデータベースを有する複数のスレーブサーバと、前記データベースの管理情報を記憶し、問合せクエリに基づいて前記データを検索するマスターサーバとが接続される分散データベース検索装置の検索方法であって、
前記スレーブサーバそれぞれで演算するサーバ内演算処理を含み、もしくは、前記サーバ内演算及び前記複数のスレーブサーバからデータを集めてマスターサーバで演算するサーバ間演算処理を含み、複数のデータベースに記憶されたデータを検索する分散プランを、前記問合せクエリに基づいて生成するステップと、
前記分散プランに、前記サーバ間演算処理と並列に実行可能な演算が存在し、かつ当該演算を実行した結果と前記サーバ間演算処理の結果とを共に必要とする演算が存在する場合は、前記サーバ間演算処理と並列に実行可能な演算と、前記サーバ間演算とを並列に実行するとともに、前記サーバ間演算処理と並列に実行可能な演算によって得られたデータおよび前記サーバ間演算によって得られたデータを結合する分割クエリ結合演算を前記分散プランに追加するステップと、
当該分散プランから、前記スレーブサーバに関連するプランを抽出するステップと、
前記抽出されたプランに含まれる前記分割クエリ結合演算分及び分割クエリ結合演算に関連するデータの送受信演算を変更したローカルプラン候補を生成するステップと、
生成された前記ローカルプラン候補に含まれる前記分割クエリ結合演算分及び分割クエリ結合演算に関連するデータの送受信演算を変更した新たなローカルプラン候補を生成するステップと、
生成された前記ローカルプラン候補および前記抽出したプランそれぞれの演算コストを算出し、前記演算コストが最小となるプランをローカルプランとして選択するステップと、
前記選択されたローカルプランに基づいて、前記分散プランを更新するステップと、
を備える検索方法。
A search method for a distributed database search device in which a plurality of slave servers having a database for storing data and a master server for storing management information of the database and searching for the data based on a query query are connected,
Intra-server arithmetic processing that operates on each of the slave servers, or includes inter-server arithmetic processing that collects data from the intra-server arithmetic and the plurality of slave servers and operates on a master server, and is stored in a plurality of databases Generating a distributed plan for retrieving data based on the query query;
In the distributed plan, there is an operation that can be executed in parallel with the inter-server operation processing, and there is an operation that requires both the result of executing the operation and the result of the inter-server operation processing, An operation that can be executed in parallel with the inter-server operation processing and the operation between the servers are executed in parallel, and the data obtained by the operation that can be executed in parallel with the inter-server operation processing and the operation between the servers are obtained. Adding a split query join operation that joins the combined data to the distributed plan;
Extracting a plan related to the slave server from the distributed plan;
Generating local plan candidates in which the transmission / reception operation of data related to the split query join operation and the split query join operation included in the extracted plan is changed;
Generating a new local plan candidate in which the transmission / reception calculation of the data related to the divided query combination calculation and the divided query combination calculation included in the generated local plan candidate is changed;
Calculating a calculation cost of each of the generated local plan candidates and the extracted plan, and selecting a plan that minimizes the calculation cost as a local plan;
Updating the distributed plan based on the selected local plan;
A search method comprising:
データを記憶するデータベースを有する複数のスレーブサーバと、問合せクエリに基づいて前記データベースを検索するマスターサーバとが接続される分散データベース検索装置であって、
前記マスターサーバは、
前記スレーブサーバの有する各データベースの管理情報を記憶する記憶部と、
前記スレーブサーバそれぞれで演算するサーバ内演算処理を含み、もしくは、前記サーバ内演算及び前記複数のスレーブサーバからデータを集めてマスターサーバで演算するサーバ間演算処理を含み、複数のデータベースに記憶されたデータを検索する分散プランを、前記問合せクエリに基づいて生成する分散プラン生成部と、
前記分散プランに、前記サーバ間演算処理と並列に実行可能な演算が存在し、かつ当該演算を実行した結果と前記サーバ間演算処理の結果とを共に必要とする演算が存在する場合は、前記サーバ間演算処理と並列に実行可能な演算と、前記サーバ間演算とを並列に実行するとともに、前記サーバ間演算処理と並列に実行可能な演算によって得られたデータおよび前記サーバ間演算によって得られたデータを結合する分割クエリ結合演算を前記分散プランに追加する分割クエリ結合演算追加部と、
前記スレーブサーバから受信したローカルプランに基づいて、前記分散プランを更新する分散プラン更新部と、
を具備し、
前記スレーブサーバは、
前記分散プランから、前記スレーブサーバに関連するプランを抽出し、前記抽出したプランに含まれる前記分割クエリ結合演算分及び分割クエリ結合演算に関連するデータの送受信演算を変更したローカルプラン候補を生成するローカルプラン候補生成部と、
生成された前記ローカルプラン候補および前記抽出したプランそれぞれの演算コストを算出し、前記演算コストが最小となるプランをローカルプランとして選択するローカルプラン選択部と、を備える分散データベース検索装置。
A distributed database search device to which a plurality of slave servers having a database for storing data and a master server for searching the database based on a query query are connected,
The master server is
A storage unit for storing management information of each database of the slave server;
Intra-server arithmetic processing that operates on each of the slave servers, or includes inter-server arithmetic processing that collects data from the intra-server arithmetic and the plurality of slave servers and operates on a master server, and is stored in a plurality of databases A distributed plan generating unit for generating a distributed plan for searching for data based on the query query;
In the distributed plan, there is an operation that can be executed in parallel with the inter-server operation processing, and there is an operation that requires both the result of executing the operation and the result of the inter-server operation processing, An operation that can be executed in parallel with the inter-server operation processing and the operation between the servers are executed in parallel, and the data obtained by the operation that can be executed in parallel with the inter-server operation processing and the operation between the servers are obtained. A split query join operation addition unit for adding a split query join operation for combining the collected data to the distributed plan;
A distributed plan update unit that updates the distributed plan based on a local plan received from the slave server;
Comprising
The slave server is
A plan related to the slave server is extracted from the distributed plan, and a local plan candidate is generated by changing the split query join operation included in the extracted plan and the data send / receive operation related to the split query join operation. A local plan candidate generator,
A distributed database search device comprising: a local plan selection unit that calculates a calculation cost of each of the generated local plan candidates and the extracted plan, and selects a plan having the minimum calculation cost as a local plan.
前記サーバ間演算において、送受信されるデータのカラムが前記マスターサーバと前記スレーブサーバとで異なる場合、前記カラムを可変長のデータが記憶されたカラムとするスキーマ変更部を備える請求項2に記載の分散データベース検索装置。   The said server calculation WHEREIN: When the column of the data transmitted / received differs in the said master server and the said slave server, the schema change part which makes the said column the column in which the variable-length data was memorize | stored is provided. Distributed database search device. データを記憶するデータベースを有する複数のスレーブサーバと接続され、入力された問合せクエリに基づいて前記データベースを検索する分散データベース装置を構成するマスターサーバであって、
前記スレーブサーバの有する各データベースの管理情報を記憶する記憶部と、
前記スレーブサーバそれぞれで演算するサーバ内演算処理を含み、もしくは、前記サーバ内演算及び前記複数のスレーブサーバからデータを集めてマスターサーバで演算するサーバ間演算処理を含み、複数のデータベースに記憶されたデータを検索する分散プランを、前記問合せクエリに基づいて生成する分散プラン生成部と、
前記分散プランに、前記サーバ間演算処理と並列に実行可能な演算が存在し、かつ当該演算を実行した結果と前記サーバ間演算処理の結果とを共に必要とする演算が存在する場合は、前記サーバ間演算処理と並列に実行可能な演算と、前記サーバ間演算とを並列に実行するとともに、前記サーバ間演算処理と並列に実行可能な演算によって得られたデータおよび前記サーバ間演算によって得られたデータを結合する分割クエリ結合演算を前記分散プランに追加する分割クエリ結合演算追加部と、
前記スレーブサーバから受信したローカルプランに基づいて、前記分散プランを更新する分散プラン更新部と、を備えるマスターサーバ。
A master server connected to a plurality of slave servers having a database for storing data and constituting a distributed database device for searching the database based on an inputted query query,
A storage unit for storing management information of each database of the slave server;
Intra-server arithmetic processing that operates on each of the slave servers, or includes inter-server arithmetic processing that collects data from the intra-server arithmetic and the plurality of slave servers and operates on a master server, and is stored in a plurality of databases A distributed plan generating unit for generating a distributed plan for searching for data based on the query query;
In the distributed plan, there is an operation that can be executed in parallel with the inter-server operation processing, and there is an operation that requires both the result of executing the operation and the result of the inter-server operation processing, An operation that can be executed in parallel with the inter-server operation processing and the operation between the servers are executed in parallel, and the data obtained by the operation that can be executed in parallel with the inter-server operation processing and the operation between the servers are obtained. A split query join operation addition unit for adding a split query join operation for combining the collected data to the distributed plan;
A master server comprising: a distributed plan update unit that updates the distributed plan based on a local plan received from the slave server.
データベースを具備し、入力された問合せクエリに基づいて前記データベースを検索するマスターサーバと複数接続されて分散データベース検索システムを構成するスレーブサーバであって、
マスターサーバから受信した分散プランから、前記スレーブサーバに関連するプランを抽出し、前記抽出したプランに含まれる前記分割クエリ結合演算分及び分割クエリ結合演算に関連するデータの送受信演算を変更したローカルプラン候補を生成するローカルプラン候補生成部と、
生成された前記ローカルプラン候補および前記抽出したプランそれぞれの演算コストを算出し、前記演算コストが最小となるプランをローカルプランとして選択するローカルプラン選択部と、を備えるスレーブサーバ。
A slave server comprising a database and configured as a distributed database search system connected to a plurality of master servers that search the database based on an input query query;
A local plan in which a plan related to the slave server is extracted from the distributed plan received from the master server, and the transmission / reception calculation of the data related to the divided query join operation and the divided query join operation included in the extracted plan is changed. A local plan candidate generator for generating candidates;
A slave server comprising: a local plan selection unit that calculates a calculation cost of each of the generated local plan candidate and the extracted plan, and selects a plan having the minimum calculation cost as a local plan.
前記ローカルプラン選択部が算出する前記ローカルプラン候補の演算コストに、前記分割クエリ結合演算追加部で追加された分割クエリ結合演算の演算コストも含める請求項5に記載のスレーブサーバ。   The slave server according to claim 5, wherein the operation cost of the split query join operation added by the split query join operation adding unit is included in the operation cost of the local plan candidate calculated by the local plan selection unit. データを記憶するデータベースを有する複数のスレーブサーバと、前記データベースの管理情報を記憶し、問合せクエリに基づいて前記データを検索するマスターサーバとが接続される分散データベース検索装置のプログラムであって、
コンピュータに、
前記スレーブサーバそれぞれで演算するサーバ内演算処理を含み、もしくは、前記サーバ内演算及び前記複数のスレーブサーバからデータを集めてマスターサーバで演算するサーバ間演算処理を含み、複数のデータベースに記憶されたデータを検索する分散プランを、前記問合せクエリに基づいて生成する機能と、
前記分散プランに、前記サーバ間演算処理と並列に実行可能な演算が存在し、かつ当該演算を実行した結果と前記サーバ間演算処理の結果とを共に必要とする演算が存在する場合は、前記サーバ間演算処理と並列に実行可能な演算と、前記サーバ間演算とを並列に実行するとともに、前記サーバ間演算処理と並列に実行可能な演算によって得られたデータおよび前記サーバ間演算によって得られたデータを結合する分割クエリ結合演算を前記分散プランに追加する機能と、
前記スレーブサーバから受信したローカルプランに基づいて、前記分散プランを更新する機能と、
前記分散プランから、前記スレーブサーバに関連するプランを抽出し、前記抽出したプランに含まれる前記分割クエリ結合演算分及び分割クエリ結合演算に関連するデータの送受信演算を変更したローカルプラン候補を生成する機能と、
生成された前記ローカルプラン候補および前記抽出したプランそれぞれの演算コストを算出し、前記演算コストが最小となるプランをローカルプランとして選択する機能と、
を実現させるプログラム。
A program of a distributed database search device to which a plurality of slave servers having a database for storing data and a master server for storing management information of the database and searching for the data based on a query query are connected,
On the computer,
Intra-server arithmetic processing that operates on each of the slave servers, or includes inter-server arithmetic processing that collects data from the intra-server arithmetic and the plurality of slave servers and operates on a master server, and is stored in a plurality of databases A function for generating a distributed plan for retrieving data based on the query query;
In the distributed plan, there is an operation that can be executed in parallel with the inter-server operation processing, and there is an operation that requires both the result of executing the operation and the result of the inter-server operation processing, An operation that can be executed in parallel with the inter-server operation processing and the operation between the servers are executed in parallel, and the data obtained by the operation that can be executed in parallel with the inter-server operation processing and the operation between the servers are obtained. A function for adding a split query join operation to join the distributed data to the distributed plan;
A function of updating the distributed plan based on the local plan received from the slave server;
A plan related to the slave server is extracted from the distributed plan, and a local plan candidate is generated by changing the split query join operation included in the extracted plan and the data send / receive operation related to the split query join operation. Function and
A function of calculating the calculation cost of each of the generated local plan candidate and the extracted plan, and selecting a plan with the minimum calculation cost as a local plan;
A program that realizes
JP2011131854A 2011-06-14 2011-06-14 Distributed database search device, distributed database search method, and program Active JP5318155B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2011131854A JP5318155B2 (en) 2011-06-14 2011-06-14 Distributed database search device, distributed database search method, and program
CN201210048380.7A CN102831138B (en) 2011-06-14 2012-02-28 Separate data library searching device and separate data library searching method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011131854A JP5318155B2 (en) 2011-06-14 2011-06-14 Distributed database search device, distributed database search method, and program

Publications (2)

Publication Number Publication Date
JP2013003695A true JP2013003695A (en) 2013-01-07
JP5318155B2 JP5318155B2 (en) 2013-10-16

Family

ID=47334280

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011131854A Active JP5318155B2 (en) 2011-06-14 2011-06-14 Distributed database search device, distributed database search method, and program

Country Status (2)

Country Link
JP (1) JP5318155B2 (en)
CN (1) CN102831138B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016092604A1 (en) * 2014-12-08 2016-06-16 株式会社日立製作所 Data processing system and data access method
KR101648401B1 (en) * 2015-04-17 2016-08-16 (주)모아데이타 Database apparatus, storage unit and method for data management and data analysys
KR101783298B1 (en) * 2017-04-05 2017-09-29 (주)시큐레이어 Method for creating and managing node information from input data based on graph database and server using the same
JP2018169644A (en) * 2017-03-29 2018-11-01 株式会社日立製作所 Database management system and database management method
KR101929404B1 (en) 2017-01-26 2018-12-14 주식회사 마이셀럽스 System and method for searching object based on property thereof
CN109241092A (en) * 2018-10-15 2019-01-18 北京金山云网络技术有限公司 Data query method, system and computer equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6258332A (en) * 1985-09-09 1987-03-14 Fujitsu Ltd Optimizing system for partial inquiry of decentralized data base control system
JPH06214843A (en) * 1993-01-20 1994-08-05 Hitachi Ltd Data base management system and processing method for inquiry
JPH07141399A (en) * 1993-05-20 1995-06-02 Hughes Aircraft Co Computer data network and control thereof
JP2001331485A (en) * 2000-05-22 2001-11-30 Mitsubishi Electric Corp Distributed data base arithmetic processor
JP2007265248A (en) * 2006-03-29 2007-10-11 Toshiba Corp Structured document management device, structured document sub management device, program and structured document managing method
JP2008243075A (en) * 2007-03-28 2008-10-09 Toshiba Corp Structured document management device and method
JP2010176319A (en) * 2009-01-28 2010-08-12 Toshiba Corp Structured document-retrieving system, device, and method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002140194A (en) * 2000-10-31 2002-05-17 Toshiba Corp Information processing method, information processing device and agent system
EP1710736A4 (en) * 2004-01-21 2011-11-16 Metalogic Inc Constraint condition solving method, constraint condition solving device, and constraint condition solving system
JP4352079B2 (en) * 2007-03-28 2009-10-28 株式会社東芝 System, apparatus, and method for retrieving information from a distributed database
JP4980395B2 (en) * 2009-06-16 2012-07-18 株式会社日立製作所 Data analysis system and method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6258332A (en) * 1985-09-09 1987-03-14 Fujitsu Ltd Optimizing system for partial inquiry of decentralized data base control system
JPH06214843A (en) * 1993-01-20 1994-08-05 Hitachi Ltd Data base management system and processing method for inquiry
JPH07141399A (en) * 1993-05-20 1995-06-02 Hughes Aircraft Co Computer data network and control thereof
JP2001331485A (en) * 2000-05-22 2001-11-30 Mitsubishi Electric Corp Distributed data base arithmetic processor
JP2007265248A (en) * 2006-03-29 2007-10-11 Toshiba Corp Structured document management device, structured document sub management device, program and structured document managing method
JP2008243075A (en) * 2007-03-28 2008-10-09 Toshiba Corp Structured document management device and method
JP2010176319A (en) * 2009-01-28 2010-08-12 Toshiba Corp Structured document-retrieving system, device, and method

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016092604A1 (en) * 2014-12-08 2016-06-16 株式会社日立製作所 Data processing system and data access method
JPWO2016092604A1 (en) * 2014-12-08 2017-06-01 株式会社日立製作所 Data processing system and data access method
KR101648401B1 (en) * 2015-04-17 2016-08-16 (주)모아데이타 Database apparatus, storage unit and method for data management and data analysys
KR101929404B1 (en) 2017-01-26 2018-12-14 주식회사 마이셀럽스 System and method for searching object based on property thereof
JP2018169644A (en) * 2017-03-29 2018-11-01 株式会社日立製作所 Database management system and database management method
KR101783298B1 (en) * 2017-04-05 2017-09-29 (주)시큐레이어 Method for creating and managing node information from input data based on graph database and server using the same
CN109241092A (en) * 2018-10-15 2019-01-18 北京金山云网络技术有限公司 Data query method, system and computer equipment

Also Published As

Publication number Publication date
CN102831138B (en) 2015-10-28
CN102831138A (en) 2012-12-19
JP5318155B2 (en) 2013-10-16

Similar Documents

Publication Publication Date Title
JP5318155B2 (en) Distributed database search device, distributed database search method, and program
CN1552032B (en) Database
JP5376163B2 (en) Document management / retrieval system and document management / retrieval method
CN102693310B (en) A kind of resource description framework querying method based on relational database and system
JP3879321B2 (en) Document summarization apparatus, document summarization method, and recording medium recording document summarization program
JP5187308B2 (en) Conversion program search system and conversion program search method
JP4398988B2 (en) Apparatus, method and program for managing structured document
JP2001167087A (en) Device and method for retrieving structured document, program recording medium for structured document retrieval and index preparing method for structured document retrieval
Zeng et al. Redesign of the gStore system
JP2006185408A (en) Database construction device, database retrieval device, and database device
JP4247135B2 (en) Structured document storage method, structured document storage device, structured document search method
Arenas et al. A framework for annotating CSV-like data
JP4247108B2 (en) Structured document search method, structured document search device, and program
US20160103906A1 (en) Generating and implementing local search engines over large databases
CN114372174A (en) XML document distributed query method and system
US8001110B2 (en) Apparatus, method, and computer program product for processing databases
KR101718119B1 (en) System and Method for processing SPARQL queries based on Spark SQL
JP4309818B2 (en) Structured document management device, search device, storage method, search method, and program
RU2605387C2 (en) Method and system for storing graphs data
CN116383247A (en) Large-scale graph data efficient query method
JP4562130B2 (en) XML data processing apparatus, XML data processing method, XML data processing program, and storage medium storing XML data processing program
Zhang et al. Construction of a cloud scenario knowledge graph for cloud service market
Schubotz et al. Querying Large Collections of Mathematical Publications: NTCIR10 Math Task.
CN107038148A (en) The analytic method and resolver of XML document
Hernandez et al. WebQuIn-LD: a method of integrating web query interfaces based on linked data

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130315

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20130426

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130513

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20130426

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130611

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130709

R150 Certificate of patent or registration of utility model

Ref document number: 5318155

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350