JP2017126172A - Database control program, database control apparatus, and database control method - Google Patents
Database control program, database control apparatus, and database control method Download PDFInfo
- Publication number
- JP2017126172A JP2017126172A JP2016004655A JP2016004655A JP2017126172A JP 2017126172 A JP2017126172 A JP 2017126172A JP 2016004655 A JP2016004655 A JP 2016004655A JP 2016004655 A JP2016004655 A JP 2016004655A JP 2017126172 A JP2017126172 A JP 2017126172A
- Authority
- JP
- Japan
- Prior art keywords
- database
- data
- processors
- transaction
- executing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
【課題】DBに対する検索処理の実行結果に基づいて生成されるデータ群をDBに格納する格納処理の高速化を図ること。【解決手段】(1)で示すように、コア#0は、INSERT SELECT文111を受け付け、(2)で示すように、SELECT句に従い検索処理112を実行し、実行結果に基づいてレコード群rd1、2を生成する。次に、コア#0は、(3)で示すように、レコード群rd1、2のそれぞれを、コア#1、#2に割り当てて、(4)で示すように、コア#1、2に、割り当てたレコードをDB102に格納する格納処理113を実行する要求を送信する。ここで、コア#0は、検索処理112を同一のトランザクションに含まれる処理として実行するように要求する。コア#1、2は、(5)で示すように、格納処理113を検索処理112と同一のトランザクションに含まれる処理として実行する。【選択図】図1An object of the present invention is to increase the speed of a storage process for storing a data group generated based on the execution result of a search process for a DB in the DB. As shown in (1), core # 0 accepts an INSERT SELECT statement 111, executes search processing 112 according to the SELECT phrase as shown in (2), and records group rd1 based on the execution result. 2 is generated. Next, the core # 0 assigns each of the record groups rd1 and rd2 to the cores # 1 and # 2 as shown in (3), and the core # 1 and # 2 as shown in (4). A request for executing a storage process 113 for storing the allocated record in the DB 102 is transmitted. Here, the core # 0 requests the search process 112 to be executed as a process included in the same transaction. The cores # 1 and # 2 execute the storage process 113 as a process included in the same transaction as the search process 112, as indicated by (5). [Selection] Figure 1
Description
本発明は、データベース制御プログラム、データベース制御装置、およびデータベース制御方法に関する。 The present invention relates to a database control program, a database control apparatus, and a database control method.
従来、データベース(DB:DataBase)に対する検索処理を実行した実行結果に基づいて生成されるデータ群をデータベースに格納することを示す命令がある。関連する先行技術として、例えば、トランザクションがファイル上のDBへのレコード追加指示を含む時トランザクションごとに設けるバッファにレコードを追加し、トランザクションの正常終了指示によりバッファ内のレコードをDBに追加するものがある。 Conventionally, there is an instruction indicating that a data group generated based on an execution result of executing a search process on a database (DB: DataBase) is stored in the database. As a related prior art, for example, when a transaction includes a record addition instruction to a DB on a file, a record is added to a buffer provided for each transaction, and a record in the buffer is added to the DB by a normal end instruction of the transaction. is there.
しかしながら、従来技術において、DBに対する検索処理を実行した実行結果に基づいて生成されるデータ群をDBに格納する格納処理に時間がかかる場合がある。例えば、複数のプロセッサの各プロセッサが格納処理を並列に実行する場合に、複数のプロセッサのそれぞれが独立してDBに格納しようとすると、あるプロセッサがデータをDBに格納している間は、整合性を保つために排他制御を行うため、他のプロセッサは待機することになり、格納処理が遅延することになる。 However, in the prior art, it may take a long time to store the data group generated based on the execution result of executing the search process for the DB in the DB. For example, when each processor of a plurality of processors executes storage processing in parallel, if each of the plurality of processors tries to store the data independently in the DB, it is consistent while a certain processor stores the data in the DB. Since exclusive control is performed in order to maintain the performance, other processors will wait and the storage process will be delayed.
1つの側面では、本発明は、DBに対する検索処理を実行した実行結果に基づいて生成されるデータ群をDBに格納する格納処理の高速化を図るデータベース制御プログラム、データベース制御装置、およびデータベース制御方法を提供することを目的とする。 In one aspect, the present invention provides a database control program, a database control apparatus, and a database control method for speeding up a storage process for storing a data group generated based on an execution result of executing a search process for a DB in the DB The purpose is to provide.
本発明の一態様によれば、コンピュータが、DBに対する検索処理をトランザクションに含まれる処理として実行した実行結果に基づいて生成されるデータ群のそれぞれを、DBにアクセス可能な複数のプロセッサのいずれかに割り当て、複数のプロセッサのうちのデータ群のそれぞれを割り当てた割当先プロセッサに、割当先プロセッサに割り当てたデータをDBに格納する格納処理をトランザクションに含まれる処理として実行する要求を送信するデータベース制御プログラム、データベース制御装置、およびデータベース制御方法が提案される。 According to one aspect of the present invention, each of a group of data generated based on an execution result obtained when a computer executes a search process for a DB as a process included in a transaction is one of a plurality of processors that can access the DB. Database control for transmitting a request for executing storage processing for storing data allocated to the allocation destination processor to the DB as processing included in the transaction to the allocation destination processor allocated to each of the data groups of the plurality of processors A program, a database control device, and a database control method are proposed.
本発明の他の態様によれば、DBにアクセス可能な複数のプロセッサに含まれるプロセッサが、DBに対する検索処理をトランザクションに含まれる処理として実行した実行結果に基づいて生成されるデータ群のいずれかのデータがプロセッサに割り当てられたことに応じて、データを取得し、取得したデータを前記データベースに格納する格納処理を、トランザクションに含まれる処理として実行するデータベース制御プログラム、データベース制御装置、およびデータベース制御方法が提案される。 According to another aspect of the present invention, any one of data groups generated based on an execution result in which a processor included in a plurality of processors that can access a DB executes a search process for the DB as a process included in a transaction. Database control program, database control apparatus, and database control for acquiring data as a process included in a transaction, acquiring data and storing the acquired data in the database in response to the data assigned to the processor A method is proposed.
本発明の一側面によれば、DBに対する検索処理の実行結果に基づいて生成されるデータ群をDBに格納する格納処理の高速化を図ることができるという効果を奏する。 According to one aspect of the present invention, it is possible to increase the speed of a storage process for storing a data group generated based on the execution result of a search process for a DB in the DB.
以下に図面を参照して、開示のデータベース制御プログラム、データベース制御装置、およびデータベース制御方法の実施の形態を詳細に説明する。 Embodiments of a disclosed database control program, database control apparatus, and database control method will be described in detail below with reference to the drawings.
図1は、本実施の形態にかかるデータベース制御方法の動作例を示す説明図である。図1に示すデータベース制御装置101は、DB102を制御するコンピュータである。データベース制御装置101は、例えば、DB102を有するDBサーバでもよいし、DB102を有するコンピュータにアクセス可能なコンピュータでもよい。
FIG. 1 is an explanatory diagram illustrating an operation example of the database control method according to the present embodiment. A
DB102は、一定の形式で作成、管理されたデータの集合である。例えば、DB102は、データベース制御装置101にアクセスするユーザの顧客データや売上データ等を、一定の形式で管理する。そして、データベース制御装置101は、ユーザが操作する端末からの命令に応じて、DB102に対する検索処理を実行したり、DB102に対する格納処理を実行したりする。
The DB 102 is a set of data created and managed in a certain format. For example, the DB 102 manages customer data, sales data, and the like of users accessing the
また、DB102は、複数の記憶領域に分割されることがある。分割された記憶領域は、「パーティション」と呼ばれる。パーティションに分割することにより、DB102の性能や管理のし易さを向上させることができる。例えば、DB102の管理者は、データの集合を垂直方向のカラムと水平方向のレコードとで表したテーブルを、1つのパーティションに記憶するようにDB102を設計してもよい。または、DB102の管理者は、1つのテーブルに含まれる各レコードを、レコードキーの値で分類し、分類した各グループをそれぞれ別のパーティションに記憶するようにDB102を設計してもよい。図1の例では、DB102は、パーティションpt1、pt2に分割されている。
The DB 102 may be divided into a plurality of storage areas. The divided storage area is called “partition”. By dividing into partitions, the performance of the
ここで、ユーザが操作する端末からの命令は、データの操作や定義を行う問い合わせ言語の仕様に従ったデータである。問い合わせ言語としては、例えば、SQLが挙げられる。以下の記載では、ユーザが操作する端末からの命令を、SQLとして説明する。例えば、検索処理を行うSQLは、SELECT句から始まる構文となっており、SELECT文と呼ばれる。また、格納処理を行うSQLは、INSERT句から始まる構文となっており、INSERT文と呼ばれる。 Here, the command from the terminal operated by the user is data according to the specification of an inquiry language for performing data manipulation and definition. As an inquiry language, SQL is mentioned, for example. In the following description, a command from a terminal operated by a user will be described as SQL. For example, SQL for performing a search process has a syntax that starts with a SELECT phrase, and is called a SELECT statement. Also, the SQL that performs the storage process has a syntax that starts with the INSERT phrase, and is called an INSERT statement.
SQLの仕様の中には、DB102に対する検索処理を実行した実行結果に基づいて生成されるデータ群をDB102に格納することを示す構文がある。この構文に従ったSQLを実行することにより、DB102に格納されたデータを加工したデータを、DB102に格納することができる。このSQLは、INSERT句から始まり、途中でSELECT句が含まれる構文となっており、INSERT SELECT文と呼ばれる。
In the SQL specification, there is a syntax indicating that a data group generated based on an execution result of executing a search process on the
INSERT SELECT文を行うと、データベース制御装置101は、SELECT句以降のFROM句で指定されたテーブルからWHERE句で指定された条件に従ってレコードを検索する。そして、データベース制御装置101は、条件を満たしたレコード群に基づいて、SELECT句で指定された検索元のテーブルの列名や、算術演算子、グループ関数等の指定によって新たなレコード群を生成する。そして、データベース制御装置101は、生成されたレコード群を、INSERT句で指定されたテーブルに格納する。
When the INSERT SELECT statement is executed, the
しかしながら、INSERT SELECT文に従った処理を行う場合、生成されたレコード群をDB102に格納する格納処理に時間がかかる場合がある。具体的には、SELECT句によって生成されるレコード群を、1レコードずつパーティションに格納することになるため、生成されるレコード群が多くなると、格納処理にかかる時間が増大することになる。そこで、例えば、複数のプロセッサの各プロセッサが格納処理を並列に実行することにより、格納処理の高速化を図ることが考えられる。しかしながら、複数のプロセッサのそれぞれが独立してあるパーティションに格納しようとすると、あるプロセッサがデータをあるパーティションに格納している間は、整合性を保つために排他制御を行う。従って、他のプロセッサはロックを獲得できるまで待機することになり、格納処理が遅延することになる。
However, when processing according to the INSERT SELECT statement is performed, it may take time to store the generated record group in the
そこで、本実施の形態では、INSERT SELECT文について、SELECT句の処理と同一トランザクションとして各コアがINSERT句を実行する方法について説明する。 Therefore, in the present embodiment, a method will be described in which each core executes the INSERT phrase as the same transaction as the SELECT phrase processing for the INSERT SELECT statement.
図1を用いてデータベース制御装置101の動作例について説明する。データベース制御装置101は、複数のプロセッサとして、1つのプロセッサ・パッケージ内に複数のプロセッサコアを有する。または、データベース制御装置101は、複数のプロセッサコアの代わりに、複数のCPU(Central Processing Unit)を有してもよい。以下の記載では、プロセッサコアを、「コア」と称する。
An operation example of the
図1の(1)で示すように、データベース制御装置101に含まれる複数のコアのうちのいずれかのコアとして、コア#0は、INSERT SELECT文111を受け付ける。例えば、コア#0は、クライアント端末、Webサーバ等からINSERT SELECT文111を受け付ける。または、コア#0は、ストアドプロシージャを実行することにより、実行するストアドプロシージャに含まれるINSERT SELECT文111を取得してもよい。ここで、ストアドプロシージャは、DB102に対する一連の処理手続きを1つのプログラムとして、DB102に保存されたプログラムである。
As shown in (1) of FIG. 1, the
そして、図1の(2)で示すように、コア#0は、INSERT SELECT文111のSELECT句に従って検索処理112を実行し、検索処理112を実行した実行結果に基づいてレコード群rd1、rd2を生成する。また、コア#0は、検索処理112を自身で行わず、他のコアが検索処理を実行した実行結果を他のコアから取得して、取得した実行結果に基づいてレコード群rd1、rd2を生成してもよい。または、コア#0は、検索処理112および実行結果からのレコード群の生成を自身で行わず、他のコアが生成したレコード群rd1、rd2を取得してもよい。
Then, as shown in (2) of FIG. 1, the
次に、図1の(3)で示すように、コア#0は、レコード群rd1、rd2のそれぞれを、複数のコアのいずれかに割り当てる。図1の例では、コア#0は、レコードrd1をコア#1に割り当てるとともに、レコードrd2をコア#2に割り当てる。また、コア#0は、自身にレコードを割り当ててもよい。
Next, as indicated by (3) in FIG. 1, the
そして、図1の(4)で示すように、コア#0は、レコード群rdを割り当てる割当先コアとなるコア#1、#2に、割当先コアに割り当てたレコードをDB102に格納する格納処理113を実行する要求を送信する。ここで、コア#0は、検索処理112を同一のトランザクションに含まれる処理として実行するようにコア#1、#2に要求する。トランザクションとは、複数の処理を、一体不可分の処理として扱う方式のことである。図1では、同一のトランザクションとして扱う処理群を、破線で囲ってある。
Then, as shown by (4) in FIG. 1, the
要求を受信したコア#1、#2は、図1の(5)で示すように、受信した要求に従って、格納処理113を、検索処理112と同一のトランザクションに含まれる処理として実行する。図1の例では、コア#1は、格納処理113として、レコードrd1をパーティションpt1に格納する。また、コア#2は、格納処理113として、レコードrd2をパーティションpt1に格納する。ここで、コア#1で実行する格納処理113と、コア#2で実行する格納処理113とは、同一のトランザクションであるため、2つの格納処理113でデッドロックや排他待ちを発生させることがない。従って、データベース制御装置101は、並列処理による高速化を得ることができる。次に、データベース制御装置101をDB管理システムのDBサーバとして適用した例を、図2を用いて説明する。
The
図2は、DB管理システム200の構成例を示す説明図である。DB管理システム200は、データベース制御装置101と、クライアント端末201とを含む。DB管理システム200は、DBを管理し、DBに対するアクセスに応答するシステムである。データベース制御装置101と、クライアント端末201とは、ネットワーク202により接続される。
FIG. 2 is an explanatory diagram illustrating a configuration example of the
データベース制御装置101は、DB管理システム200を管理するコンピュータである。クライアント端末201は、データベース制御装置101にアクセスするコンピュータである。また、DB管理システム200は、図2で示した構成に限らない。例えば、DB管理システム200は、Webサーバを有し、データベース制御装置101は、WebサーバからDBに対するアクセスを受け付けてもよい。
The
(データベース制御装置101のハードウェア構成)
図3は、データベース制御装置101のハードウェア構成例を示す説明図である。図3において、データベース制御装置101は、CPU301と、ROM(Read−Only Memory)302と、RAM(Random Access Memory)303と、を含む。また、データベース制御装置101は、ディスクドライブ304およびディスク305と、通信インターフェース306と、を含む。また、CPU301〜ディスクドライブ304、通信インターフェース306はバス307によってそれぞれ接続される。ここで、ディスク305が、図1で示したDB102に相当する。また、データベース制御装置101は、通信インターフェース306を経由して、外部の装置となるDB102に接続してもよい。
(Hardware configuration of database control apparatus 101)
FIG. 3 is an explanatory diagram illustrating a hardware configuration example of the
CPU301は、データベース制御装置101の全体の制御を司る演算処理装置である。そして、CPU301は、複数のコアを有する。
The
ROM302は、ブートプログラムなどのプログラムを記憶する不揮発性メモリである。RAM303は、CPU301のワークエリアとして使用される揮発性メモリである。
The
ディスクドライブ304は、CPU301の制御に従ってディスク305に対するデータのリードおよびライトを制御する制御装置である。ディスクドライブ304には、例えば、磁気ディスクドライブ、光ディスクドライブ、ソリッドステートドライブなどを採用することができる。ディスク305は、ディスクドライブ304の制御で書き込まれたデータを記憶する不揮発性メモリである。例えばディスクドライブ304が磁気ディスクドライブである場合、ディスク305には、磁気ディスクを採用することができる。また、ディスクドライブ304が光ディスクドライブである場合、ディスク305には、光ディスクを採用することができる。また、ディスクドライブ304がソリッドステートドライブである場合、ディスク305には、半導体素子によって形成された半導体メモリ、いわゆる半導体ディスクを採用することができる。
The
通信インターフェース306は、ネットワーク203と内部のインターフェースを司り、他の装置からのデータの入出力を制御する制御装置である。具体的に、通信インターフェース306は、通信回線を通じてネットワーク203を介して他の装置に接続される。通信インターフェース306には、例えば、モデムやLANアダプタなどを採用することができる。
The
また、DB管理システム200の管理者が、データベース制御装置101を直接操作する場合、データベース制御装置101は、ディスプレイ、キーボード、マウスといったハードウェアを有してもよい。また、図示していないが、クライアント端末201も、データベース制御装置101が有するハードウェアと、ディスプレイ、キーボード、マウスといったハードウェアとを有する。
Further, when the administrator of the
(データベース制御装置101の機能構成例)
図4は、データベース制御装置101の機能構成例を示す説明図である。データベース制御装置101は、検索処理実行部401と、割当部402と、送信部403と、取得部404と、格納処理実行部405とを含む。制御部となる検索処理実行部401〜格納処理実行部405は、記憶装置に記憶されたプログラムをCPU301の各コアが実行することにより、各部の機能を実現する。記憶装置とは、具体的には、例えば、図3に示したROM302、RAM303、ディスク305などである。また、各部の処理結果は、CPU301の各コアのレジスタや、CPU301各コアのキャッシュメモリ、RAM303等に格納される。
(Functional configuration example of the database control apparatus 101)
FIG. 4 is an explanatory diagram illustrating a functional configuration example of the
また、検索処理実行部401〜送信部403は、リーダ実行体ldに含まれる。これに対し、取得部404、格納処理実行部405は、メンバ実行体mmに含まれる。リーダ実行体ldは、SELECT句の指定による検索処理を行い、パーティションに格納するレコードを分配する。また、メンバ実行体mmは、分配されたレコードをパーティションに格納する。検索処理実行部401〜格納処理実行部405は、データベース制御装置101の各コアが有しており、どのコアがリーダ実行体ldを実行してもよいし、どのコアがメンバ実行体mmを実行してもよい。また、リーダ実行体ldを実行するコアが、メンバ実行体mmを実行してもよい。図4の例では、コア#0がリーダ実行体ldを実行し、コア#1、#2がメンバ実行体mmを実行する例を示す。
The search
検索処理実行部401は、INSERT SELECT文111を受け付けたことに応じて、SELECT句に対応する検索処理112をトランザクションに含まれる処理として実行する。または、検索処理実行部401は、DB102に記憶されたストアドプロシージャが実行されたことにより、ストアドプロシージャに含まれるINSERT SELECT文を取得した際に、検索処理112をトランザクションに含まれる処理として実行してもよい。
In response to receiving the
割当部402は、INSERT SELECT文111内のSELECT句の実行結果となるレコード群のそれぞれを、複数のコアのいずれかに割り当てる。具体的には、割当部402は、割当先コアに対応するバッファを確保し、バッファにレコードを分散して格納していくことにより、レコード群のそれぞれを、複数のコアのいずれかに割り当てる。図4の例では、割当部402は、コア#1に割り当てるレコードをバッファb1に格納し、コア#2に割り当てるレコードを、バッファb2に格納する。
The
また、割当部402は、パーティションの数と複数のコアの数とのうちの少ない数分のコアに、データ群をそれぞれ分散して割り当ててもよい。
Further, the assigning
送信部403は、複数のコアのうちのレコード群のそれぞれを割り当てた割当先コアに、INSERT SELECT文111内のINSERT句に対応する格納処理113を、検索処理112のトランザクションに含まれる処理として実行する要求を送信する。
The
取得部404は、INSERT SELECT文111内のSELECT句の実行結果となるレコード群のそれぞれが複数のコアのいずれかに割り当てられたことに応じて、各コアに割り当てられたレコードを取得する。具体的には、取得部404は、各コアに対応するバッファから、各コアに割り当てられたレコードを取得する。図4の例では、コア#1の取得部404は、バッファb1からレコードを取得し、コア#2の取得部404は、バッファb2からレコードを取得する。
The
格納処理実行部405は、格納処理113を、検索処理112のトランザクションに含まれる処理として実行する。図4の例では、コア#1の格納処理実行部405は、格納処理113として、取得したレコードをパーティションpt1に格納したり、パーティションpt2に格納したりする。取得したレコードをどのパーティションに格納するかについての一例は、図6で説明する。
The storage
次に、リーダ実行体ldとメンバ実行体mmとの動作例を、図5、図6を用いて説明する。 Next, operation examples of the leader execution body ld and the member execution body mm will be described with reference to FIGS.
図5は、リーダ実行体ldとメンバ実行体mmとの動作例の一例を示す説明図(その1)である。また、図6は、リーダ実行体ldとメンバ実行体mmとの動作例の一例を示す説明図(その2)である。図5、図6では、パーティションの数が3であり、CPU301のコアの数が3以上あるものとし、メンバ実行体mmを3つ生成するものとする。
FIG. 5 is an explanatory diagram (part 1) illustrating an example of an operation example of the leader execution body ld and the member execution body mm. FIG. 6 is an explanatory diagram (part 2) illustrating an example of an operation example of the leader execution body ld and the member execution body mm. 5 and 6, it is assumed that the number of partitions is 3, the number of cores of the
図5、図6では、図5で示すSQL1をデータベース制御装置101がクライアント端末201から受け付けたとする。SQL1の内容は、「INSERT INTO T4 〜 SELECT 〜 FROM (SELECT 〜 FROM T1,T2) A LEFT OUTER JOIN 〜 T3 〜」である。ここで、SQL1は、テーブルT1、T2に対して図5のSELECT句502を行った結果を軸にして、テーブルT3を外部結合し、結合して得られたデータに対してSELECT句501を行った結果を、テーブルT4に格納することを示すSQLである。
5 and 6, it is assumed that the
リーダ実行体ldは、図5に示す(ld−1)のSELECTの処理として、テーブルT1のデータを記憶するパーティションpt1_1、1_2、1_3からスキャンして、条件に一致するレコードを生成する。このとき、リーダ実行体ldは、パーティションpt1_1、1_2、1_3から並列にスキャンする。リーダ実行体ldは、生成したデータを、ソートし、ソート結果st1に格納する。リーダ実行体ldは、図5に示す(ld−2)のSELECTの処理についても図5に示す(ld−1)のSELECTの処理と同様に処理を行い、実行結果を、ソート結果st2に格納する。 The reader execution body ld scans from the partitions pt1_1, 1_2, and 1_3 storing the data of the table T1 as the SELECT processing of (ld-1) shown in FIG. 5, and generates records that match the conditions. At this time, the leader executor ld scans in parallel from the partitions pt1_1, 1_2, and 1_3. The leader executor ld sorts the generated data and stores it in the sorting result st1. The leader executor ld also performs the processing of (ld-2) SELECT shown in FIG. 5 in the same manner as the processing of (ld-1) SELECT shown in FIG. 5, and stores the execution result in the sort result st2. To do.
次に、リーダ実行体ldは、図5に示す(ld−3)の処理として、T1の結果とT2の結果とをJOINする。リーダ実行体ldは、JOINした結果を、ソート結果st3に格納する。そして、リーダ実行体ldは、図5に示す(ld−4)のSELECTの処理についても図5に示す(ld−1)のSELECTの処理と同様に処理を行い、実行結果を、ソート結果st4に格納する。 Next, the leader execution body ld joins the result of T1 and the result of T2 as the process (ld-3) shown in FIG. The leader executor ld stores the result of the JOIN in the sort result st3. Then, the leader executor ld also performs the processing of (ld-4) SELECT shown in FIG. 5 in the same manner as the processing of (ld-1) SELECT shown in FIG. 5, and converts the execution result into the sort result st4. To store.
そして、リーダ実行体ldは、図5に示す(ld−5)の処理として、(ld−3)、(ld−4)の実行結果をJOINしながら、T4に並列にINSERTを行う。具体的には、リーダ実行体ldは、JOINしたレコードを、作業域wa_ldに格納する。格納後の処理は、図6で示す。 Then, the leader execution body ld performs INSERT in parallel with T4 while JOINing the execution results of (ld-3) and (ld-4) as the processing of (ld-5) shown in FIG. Specifically, the leader executor ld stores the joined record in the work area wa_ld. The processing after storage is shown in FIG.
図6において、リーダ実行体ldは、3つのメンバ実行体mm1、mm2、mm3用のバッファb1、b2、b3に、作業域wa_ldに格納されたレコードを蓄積し、メンバ実行体mm1〜3からの要求を待ち受ける。バッファb1、b2、b3は、リーダ実行体ldによって、メンバ実行体mmの数分用意されたものである。 In FIG. 6, the leader execution body ld accumulates the records stored in the work area wa_ld in the buffers b1, b2, and b3 for the three member execution bodies mm1, mm2, and mm3. Wait for a request. The buffers b1, b2, and b3 are prepared for the number of member execution bodies mm by the leader execution body ld.
具体的には、リーダ実行体ldは、まず、バッファb1にレコードを蓄積する。そして、リーダ実行体ldは、バッファb1に空き領域がなくなったら、バッファb2にレコードを蓄積する。さらに、リーダ実行体ldは、バッファb2に空き領域がなくなったら、バッファb3にレコードを蓄積し、バッファb3に空き領域がなくなったら、バッファb1にレコードを蓄積する。リーダ実行体ldは、これらの処理を、作業域wa_ldに格納されたレコードがなくなるまで繰り返す。図6の例では、リーダ実行体ldは、バッファb1にレコードrd1、2を格納し、バッファb2にレコードrd3、4を格納し、バッファb3にレコードrd5、6を格納する。 Specifically, the leader execution body ld first accumulates records in the buffer b1. The leader execution body ld accumulates records in the buffer b2 when there is no more free space in the buffer b1. Further, the leader executor ld accumulates records in the buffer b3 when there is no free area in the buffer b2, and accumulates records in the buffer b1 when there is no free area in the buffer b3. The leader executor ld repeats these processes until there are no more records stored in the work area wa_ld. In the example of FIG. 6, the leader executor ld stores records rd1 and 2 in the buffer b1, stores records rd3 and 4 in the buffer b2, and stores records rd5 and 6 in the buffer b3.
次に、各メンバ実行体mmの動作を説明する。メンバ実行体mm1〜mm3の動作は同一であるため、メンバ実行体mm1の動作を用いて説明する。メンバ実行体mm1は、図6に示す(mm−1)の処理として、リーダ実行体ldに対してレコードが蓄積されたバッファを要求し、図6の例では、バッファb1からレコードを取得する。レコードの取得が終わると、メンバ実行体mm1は、リーダ実行体ldに対して、バッファb1の解放を通知する。メンバ実行体mm1は、取得したレコードを、作業域wa_mm1に格納する。図6の例では、メンバ実行体mm1は、バッファb1から取得したレコードrd1、2を、作業域wa_mm1に格納する。 Next, the operation of each member execution body mm will be described. Since the operations of the member execution bodies mm1 to mm3 are the same, the operation of the member execution body mm1 will be described. The member execution body mm1 requests the buffer in which the record is stored to the leader execution body ld as the processing of (mm-1) shown in FIG. 6, and acquires the record from the buffer b1 in the example of FIG. When the acquisition of the record ends, the member execution body mm1 notifies the leader execution body ld of the release of the buffer b1. The member execution body mm1 stores the acquired record in the work area wa_mm1. In the example of FIG. 6, the member execution body mm1 stores the records rd1 and rd2 obtained from the buffer b1 in the work area wa_mm1.
そして、メンバ実行体mm1は、図6に示す(mm−2)の処理として、作業域wa_mm1に格納したレコードを、テーブルT4のデータを記憶するパーティションpt4_1、4_2、4_3のいずれかに格納する。例えば、メンバ実行体mm1は、レコードrd1をパーティションpt4_1に格納するとともに、レコードrd2をパーティションpt4_2に格納する。 Then, the member execution body mm1 stores the record stored in the work area wa_mm1 in any of the partitions pt4_1, 4_2, and 4_3 storing the data of the table T4 as the process (mm-2) illustrated in FIG. For example, the member execution body mm1 stores the record rd1 in the partition pt4_1 and stores the record rd2 in the partition pt4_2.
ここで、どのパーティションに格納するかについて、各パーティションは、格納するレコードのキーに基づいて、記憶するレコードを分散させている。例えば、パーティションpt4_1はキーの値が「1」から「3」までのレコードを記憶し、パーティションpt4_2はキーの値が「4」から「6」までのレコードを記憶し、パーティションpt4_3はキーの値が「7」から「9」までのレコードを記憶する。メンバ実行体mm1は、格納しようとするキーの値を参照して、パーティションpt4_1、4_2、4_3の中から格納先のパーティションを決定する。 Here, with respect to which partition to store, each partition distributes records to be stored based on the key of the record to be stored. For example, partition pt4_1 stores records whose key values are “1” to “3”, partition pt4_2 stores records whose key values are “4” to “6”, and partition pt4_3 stores key values. Stores records from “7” to “9”. The member execution body mm1 refers to the value of the key to be stored and determines a storage destination partition from among the partitions pt4_1, 4_2, and 4_3.
次に、本実施の形態におけるパーティションにおける格納例について、図7を用いて説明する。 Next, a storage example in the partition according to the present embodiment will be described with reference to FIG.
図7は、同一のトランザクションにおける格納の詳細例を示す説明図である。複数のメンバ実行体mmは、リーダ実行体ldと同一のトランザクションとして動作させることで、複数のメンバ実行体mmが、平行にレコードを格納しても、メンバ実行体mmの間でデッドロックや排他待ちになることが抑制される。 FIG. 7 is an explanatory diagram showing a detailed example of storage in the same transaction. A plurality of member execution bodies mm are operated as the same transaction as the leader execution body ld, so that even if a plurality of member execution bodies mm store records in parallel, deadlock or exclusion between member execution bodies mm Waiting is suppressed.
例えば、図7で示すように、メンバ実行体mm1は、図7に示す(1)、(3)、(5)の処理として、それぞれ、ページpg1、pg3、pg2にレコードrd1、rd3、rd5を格納する。また、メンバ実行体mm2は、図7に示す(2)、(4)の処理として、それぞれ、ページpg2、pg1にレコードrd2、rd4を格納する。ここで、メンバ実行体mm1、2は、同一のトランザクションに含まれるため、排他制御を行わず、同一ページに並列に格納することができる。 For example, as shown in FIG. 7, the member execution body mm1 stores records rd1, rd3, and rd5 in pages pg1, pg3, and pg2, respectively, as the processes (1), (3), and (5) shown in FIG. Store. The member execution body mm2 stores records rd2 and rd4 in pages pg2 and pg1, respectively, as the processes (2) and (4) shown in FIG. Here, since the member execution bodies mm1 and mm2 are included in the same transaction, they can be stored in parallel on the same page without performing exclusive control.
また、メンバ実行体mm1、2が同一のトランザクションに含まれるため、DBへの操作履歴を記憶するログファイルlgにも、1つのトランザクションとして記憶される。図7の例では、ログファイルlgには、ログ情報lg1〜lg5が記憶されている。例えば、ログ情報lg1は、レコードrd1をページpg1に格納したことを示す。そして、ログ情報lg1〜lg5は、1つのトランザクションとして記憶される。データベース制御装置101は、ロールバックする際も並列に格納しない場合と同じように、ログファイルlgを参照して、1つのトランザクションをロールバックするだけでよい。
Further, since the member execution bodies mm1 and mm2 are included in the same transaction, they are also stored as one transaction in the log file lg storing the operation history for the DB. In the example of FIG. 7, log information lg1 to lg5 is stored in the log file lg. For example, the log information lg1 indicates that the record rd1 is stored in the page pg1. The log information lg1 to lg5 is stored as one transaction. The
次に、仮に、異なるトランザクションで格納を行う場合の例について、図8を用いて説明する。 Next, a case where data is stored in different transactions will be described with reference to FIG.
図8は、異なるトランザクションにおける格納の詳細例を示す説明図である。図8では、データベース制御装置に含まれるメンバ実行体mm1、mm2を、リーダ実行体ldのトランザクションとは別のトランザクションとして動作させたものであるとする。この場合、ページ排他を行うと、メンバ実行体mmの間で排他を取り合うことになり、デッドロック状態が発生する場合がある。また、メンバ実行体mmごとの複数のトランザクションを1つにまとめることになる。 FIG. 8 is an explanatory diagram showing a detailed example of storage in different transactions. In FIG. 8, it is assumed that the member execution bodies mm1 and mm2 included in the database control apparatus are operated as a transaction different from the transaction of the leader execution body ld. In this case, when page exclusion is performed, the member execution bodies mm are mutually exclusive, and a deadlock state may occur. Further, a plurality of transactions for each member execution body mm are combined into one.
例えば、図8で示すように、メンバ実行体mm1は、図8に示す(1)、(3)、(5)の処理として、それぞれ、ページpg1、pg3、pg2にレコードrd1、rd3、rd5を格納する。また、メンバ実行体mm2は、図8に示す(2)、(4)の処理として、それぞれ、ページpg2、pg1にレコードrd4、rd2を格納しようとする。しかしながら、メンバ実行体mm1、2がそれぞれ別のトランザクションに含まれるため、メンバ実行体mm2は、メンバ実行体mm1がレコードrd1、rd3、rd5を格納したページpg1〜3にレコードrd2、rd4を格納することができない。 For example, as shown in FIG. 8, the member execution body mm1 stores records rd1, rd3, and rd5 in pages pg1, pg3, and pg2, respectively, as the processes (1), (3), and (5) shown in FIG. Store. Further, the member execution body mm2 tries to store the records rd4 and rd2 in the pages pg2 and pg1, respectively, as the processes (2) and (4) shown in FIG. However, since the member execution bodies mm1 and 2 are included in different transactions, the member execution body mm2 stores the records rd2 and rd4 in the pages pg1 to pg1 in which the member execution body mm1 stores the records rd1, rd3, and rd5. I can't.
また、メンバ実行体mm1、2がそれぞれ異なるトランザクションに含まれるため、ログファイルlgにも、メンバ実行体mm1、2が行った結果を示すログ情報lg1〜lg5が、異なるトランザクションとして記憶される。例えば、図8の例では、ログ情報lg1、lg3、lg5と、ログ情報lg2、lg4とが異なるトランザクションとして記憶される。従って、メンバ実行体mm間の関連性が不明となる。また、コミットログもトランザクションごとに別々に出力される。従って、この場合、データベース制御装置は、トランザクションを1つにまとめる処理を行うことになる。 Since the member execution bodies mm1 and mm2 are included in different transactions, log information lg1 to lg5 indicating the results of the member execution bodies mm1 and mm2 are also stored in the log file lg as different transactions. For example, in the example of FIG. 8, the log information lg1, lg3, lg5 and the log information lg2, lg4 are stored as different transactions. Therefore, the relationship between the member execution bodies mm is unknown. The commit log is also output separately for each transaction. Therefore, in this case, the database control apparatus performs processing for combining the transactions into one.
次に、図5〜図7で説明したINSERT SELECT文を受け付けた際に行う処理を示すフローチャートを、図9、図10を用いて説明する。 Next, a flowchart illustrating processing performed when the INSERT SELECT statement described in FIGS. 5 to 7 is received will be described with reference to FIGS. 9 and 10.
図9は、INSERT SELECT文受付時処理手順の一例を示すフローチャート(その1)である。また、図10は、INSERT SELECT文受付時処理手順の一例を示すフローチャート(その2)である。INSERT SELECT文処理は、INSERT SELECT文となるSQLを受け付けた際にデータベース制御装置101が実行する処理である。ここで、図10の説明において、メンバ実行体mmの処理内容は各メンバ実行体mmで同一であるため、メンバ実行体mm1を用いて説明を行い、他のメンバ実行体mmの動作の説明を省略する。
FIG. 9 is a flowchart (part 1) illustrating an example of a processing procedure when an INSERT SELECT statement is received. FIG. 10 is a flowchart (part 2) illustrating an example of the processing procedure at the time of receiving an INSERT SELECT statement. The INSERT SELECT statement process is a process executed by the
リーダ実行体ldは、トランザクションを開始する(ステップS901)。トランザクションを開始した後、リーダ実行体ldは、図5の(ld−1)〜(ld−4)で示したSELECT句の処理を開始する。 The leader executor ld starts a transaction (step S901). After starting the transaction, the leader executor ld starts processing of the SELECT phrase shown by (ld-1) to (ld-4) in FIG.
次に、リーダ実行体ldは、メンバ実行体mmを作成する(ステップS902)。また、リーダ実行体ldは、作成したメンバ実行体用のバッファbを獲得する(ステップS903)。次に、リーダ実行体ldは、パーティション数またはCPU301のコア数の少ない数分メンバ実行体mmを作成したか否かを判断する(ステップS904)。パーティション数またはCPU301のコア数の少ない数分メンバ実行体mmを作成していない場合(ステップS904:No)、リーダ実行体ldは、ステップS902の処理に移行する。
Next, the leader execution body ld creates a member execution body mm (step S902). Also, the leader execution body ld acquires the created buffer b for member execution bodies (step S903). Next, the leader executor ld determines whether or not the member executors mm have been created for the number of partitions or the number of cores of the
一方、パーティション数またはCPU301のコア数の少ない数分メンバ実行体mmを作成した場合(ステップS904:Yes)、リーダ実行体ldは、図5の(ld−1)の実行結果として作業域wa_ldに格納されたレコードを、メンバ実行体用のバッファbに蓄積する(ステップS1001)。次に、リーダ実行体ldは、各メンバ実行体mmに処理要求を送信する(ステップS1002)。
On the other hand, when the member execution body mm is created for the number of partitions or the number of cores of the
メンバ実行体mm1は、リーダ実行体ldからの通知を待ち受ける(ステップS1003)。次に、メンバ実行体mm1は、リーダ実行体ldからの通知内容を確認する(ステップS1004)。リーダ実行体ldからの通知内容として処理終了を受信した場合(ステップS1004:処理終了)、メンバ実行体mm1は、INSERT SELECT文受付時処理を終了する。 The member execution body mm1 waits for a notification from the leader execution body ld (step S1003). Next, the member execution body mm1 confirms the notification content from the leader execution body ld (step S1004). When the process end is received as the notification content from the leader execution body ld (step S1004: process end), the member execution body mm1 ends the INSERT SELECT statement reception process.
リーダ実行体ldからの通知内容として処理要求を受信した場合(ステップS1004:処理要求)、メンバ実行体mm1は、メンバ実行体用のバッファb1から、レコードを取得する(ステップS1005)。次に、メンバ実行体mm1は、取得したレコードを、該当するパーティションに格納する(ステップS1006)。そして、メンバ実行体mm1は、メンバ実行体のバッファb1にレコードがあるか否かを判断する(ステップS1007)。メンバ実行体のバッファb1にレコードがある場合(ステップS1007:Yes)、メンバ実行体mm1は、ステップS1005の処理に移行する。 When the processing request is received as the notification content from the leader execution body ld (step S1004: processing request), the member execution body mm1 acquires a record from the member execution body buffer b1 (step S1005). Next, the member execution body mm1 stores the acquired record in the corresponding partition (step S1006). Then, the member execution body mm1 determines whether or not there is a record in the buffer b1 of the member execution body (step S1007). If there is a record in the buffer b1 of the member execution body (step S1007: Yes), the member execution body mm1 proceeds to the process of step S1005.
一方、メンバ実行体のバッファにレコードがない場合(ステップS1007:No)、メンバ実行体mm1は、リーダ実行体に処理完了を通知する(ステップS1008)。そして、メンバ実行体mm1は、ステップS1003の処理に移行する。 On the other hand, when there is no record in the member execution body buffer (step S1007: No), the member execution body mm1 notifies the leader execution body of the completion of processing (step S1008). Then, the member execution body mm1 proceeds to the process of step S1003.
処理完了を受信したリーダ実行体ldは、作業域wa_ldにレコードがあるか否かを判断する(ステップS1009)。作業域wa_ldにレコードがある場合(ステップS1009:Yes)、リーダ実行体ldは、ステップS1001の処理に移行する。一方、作業域wa_ldにレコードがない場合(ステップS1009:No)、リーダ実行体ldは、トランザクションを終了する(ステップS1010)。次に、リーダ実行体ldは、全メンバ実行体に処理終了を通知する(ステップS1011)。そして、リーダ実行体ldは、INSERT SELECT文受付時処理を終了する。 The leader executor ld that has received the processing completion determines whether or not there is a record in the work area wa_ld (step S1009). If there is a record in the work area wa_ld (step S1009: Yes), the leader executor ld proceeds to the process of step S1001. On the other hand, when there is no record in the work area wa_ld (step S1009: No), the leader executor ld ends the transaction (step S1010). Next, the leader executor ld notifies all member executors of the end of processing (step S1011). Then, the leader executor ld ends the INSERT SELECT statement reception process.
INSERT SELECT文受付時処理を実行することにより、データベース制御装置101は、各メンバ実行体mmを、同一トランザクションに含めて実行することができるので、排他による待ち等を抑制して効率的に格納処理を行うことができる。
By executing the INSERT SELECT statement reception process, the
以上説明したように、INSERT SELECT文について、リーダ実行体ldは、SELECT句の処理と同一トランザクションとしてメンバ実行体mmにINSERT句を実行させる。これにより、メンバ実行体mmは、同一のトランザクションなので排他が発生せず、並列実行による高速化を得ることができる。 As described above, for the INSERT SELECT statement, the leader executor ld causes the member executor mm to execute the INSERT phrase as the same transaction as the SELECT phrase processing. Thereby, since the member execution body mm is the same transaction, exclusion does not occur, and speeding up by parallel execution can be obtained.
また、リーダ実行体ldは、パーティションの数と複数のコアの数とのうちの少ない数分のコアに、データ群をそれぞれ分散して割り当ててもよい。これにより、データベース制御装置101は、並列可能な最大数でINSERT SELECT文を実行することができる。
Further, the leader executor ld may distribute and assign the data group to a small number of cores out of the number of partitions and the number of cores. Thereby, the
また、リーダ実行体ldは、いずれかのコアがINSERT SELECT文を受け付けたことに応じて、SELECT句に対応する検索処理を、INSERT句に対応する格納処理と同一のトランザクションに含まれる処理として実行してもよい。このように動作させることにより、データベース制御装置101は、SELECT句に対応する検索処理と、INSERT句に対応する格納処理とが同一のトランザクションとなることを担保することができる。
Further, the reader executor ld executes a search process corresponding to the SELECT phrase as a process included in the same transaction as the storage process corresponding to the INSERT phrase in response to any core accepting the INSERT SELECT statement. May be. By operating in this way, the
また、リーダ実行体ldを、複数のコアのうちのどのコアが行ってもよい。例えば、データベース制御装置101は、複数のコアのうちの負荷が最も少ないコアがリーダ実行体ldを実行してもよい。これにより、データベース制御装置101は、例えば、負荷が少ないコアがリーダ実行体ldを実行することにより、負荷分散を図ることができる。
In addition, any of the plurality of cores may perform the leader execution body ld. For example, in the
また、メンバ実行体mmは、複数のコアの各コアに、INSERT句に対応する格納処理を、SELECT句に対応する検索処理と同一のトランザクションとして実行させてもよい。これにより、メンバ実行体mmではデッドロックや排他待ちを発生することがないため、データベース制御装置101は、高速化を図ることができる。
Further, the member execution body mm may cause each of a plurality of cores to execute the storage process corresponding to the INSERT phrase as the same transaction as the search process corresponding to the SELECT phrase. As a result, the member execution body mm does not cause deadlock or waiting for exclusion, so that the
なお、本実施の形態で説明したデータベース制御方法は、予め用意されたプログラムをパーソナル・コンピュータやワークステーション等のコンピュータで実行することにより実現することができる。本データベース制御プログラムは、ハードディスク、フレキシブルディスク、CD−ROM(Compact Disc−Read Only Memory)、DVD(Digital Versatile Disk)等のコンピュータで読み取り可能な記録媒体に記録され、コンピュータによって記録媒体から読み出されることによって実行される。また本データベース制御プログラムは、インターネット等のネットワークを介して配布してもよい。 The database control method described in this embodiment can be realized by executing a program prepared in advance on a computer such as a personal computer or a workstation. The database control program is recorded on a computer-readable recording medium such as a hard disk, a flexible disk, a CD-ROM (Compact Disc-Read Only Memory), a DVD (Digital Versatile Disk), and is read from the recording medium by the computer. Executed by. The database control program may be distributed through a network such as the Internet.
上述した実施の形態に関し、さらに以下の付記を開示する。 The following additional notes are disclosed with respect to the embodiment described above.
(付記1)コンピュータに、
データベースに対する検索処理をトランザクションに含まれる処理として実行した実行結果に基づいて生成されるデータ群のそれぞれを、前記データベースにアクセス可能な複数のプロセッサのいずれかに割り当て、
前記複数のプロセッサのうちの前記データ群のそれぞれを割り当てた割当先プロセッサに、前記割当先プロセッサに割り当てたデータを前記データベースに格納する格納処理を前記トランザクションに含まれる処理として実行する要求を送信する、
処理を実行させることを特徴とするデータベース制御プログラム。
(Supplementary note 1)
Assigning each of the data groups generated based on the execution result of executing the search process for the database as the process included in the transaction to any of a plurality of processors accessible to the database;
A request for executing storage processing for storing data allocated to the allocation destination processor in the database as processing included in the transaction is transmitted to the allocation destination processor to which each of the data groups of the plurality of processors is allocated. ,
A database control program for executing a process.
(付記2)前記データベースは、複数の記憶領域に分割されており、
前記割り当てる処理は、
前記複数の記憶領域の数と前記複数のプロセッサの数とのうちの少ない数分のプロセッサに、前記データ群をそれぞれ分散して割り当てる、
ことを特徴とする付記1に記載のデータベース制御プログラム。
(Appendix 2) The database is divided into a plurality of storage areas,
The assigning process is:
The data group is distributed and allocated to a small number of processors among the number of the plurality of storage areas and the number of the plurality of processors, respectively.
The database control program according to
(付記3)前記複数のプロセッサのいずれかのプロセッサに、前記割り当てる処理と前記送信する処理とを実行させることを特徴とする付記1または2に記載のデータベース制御プログラム。
(Supplementary note 3) The database control program according to
(付記4)前記いずれかのプロセッサに、
前記データベースに対する検索処理の実行結果に基づいて生成されるデータ群を前記データベースに格納することを示す命令を受け付けたことに応じて、前記検索処理を前記トランザクションに含まれる処理として実行する、処理を実行させ、
前記割り当てる処理は、
実行した前記検索処理の実行結果に基づいて生成されたデータ群のそれぞれを、前記複数のプロセッサのいずれかに割り当てる、
ことを特徴とする付記3に記載のデータベース制御プログラム。
(Supplementary Note 4)
Executing the search process as a process included in the transaction in response to receiving an instruction indicating that a data group generated based on the execution result of the search process for the database is stored in the database; Let it run
The assigning process is:
Assigning each of the data groups generated based on the execution result of the executed search process to any of the plurality of processors;
The database control program according to
(付記5)データベースにアクセス可能な複数のプロセッサに含まれるプロセッサに、
前記データベースに対する検索処理をトランザクションに含まれる処理として実行した実行結果に基づいて生成されるデータ群のいずれかのデータが前記プロセッサに割り当てられたことに応じて、前記データを取得し、
取得した前記データを前記データベースに格納する格納処理を、前記トランザクションに含まれる処理として実行する、
処理を実行させることを特徴とするデータベース制御プログラム。
(Supplementary Note 5) In a processor included in a plurality of processors that can access a database,
In response to the fact that any data in the data group generated based on the execution result of executing the search process for the database as a process included in the transaction is assigned to the processor, the data is acquired,
A storage process for storing the acquired data in the database is executed as a process included in the transaction.
A database control program for executing a process.
(付記6)データベースにアクセス可能な複数のプロセッサを有するデータベース制御装置であって、
前記データベースに対する検索処理をトランザクションに含まれる処理として実行した実行結果に基づいて生成されたデータ群のそれぞれを、前記複数のプロセッサのいずれかに割り当て、
前記複数のプロセッサのうちの前記データ群のそれぞれを割り当てた割当先プロセッサに、前記割当先プロセッサに割り当てたデータを前記データベースに格納する格納処理を前記トランザクションに含まれる処理として実行する要求を送信する、
制御部を特徴とするデータベース制御装置。
(Supplementary note 6) A database control apparatus having a plurality of processors capable of accessing a database,
Each of the data groups generated based on the execution result of executing the search process for the database as a process included in a transaction is assigned to any of the plurality of processors,
A request for executing storage processing for storing data allocated to the allocation destination processor in the database as processing included in the transaction is transmitted to the allocation destination processor to which each of the data groups of the plurality of processors is allocated. ,
A database control device characterized by a control unit.
(付記7)データベースにアクセス可能な複数のプロセッサを有するデータベース制御装置であって、
前記複数のプロセッサに含まれるプロセッサは、
前記データベースに対する検索処理をトランザクションに含まれる処理として実行した実行結果に基づいて生成されたデータ群のいずれかのデータが前記プロセッサに割り当てられたことに応じて、前記データを取得し、
取得した前記データを前記データベースに格納する格納処理を、前記トランザクションに含まれる処理として実行する、
ことを特徴とするデータベース制御装置。
(Supplementary note 7) A database control apparatus having a plurality of processors capable of accessing a database,
The processors included in the plurality of processors are:
In response to the fact that any data in the data group generated based on the execution result of executing the search process for the database as a process included in the transaction is assigned to the processor, the data is acquired,
A storage process for storing the acquired data in the database is executed as a process included in the transaction.
A database control apparatus characterized by that.
(付記8)データベースにアクセス可能な複数のプロセッサを有するデータベース制御装置であって、
前記複数のプロセッサのいずれかのプロセッサは、
前記データベースに対する検索処理をトランザクションに含まれる処理として実行した実行結果に基づいて生成されたデータ群のそれぞれを、前記複数のプロセッサのいずれかに割り当て、
前記複数のプロセッサのうちの前記データ群のそれぞれを割り当てた割当先プロセッサに、前記割当先プロセッサに割り当てたデータを前記データベースに格納する格納処理を前記トランザクションに含まれる処理として実行する要求を送信し、
前記複数のプロセッサに含まれるプロセッサは、
前記要求を前記いずれかのプロセッサから受信したことに応じて、前記プロセッサに割り当てられたデータを取得し、
取得した前記データを前記データベースに格納する格納処理を、前記トランザクションに含まれる処理として実行する、
ことを特徴とするデータベース制御装置。
(Supplementary note 8) A database control apparatus having a plurality of processors capable of accessing a database,
One of the plurality of processors is
Each of the data groups generated based on the execution result of executing the search process for the database as a process included in a transaction is assigned to any of the plurality of processors,
A request to execute storage processing for storing the data allocated to the allocation destination processor in the database as processing included in the transaction is transmitted to the allocation destination processor to which each of the data groups of the plurality of processors is allocated. ,
The processors included in the plurality of processors are:
In response to receiving the request from any of the processors, obtaining data assigned to the processor;
A storage process for storing the acquired data in the database is executed as a process included in the transaction.
A database control apparatus characterized by that.
(付記9)コンピュータが、
データベースに対する検索処理をトランザクションに含まれる処理として実行した実行結果に基づいて生成されるデータ群のそれぞれを、データベースにアクセス可能な複数のプロセッサのいずれかに割り当て、
前記複数のプロセッサのうちの前記データ群のそれぞれを割り当てた割当先プロセッサに、前記割当先プロセッサに割り当てたデータを前記データベースに格納する格納処理を前記トランザクションに含まれる処理として実行する要求を送信する、
処理を実行することを特徴とするデータベース制御方法。
(Supplementary note 9)
Assign each of the data group generated based on the execution result of executing the search process for the database as a process included in the transaction to one of the multiple processors that can access the database,
A request for executing storage processing for storing data allocated to the allocation destination processor in the database as processing included in the transaction is transmitted to the allocation destination processor to which each of the data groups of the plurality of processors is allocated. ,
The database control method characterized by performing a process.
(付記10)データベースにアクセス可能な複数のプロセッサに含まれるプロセッサが、
前記データベースに対する検索処理をトランザクションに含まれる処理として実行した実行結果に基づいて生成されるデータ群のいずれかのデータが前記プロセッサに割り当てられたことに応じて、前記データを取得し、
取得した前記データを前記データベースに格納する格納処理を、前記トランザクションに含まれる処理として実行する、
処理を実行することを特徴とするデータベース制御方法。
(Supplementary Note 10) A processor included in a plurality of processors capable of accessing a database is
In response to the fact that any data in the data group generated based on the execution result of executing the search process for the database as a process included in the transaction is assigned to the processor, the data is acquired,
A storage process for storing the acquired data in the database is executed as a process included in the transaction.
The database control method characterized by performing a process.
#0〜#2 コア
101 データベース制御装置
102 DB
111 INSERT SELECT文
401 検索処理実行部
402 割当部
403 送信部
404 取得部
405 格納処理実行部
# 0 to # 2
111
Claims (9)
データベースに対する検索処理をトランザクションに含まれる処理として実行した実行結果に基づいて生成されるデータ群のそれぞれを、前記データベースにアクセス可能な複数のプロセッサのいずれかに割り当て、
前記複数のプロセッサのうちの前記データ群のそれぞれを割り当てた割当先プロセッサに、前記割当先プロセッサに割り当てたデータを前記データベースに格納する格納処理を前記トランザクションに含まれる処理として実行する要求を送信する、
処理を実行させることを特徴とするデータベース制御プログラム。 On the computer,
Assigning each of the data groups generated based on the execution result of executing the search process for the database as the process included in the transaction to any of a plurality of processors accessible to the database;
A request for executing storage processing for storing data allocated to the allocation destination processor in the database as processing included in the transaction is transmitted to the allocation destination processor to which each of the data groups of the plurality of processors is allocated. ,
A database control program for executing a process.
前記割り当てる処理は、
前記複数の記憶領域の数と前記複数のプロセッサの数とのうちの少ない数分のプロセッサに、前記データ群をそれぞれ分散して割り当てる、
ことを特徴とする請求項1に記載のデータベース制御プログラム。 The database is divided into a plurality of storage areas,
The assigning process is:
The data group is distributed and allocated to a small number of processors among the number of the plurality of storage areas and the number of the plurality of processors, respectively.
The database control program according to claim 1.
前記データベースに対する検索処理の実行結果に基づいて生成されるデータ群を前記データベースに格納することを示す命令を受け付けたことに応じて、前記検索処理を前記トランザクションに含まれる処理として実行する、処理を実行させ、
前記割り当てる処理は、
実行した前記検索処理の実行結果に基づいて生成されたデータ群のそれぞれを、前記複数のプロセッサのいずれかに割り当てる、
ことを特徴とする請求項3に記載のデータベース制御プログラム。 In any of the processors,
Executing the search process as a process included in the transaction in response to receiving an instruction indicating that a data group generated based on the execution result of the search process for the database is stored in the database; Let it run
The assigning process is:
Assigning each of the data groups generated based on the execution result of the executed search process to any of the plurality of processors;
The database control program according to claim 3.
前記データベースに対する検索処理をトランザクションに含まれる処理として実行した実行結果に基づいて生成されるデータ群のいずれかのデータが前記プロセッサに割り当てられたことに応じて、前記データを取得し、
取得した前記データを前記データベースに格納する格納処理を、前記トランザクションに含まれる処理として実行する、
処理を実行させることを特徴とするデータベース制御プログラム。 In a processor included in multiple processors that can access the database,
In response to the fact that any data in the data group generated based on the execution result of executing the search process for the database as a process included in the transaction is assigned to the processor, the data is acquired,
A storage process for storing the acquired data in the database is executed as a process included in the transaction.
A database control program for executing a process.
前記データベースに対する検索処理をトランザクションに含まれる処理として実行した実行結果に基づいて生成されたデータ群のそれぞれを、前記複数のプロセッサのいずれかに割り当て、
前記複数のプロセッサのうちの前記データ群のそれぞれを割り当てた割当先プロセッサに、前記割当先プロセッサに割り当てたデータを前記データベースに格納する格納処理を前記トランザクションに含まれる処理として実行する要求を送信する、
制御部を特徴とするデータベース制御装置。 A database controller having a plurality of processors capable of accessing a database,
Each of the data groups generated based on the execution result of executing the search process for the database as a process included in a transaction is assigned to any of the plurality of processors,
A request for executing storage processing for storing data allocated to the allocation destination processor in the database as processing included in the transaction is transmitted to the allocation destination processor to which each of the data groups of the plurality of processors is allocated. ,
A database control device characterized by a control unit.
前記複数のプロセッサに含まれるプロセッサは、
前記データベースに対する検索処理をトランザクションに含まれる処理として実行した実行結果に基づいて生成されたデータ群のいずれかのデータが前記プロセッサに割り当てられたことに応じて、前記データを取得し、
取得した前記データを前記データベースに格納する格納処理を、前記トランザクションに含まれる処理として実行する、
ことを特徴とするデータベース制御装置。 A database controller having a plurality of processors capable of accessing a database,
The processors included in the plurality of processors are:
In response to the fact that any data in the data group generated based on the execution result of executing the search process for the database as a process included in the transaction is assigned to the processor, the data is acquired,
A storage process for storing the acquired data in the database is executed as a process included in the transaction.
A database control apparatus characterized by that.
データベースに対する検索処理をトランザクションに含まれる処理として実行した実行結果に基づいて生成されるデータ群のそれぞれを、前記データベースにアクセス可能な複数のプロセッサのいずれかに割り当て、
前記複数のプロセッサのうちの前記データ群のそれぞれを割り当てた割当先プロセッサに、前記割当先プロセッサに割り当てたデータを前記データベースに格納する格納処理を前記トランザクションに含まれる処理として実行する要求を送信する、
処理を実行することを特徴とするデータベース制御方法。 Computer
Assigning each of the data groups generated based on the execution result of executing the search process for the database as the process included in the transaction to any of a plurality of processors accessible to the database;
A request for executing storage processing for storing data allocated to the allocation destination processor in the database as processing included in the transaction is transmitted to the allocation destination processor to which each of the data groups of the plurality of processors is allocated. ,
The database control method characterized by performing a process.
前記データベースに対する検索処理をトランザクションに含まれる処理として実行した実行結果に基づいて生成されるデータ群のいずれかのデータが前記プロセッサに割り当てられたことに応じて、前記データを取得し、
取得した前記データを前記データベースに格納する格納処理を、前記トランザクションに含まれる処理として実行する、
処理を実行することを特徴とするデータベース制御方法。 Processors included in multiple processors that can access the database
In response to the fact that any data in the data group generated based on the execution result of executing the search process for the database as a process included in the transaction is assigned to the processor, the data is acquired,
A storage process for storing the acquired data in the database is executed as a process included in the transaction.
The database control method characterized by performing a process.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2016004655A JP2017126172A (en) | 2016-01-13 | 2016-01-13 | Database control program, database control apparatus, and database control method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2016004655A JP2017126172A (en) | 2016-01-13 | 2016-01-13 | Database control program, database control apparatus, and database control method |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2017126172A true JP2017126172A (en) | 2017-07-20 |
Family
ID=59364334
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2016004655A Pending JP2017126172A (en) | 2016-01-13 | 2016-01-13 | Database control program, database control apparatus, and database control method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2017126172A (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2022029319A (en) * | 2020-08-04 | 2022-02-17 | 株式会社三菱Ufj銀行 | System and program |
| CN114461617A (en) * | 2021-12-24 | 2022-05-10 | 河南信大网御科技有限公司 | A method and system for designing database of mimic executive body |
| JP2023541367A (en) * | 2020-09-17 | 2023-10-02 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Efficient bulk loading of multiple rows or partitions to a single target table |
-
2016
- 2016-01-13 JP JP2016004655A patent/JP2017126172A/en active Pending
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2022029319A (en) * | 2020-08-04 | 2022-02-17 | 株式会社三菱Ufj銀行 | System and program |
| JP2023541367A (en) * | 2020-09-17 | 2023-10-02 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Efficient bulk loading of multiple rows or partitions to a single target table |
| CN114461617A (en) * | 2021-12-24 | 2022-05-10 | 河南信大网御科技有限公司 | A method and system for designing database of mimic executive body |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP6542909B2 (en) | File operation method and apparatus | |
| JP5932043B2 (en) | Volatile memory representation of non-volatile storage set | |
| US8799267B2 (en) | Optimizing storage allocation | |
| US10826980B2 (en) | Command process load balancing system | |
| US9652291B2 (en) | System and method utilizing a shared cache to provide zero copy memory mapped database | |
| US9898469B1 (en) | Parallel streaming of external data | |
| JP4801761B2 (en) | Database management method and system, and processing program therefor | |
| US20170228422A1 (en) | Flexible task scheduler for multiple parallel processing of database data | |
| JP6823626B2 (en) | Database management system and method | |
| CN114116189A (en) | Task processing method and device and computing equipment | |
| JP4571609B2 (en) | Resource allocation method, resource allocation program, and management computer | |
| WO2023040348A1 (en) | Data processing method in distributed system, and related system | |
| JP2017126172A (en) | Database control program, database control apparatus, and database control method | |
| US20210349918A1 (en) | Methods and apparatus to partition a database | |
| JP2014056425A (en) | Data management device, data management system, process allocation method, and process allocation program | |
| CN113138841B (en) | A resource scheduling method and a resource scheduling system | |
| US20090207521A1 (en) | Techniques for improving parallel scan operations | |
| JP6210501B2 (en) | Database management system, computer, database management method | |
| JP6811251B2 (en) | Data processing device and data processing method | |
| WO2024239657A1 (en) | Resource scheduling method, scheduler, data processing system, and related device | |
| Chang et al. | Optimized multiple platforms for big data analysis | |
| WO2019008715A1 (en) | Data loading program, data loading method, and data loading device | |
| JP2017126173A (en) | Database control program, database control device, and database control method | |
| JP6445876B2 (en) | Resource allocation device, resource allocation system, and resource allocation method | |
| CN116450055B (en) | Method and system for distributing storage area between multi-processing cards |