JP2015026396A - Database management system and method - Google Patents

Database management system and method Download PDF

Info

Publication number
JP2015026396A
JP2015026396A JP2014224023A JP2014224023A JP2015026396A JP 2015026396 A JP2015026396 A JP 2015026396A JP 2014224023 A JP2014224023 A JP 2014224023A JP 2014224023 A JP2014224023 A JP 2014224023A JP 2015026396 A JP2015026396 A JP 2015026396A
Authority
JP
Japan
Prior art keywords
task
data
query
database
execution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2014224023A
Other languages
Japanese (ja)
Inventor
喜連川 優
Masaru Kiregawa
優 喜連川
和生 合田
Kazuo Aida
和生 合田
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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to JP2014224023A priority Critical patent/JP2015026396A/en
Publication of JP2015026396A publication Critical patent/JP2015026396A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To shorten a time to be spent on the execution of one query.SOLUTION: A database management system includes: a query acceptance part 7 for accepting a query; and a query execution part 9 for executing the accepted query. The query execution part 9 dynamically generates a task, and executes the generated tasks in parallel. In the case of executing each task, the query execution part 9 generates the task for acquiring the data each time the data of the database are required, and in the case of executing the generated tasks, issues a data reading request for reading the data from the database as necessary.

Description

本発明は、データベース管理技術に関わる。   The present invention relates to database management technology.

例えば、特開2004−192292号公報には、バーチャリゼーション環境上にDB(データベース)を構築したシステムにおける管理サーバが開示されている。その管理サーバは、DBMS(データベース管理システム)からDB処理の実行計画や処理優先度等のDB処理情報を取得し、その情報を基にこれからアクセスが行われるデータとそのアクセス順を予測し、予測結果に基づいて近い将来アクセスが行われるデータを記憶装置のキャッシュ上に読み出すよう指示し、最も近い将来にアクセスが行われるデータを自サーバのキャッシュメモリに読み出す。   For example, Japanese Unexamined Patent Application Publication No. 2004-192292 discloses a management server in a system in which a DB (database) is built on a virtualization environment. The management server obtains DB processing information such as an execution plan and processing priority of DB processing from a DBMS (database management system), predicts data to be accessed and the order of access based on the information, and makes predictions Based on the result, an instruction is given to read the data to be accessed in the near future onto the cache of the storage device, and the data to be accessed in the near future is read into the cache memory of the own server.

特開2004−192292号公報JP 2004-192292 A

ところで、通常、DBMSは、クエリを受け付け、クエリを受け付けた場合には、そのクエリを実行してその実行結果を出力するようになっている。クエリの実行結果を出力するまでには、複数段階のデータベースオペレーションが実行される場合がある。それら複数段階のデータベースオペレーションは、一般に、所定の順序で実行されるようになっており、それら複数段階のデータベースオペレーションのうちの少なくとも一つのデータベースオペレーションでは、記憶装置に対して読出し要求を発行する必要のある場合がある。以下、図1A〜図1Cを参照して一つの具体例を説明する。   By the way, the DBMS normally accepts a query, and when a query is accepted, the DBMS executes the query and outputs the execution result. There are cases where a multi-stage database operation is executed before the execution result of the query is output. These multi-stage database operations are generally executed in a predetermined order, and at least one of the multi-stage database operations requires issuing a read request to the storage device. There may be. Hereinafter, one specific example will be described with reference to FIGS. 1A to 1C.

例えば、DBMSが、DBMSの上位にあるコンピュータプログラム(例えばアプリケーションプログラム)からクエリを受け付けた場合に、そのクエリの実行プラン(以下、単に「クエリプラン」と言う)として、図1Aに記載のクエリプランを生成したとする。そして、図1Bに記載のパート表23A、ラインアイテム表23B、オーダ表23C及び各種インデックス25が、記憶装置(例えば、DBMSを備えた情報処理端末に通信可能に接続された外部記憶装置)に格納されているとする。   For example, when a DBMS receives a query from a computer program (for example, an application program) that is above the DBMS, the query plan shown in FIG. 1A is used as an execution plan for the query (hereinafter simply referred to as “query plan”). Is generated. Then, the part table 23A, the line item table 23B, the order table 23C, and various indexes 25 illustrated in FIG. 1B are stored in a storage device (for example, an external storage device communicably connected to an information processing terminal equipped with a DBMS). Suppose that

図1Aに例示したクエリプランによれば、パート表23Aから未読の行がなくなるまで、データベースオペレーション(以下、「OP」と略記)1〜5が繰り返される。OP1は、初期データベースオペレーションであり、パート表23A(図1B参照)から1行読む処理である。OP2は、読まれた行中のPIDに対応するラインアイテム表23B(図1B参照)のポインタ(rowid)をラインアイテムインデックス25Aで検索する処理である。OP3は、得られたポインタでラインアイテム表23Bをフェッチし、OIDでフィルタをかける処理(例えば、OIDが504未満のもののみを出力する処理)である。OP4は、出力されたOIDに対応するオーダ表23C(図1B参照)のポインタ(rowid)をオーダインデックス25Bで検索する処理である。OP5は、得られたポインタでオーダ表23Cをフェッチし、結果としてリターンする処理である。以上のようなOP1〜OP5が繰り返されることにより、図1Cに例示するようなクエリ実行結果を、クエリの発行元のコンピュータプログラムに返すことができる。   According to the query plan illustrated in FIG. 1A, database operations (hereinafter abbreviated as “OP”) 1 to 5 are repeated until there are no unread rows in the part table 23A. OP1 is an initial database operation and is a process of reading one line from the part table 23A (see FIG. 1B). OP2 is a process for searching the line item index 25A for the pointer (rowid) of the line item table 23B (see FIG. 1B) corresponding to the PID in the read row. OP3 is a process of fetching the line item table 23B with the obtained pointer and filtering with the OID (for example, a process of outputting only those with an OID of less than 504). OP4 is a process of searching the order index 25B for a pointer (rowid) of the order table 23C (see FIG. 1B) corresponding to the output OID. OP5 is a process of fetching the order table 23C with the obtained pointer and returning as a result. By repeating OP1 to OP5 as described above, the query execution result illustrated in FIG. 1C can be returned to the computer program that issued the query.

上記のようにして一つのクエリを実行する場合には、複数のOPが繰り返し実行され、且つ、各回の実行において、一つのOPが終了してから次のOPが開始される。このため、例えば、或るOP(例えばOP3)において、読出し要求が発行された場合には、その読出し要求に応答してデータが読み出されるまで処理が中断してしまう。故に、一つのクエリの実行に要する時間が長くなってしまう。   When one query is executed as described above, a plurality of OPs are repeatedly executed, and in each execution, one OP ends and the next OP starts. For this reason, for example, when a read request is issued in a certain OP (for example, OP3), the processing is interrupted until data is read in response to the read request. Therefore, it takes a long time to execute one query.

また、上記のようにして一つのクエリを実行する場合には、記憶装置をランダムアクセスすることがある。具体的には、ラインアイテム表23B、オーダ表23C及びインデックスの読み込みがランダムになってしまうことがある。より具体的には、例えば、ラインアイテム表23Bの一行目にアクセスした後、6行目及び9行目もパート表23Aの行に対応した行であるにも関わらず、一旦12行目にアクセスした後に、6行目へのアクセスが行われてしまう。一つのクエリの実行の際、DBMSから読出し要求が複数回発行されることになるが、上記のようなランダムアクセスが行われると、全体としてのデータ読出し待ち時間が長くなってしまう。   Further, when one query is executed as described above, the storage device may be randomly accessed. Specifically, the reading of the line item table 23B, the order table 23C, and the index may be random. More specifically, for example, after accessing the first line of the line item table 23B, the sixth line and the ninth line are temporarily accessed to the twelfth line even though the sixth line and the ninth line correspond to the lines of the part table 23A. After that, the 6th line is accessed. When executing one query, a read request is issued a plurality of times from the DBMS. However, if random access as described above is performed, the data read waiting time as a whole becomes long.

従って、本発明の一つの目的は、一つのクエリの実行に要する時間を短縮化することにある。具体的には、例えば、一つのクエリの実行における全体としてのデータ読出し待ち時間を短縮化することにある。   Therefore, one object of the present invention is to shorten the time required to execute one query. Specifically, for example, the entire data read waiting time in executing one query is shortened.

本発明の他の目的は、後述の説明から明らかになるであろう。   Other objects of the present invention will become clear from the following description.

本発明の一つの観点に従うデータベース管理システムは、クエリを受け付けるクエリ受付部と、前記受け付けたクエリを実行し、その際、必要に応じて、記憶装置(例えば主記憶装置)からデータベースのデータを読み出すためのデータ読出し要求を発行するクエリ実行部とを備える。前記クエリ実行部は、動的にタスクを生成していき、生成された複数のタスクを並行して実行する。前記クエリ実行部は、各タスクの実行において、前記データベースのデータを必要とする都度に、そのデータを取得するためのタスクを生成する。また、前記クエリ実行部は、該生成されたタスクの実行において、必要に応じて、前記データベースからデータを読み出すための前記データ読出し要求を発行する。   A database management system according to one aspect of the present invention executes a query reception unit that receives a query and the received query, and reads data in a database from a storage device (for example, a main storage device) as necessary. A query execution unit that issues a data read request for the data read. The query execution unit dynamically generates tasks and executes the generated tasks in parallel. The query execution unit generates a task for acquiring the data every time the data of the database is required in the execution of each task. In addition, the query execution unit issues the data read request for reading data from the database, as necessary, in executing the generated task.

このデータベース管理システムの具体例としては、以下の通りである。すなわち、データベース管理システムは、上位のコンピュータプログラム(例えば、アプリケーションプログラム)からクエリ(例えばSQL)を受け付けるクエリ受付部と、該受け付けたクエリを実行するプランであるクエリプランを生成するクエリプラン生成部と、該生成されたクエリプランに従いクエリを実行するクエリ実行部とを備えることができる。クエリプランは、例えば、データ読出しを伴う一つ以上のデータベースオペレーションで構成され、該データベースオペレーション間の実行順序には木構造の順序関係が存在する。クエリ実行部は、他のデータベースオペレーションに依存しない初期データベースオペレーションを抽出してタスクを割り当てるステップと、該割り当てられたタスクを実行するステップとで構成することができる。   Specific examples of this database management system are as follows. That is, the database management system includes a query receiving unit that receives a query (for example, SQL) from a host computer program (for example, an application program), and a query plan generating unit that generates a query plan that is a plan for executing the received query. A query execution unit that executes a query according to the generated query plan. The query plan is composed of, for example, one or more database operations accompanied by data reading, and the execution order between the database operations has a tree-structured order relationship. The query execution unit can be composed of a step of assigning a task by extracting an initial database operation that does not depend on other database operations, and a step of executing the assigned task.

該データベースオペレーションに対応したタスクを実行するステップでは、以下の(A)〜(D)のステップ、
(A)データ読出し処理に対して複数の独立したタスクを生成するステップ、
(B)該生成された複数のタスクのデータ読出し処理において、外部記憶装置からのデータ読出しが必要な場合、オペレーティングシステムにデータ読出し要求を発行するステップ、
(C)該データ読出しが完了したタスクから当該データベースオペレーションの実行を再開するステップ、
(D)該データベースオペレーションに依存した次のデータベースオペレーションがある場合、該次のデータベースオペレーションを実行するステップ、
を実行することができる。
In the step of executing the task corresponding to the database operation, the following steps (A) to (D):
(A) generating a plurality of independent tasks for data read processing;
(B) issuing a data read request to the operating system when data read from the external storage device is necessary in the data read processing of the plurality of generated tasks;
(C) resuming execution of the database operation from the task that has completed the data reading;
(D) if there is a next database operation dependent on the database operation, executing the next database operation;
Can be executed.

第一の態様では、前記クエリ実行部は、所定の状況にあるタスクの現存数が所定数に達している場合には、新たなタスクの生成を待ち、前記現存数が減った場合に、前記新たなタスクを生成することができる。所定の状況とは、例えば、単に現存している状況であっても良いし、データ取得待ちの状況であっても良い。   In the first aspect, the query execution unit waits for generation of a new task when the existing number of tasks in a predetermined situation has reached a predetermined number, and when the existing number decreases, New tasks can be created. The predetermined situation may be, for example, an existing situation or a situation waiting for data acquisition.

第二の態様では、データベース管理システムは、読出し順序制御部を更に備えることができる。読出し順序制御部は、前記クエリ実行部から発行された複数個のデータ読出し要求を受け、受け付けた複数個のデータ読出し要求を、前記複数個のデータ読出し要求を受け付けた順序とは異なる、全体としてのデータ読出し時間長(すなわち、複数個のデータ読出し要求に応じてデータが読み出されるまでの時間長)を短縮化するための順序で発行することができる。   In the second aspect, the database management system may further include a read order control unit. The read order control unit receives a plurality of data read requests issued from the query execution unit, and the received plurality of data read requests are different from the order in which the plurality of data read requests are received as a whole. Can be issued in the order for shortening the data read time length (that is, the time length until data is read in response to a plurality of data read requests).

具体的には、例えば、データベース管理システムは、前記クエリ実行部からのデータ読出し要求を受け付け、そのデータ読出し要求をオペレーティングシステムに発行する読出し最適化部を備えることができる。読出し最適化部は、受け付けたデータ読出し要求をキューイングし、データ読出し要求を発行するタイミングを制御するための条件(例えば、後述する第二実施例のバッチスケジューリング駆動条件)が満たされた場合に、キューイングされた複数のデータ読出し要求の出力順序を変更することで、データ読出し時間を最適化することができる。   Specifically, for example, the database management system can include a read optimization unit that receives a data read request from the query execution unit and issues the data read request to the operating system. The read optimization unit queues the received data read request and when a condition for controlling the timing for issuing the data read request (for example, a batch scheduling drive condition of the second embodiment described later) is satisfied. The data read time can be optimized by changing the output order of the queued data read requests.

第三の態様では、データベース管理システムは、優先順位の異なる複数のキューを更に備えることができる。前記クエリ実行部は、前記生成されたタスクの実行により、前記複数のキューのうち、所定の条件に適合する優先度に対応したキューに、前記データ読出し要求を格納することができる。前記読出し順序制御部は、優先度の高いキューに格納されているデータ読出し要求ほど優先的に発行することができる。   In the third aspect, the database management system can further include a plurality of queues having different priorities. The query execution unit can store the data read request in a queue corresponding to a priority that satisfies a predetermined condition among the plurality of queues by executing the generated task. The read order control unit can issue data read requests stored in a queue with higher priority with higher priority.

具体的には、例えば、読出し最適化部は、スケジュール対象外を含む複数の読出し要求キューを有し、読出し要求キュー毎に設定された処理手順に従い、データ読出し要求を発行することができる。この場合において、タスクを実行することによってデータ読出し要求を読出し最適化部へ発行する際に、以下の(a)〜(c)の処理、
(a)読出し要求に対するスケジューリングフラグを付与する処理、
(b)該スケジューリングフラグの値に応じて複数の読出し要求キューの中から一つの読出し要求キューを選択する処理、
(c)選択した読出し要求キューへ読出し要求を格納する処理、
を実行することができる。読出し最適化部では、データ読出し要求をキューに保管し続ける時間長を変更することができる。
Specifically, for example, the read optimization unit has a plurality of read request queues including those not scheduled, and can issue a data read request according to the processing procedure set for each read request queue. In this case, when a data read request is issued to the read optimization unit by executing a task, the following processes (a) to (c):
(A) a process for assigning a scheduling flag for a read request;
(B) a process of selecting one read request queue from a plurality of read request queues according to the value of the scheduling flag;
(C) processing for storing a read request in the selected read request queue;
Can be executed. The read optimization unit can change the length of time that data read requests are kept in the queue.

第四の態様では、上述の第三の実施態様において、前記読出し順序制御部は、所定のコマンドを受け付けた場合には、或る優先度のキューに格納されている少なくとも一つの読出し要求を別の優先度のキューに移動させることができる。   In a fourth aspect, in the third embodiment described above, when the read order control unit receives a predetermined command, it separates at least one read request stored in a queue having a certain priority. Can be moved to the priority queue.

具体的には、例えば、データベース管理システムは、スケジュール対象の読出し要求キューにキューイングされたデータ読出要求に対してスケジュールキャンセルコマンドを発行することにより、該データ読出し要求をスケジュール対象外の読出し要求キューに移すことができる。   Specifically, for example, the database management system issues a schedule cancel command to a data read request queued in the schedule target read request queue, thereby causing the data read request to be read out of the schedule target read request queue. Can be moved to.

第五の態様では、上述の第三の態様において、前記クエリ実行部は、前記受け付けたクエリの実行プランの内容、又は、前記受け付けたクエリの実行に求められる性能要件に応じて、どの優先度のキューに読出し要求を格納するかを決定することができる。   According to a fifth aspect, in the third aspect described above, the query execution unit determines which priority depending on the content of the execution plan of the accepted query or the performance requirement required for the execution of the accepted query. It is possible to determine whether to store read requests in the queue.

第六の態様では、上述の第三の態様において、データベース管理システムは、タスク管理部を備えることができる。タスク管理部は、クエリ実行プランに基づいて、残存ステップ数を計算し、計算された残存ステップ数の少ないタスクの優先度を上げることができる。この場合において、前記クエリ実行部が、優先度の上がったタスクを実行することにより発行される読出し要求を、該優先度に対応するキューに格納することができる。ここで、残存ステップとは、例えば、残存するデータオペレーションの数とすることができる。   In a sixth aspect, in the third aspect described above, the database management system can include a task management unit. The task management unit can calculate the number of remaining steps based on the query execution plan and increase the priority of the task with the small number of remaining steps calculated. In this case, the query execution unit can store a read request issued by executing a task with an increased priority in a queue corresponding to the priority. Here, the remaining step can be, for example, the number of remaining data operations.

第七の態様では、前記クエリ実行部は、生成された各タスクの実行において、前記データベースのデータの取得を待ち、該データを取得した後、データの取得待ちを開始した順序と同じ順序で、タスクの実行を再開することができる。これは、上記第二の態様においても行うことができる。   In a seventh aspect, in the execution of each generated task, the query execution unit waits for the acquisition of data in the database, and after acquiring the data, in the same order as the order in which the acquisition wait for data is started, The execution of the task can be resumed. This can also be done in the second embodiment.

本発明の別の観点に従うコンピュータシステムは、上述したデータベース管理システムと、読出し順序制御部とを備える。読出し順序制御部は、データベース管理システムから発行された複数個のデータ読出し要求を受け付け、受け付けた複数個のデータ読出し要求を、前記複数個のデータ読出し要求を受け付けた順序とは異なる、全体としてのデータ読出し時間長を短縮化するための順序で発行する。   A computer system according to another aspect of the present invention includes the above-described database management system and a reading order control unit. The read order control unit receives a plurality of data read requests issued from the database management system, and the received plurality of data read requests are different from the order in which the plurality of data read requests are received. Issued in order to shorten the data read time length.

本発明に従うデータベース管理システムによれば、一つのクエリの実行に要する時間長を短縮化することができる。   According to the database management system according to the present invention, the length of time required to execute one query can be shortened.

図1Aは、クエリプランの一例を示す。図1Bは、パート表、ラインアイテム表及びオーダ表の構成例と表同士の関連とを示す。図1Cは、クエリの実行結果として出力される情報の例を示す。FIG. 1A shows an example of a query plan. FIG. 1B shows a configuration example of a part table, a line item table, and an order table, and the relationship between the tables. FIG. 1C shows an example of information output as a query execution result. 図2は、本発明の第一実施例に係るシステムの構成例を示す。FIG. 2 shows a configuration example of a system according to the first embodiment of the present invention. 図3は、クエリ実行部9が行う処理の流れの一例を示す。FIG. 3 shows an example of the flow of processing performed by the query execution unit 9. 図4Aは、図3のS2のタスク生成待ち処理において行われる処理の流れの一例を示す。図4Bは、図3のS11のデータ取得処理において行われる処理の流れの一例を示す。FIG. 4A shows an example of the flow of processing performed in the task generation waiting process in S2 of FIG. FIG. 4B shows an example of the flow of processing performed in the data acquisition processing of S11 of FIG. 図5Aは、従来のクエリ実行の流れの一例を示す。図5Bは、本発明の第一実施例におけるクエリ実行の流れの一例を示す。FIG. 5A shows an example of a conventional query execution flow. FIG. 5B shows an example of the flow of query execution in the first embodiment of the present invention. 図6は、本発明の第二実施例に係るシステムの構成例を示す。FIG. 6 shows a configuration example of a system according to the second embodiment of the present invention. 図7Aは、本発明の第二実施例で行われるデータ取得処理の流れの一例を示す。図7Bは、I/O要求発行処理の流れの一例を示す。FIG. 7A shows an example of the flow of data acquisition processing performed in the second embodiment of the present invention. FIG. 7B shows an example of the flow of I / O request issue processing. 図8は、I/O最適化部27の説明図である。FIG. 8 is an explanatory diagram of the I / O optimization unit 27. 図9Aは、I/O最適化部27が行う処理の流れの一例を示す。図9Bは、即時発行処理の流れの一例を示す。FIG. 9A shows an example of the flow of processing performed by the I / O optimization unit 27. FIG. 9B shows an example of the flow of immediate issue processing. 図10Aは、スケジュールキャンセル処理の流れの一例を示す。図10Bは、バッチスケジュール処理の流れの一例を示す。FIG. 10A shows an example of the flow of schedule cancellation processing. FIG. 10B shows an example of the flow of batch schedule processing. 図11A及び図11Bは、本発明の第一実施例のDBMS5によって期待される効果の一例の説明図である。具体的には、図11Aは、第一実施例におけるI/O要求の発行とデータの読み出しの流れの一例を示す。図11Bは、図11Aに示した流れにおけるディスクシークイメージの一例を示す。11A and 11B are explanatory diagrams of examples of effects expected by the DBMS 5 according to the first embodiment of this invention. Specifically, FIG. 11A shows an example of a flow of issuing an I / O request and reading data in the first embodiment. FIG. 11B shows an example of a disk seek image in the flow shown in FIG. 11A. 図12A及び図12Bは、本発明の第二実施例のDBMS5によって期待される効果の一例であって、即時発行処理が行われない場合の説明図である。12A and 12B are examples of the effects expected by the DBMS 5 according to the second embodiment of the present invention, and are explanatory diagrams when the immediate issue process is not performed. 図13A及び図13Bは、本発明の第二実施例のDBMS5によって期待される効果の一例であって、即時発行処理が行われる場合の説明図である。13A and 13B are examples of effects expected by the DBMS 5 according to the second embodiment of the present invention, and are explanatory diagrams when an immediate issue process is performed. 図14Aは、本発明の第三実施例におけるデータ取得待ち表の構成例を示す。図14Bは、生成された子タスクが第一実施例で行う処理との第一の相違部分を示す。図14Cは、生成された子タスクが第一実施例で行う処理との第二の相違部分を示す。FIG. 14A shows a configuration example of a data acquisition waiting table in the third embodiment of the present invention. FIG. 14B shows a first difference from the process performed by the generated child task in the first embodiment. FIG. 14C shows a second difference from the process performed by the generated child task in the first embodiment. 図15Aは、データ取得処理の開始順序、データの取得順序、及びタスクの再開順序の関係の一例を示す。図15Bは、図15Aにおけるディスクシークイメージの一例を示す。FIG. 15A shows an example of the relationship between the start order of the data acquisition process, the data acquisition order, and the task restart order. FIG. 15B shows an example of the disk seek image in FIG. 15A.

以下、図面を参照して、本発明についての幾つかの実施例を説明する。   Hereinafter, some embodiments of the present invention will be described with reference to the drawings.

図2は、本発明の第一実施例に係るシステムの構成例を示す。   FIG. 2 shows a configuration example of a system according to the first embodiment of the present invention.

データベースサーバ1と、データベースサーバ1の外に存在する記憶装置である外部記憶装置19とが、通信ネットワーク17を介して通信可能に接続されている。   The database server 1 and an external storage device 19 that is a storage device existing outside the database server 1 are connected to be communicable via a communication network 17.

外部記憶装置19は、記憶資源を有する装置であればどのような装置であっても良い。例えば、外部記憶装置19は、ファイルサーバであっても良いし、単体のディスクドライブ(例えばハードディスクドライブ)であっても良いし、複数のディスクドライブを備えた記憶装置システムであっても良い。外部記憶装置19は、データベース21を有し、データベース21内に、複数の電子的な索引25、25、…と、複数の電子的な表23、23、…とを記憶することができる。各索引25は、例えば、或る表における各行と別の表における各行との繋がりを表すポインタを複数個備えるデータ(例えば、図1Bにおけるインデックス25A、25B)であり、B-木インデクスなどが用いられる。各表23は、複数の行要素から成る行を複数個有するデータ(例えば、図1Bにおけるパート表23A、ラインアイテム表23B又はオーダ表23C)である。   The external storage device 19 may be any device as long as it has storage resources. For example, the external storage device 19 may be a file server, a single disk drive (for example, a hard disk drive), or a storage device system including a plurality of disk drives. The external storage device 19 has a database 21 and can store a plurality of electronic indexes 25, 25,... And a plurality of electronic tables 23, 23,. Each index 25 is, for example, data including a plurality of pointers (for example, indexes 25A and 25B in FIG. 1B) indicating the connection between each row in one table and each row in another table, and a B-tree index or the like is used. It is done. Each table 23 is data (for example, the part table 23A, the line item table 23B, or the order table 23C in FIG. 1B) having a plurality of rows composed of a plurality of row elements.

データベースサーバ1は、例えば、格別図示しないが、複数のコンピュータプログラムを記憶することができる記憶資源(例えばメモリやハードディスク)や、記憶資源からコンピュータプログラムを読み込んで実行することができるプロセッサ(例えばCPU)等を有するコンピュータマシンである。記憶資源に記憶されているコンピュータプログラムとして、例えば、クエリ(例えばSQL(Structured Query Language))を発行するアプリケーションプログラム(以下、AP)3と、AP3からクエリを受けて実行し実行結果をAP3に返すデータベース管理システム(以下、DBMS)5と、ウィンドウズ(登録商標)等のオペレーティングシステム(以下、OS)15とがある。OS15の上位にDBMS5があり、DBMS5の上位にAP3が存在する。なお、APはDBMSと異なるコンピュータに存在していても良い。その場合には、APからの問合せ要求はネットワーク経由で受け付ける。また、記憶資源の一部を利用して、例えば、DBMS5で利用されるデータベースバッファ(以下、DBバッファ)12を構築することができる。   The database server 1 is, for example, a storage resource (for example, a memory or a hard disk) that can store a plurality of computer programs, or a processor (for example, a CPU) that can read and execute a computer program from the storage resources, although not specifically illustrated. And so on. As a computer program stored in the storage resource, for example, an application program (hereinafter referred to as AP) 3 that issues a query (for example, SQL (Structured Query Language)) and a query from AP3 are executed, and an execution result is returned to AP3. There is a database management system (hereinafter referred to as DBMS) 5 and an operating system (hereinafter referred to as OS) 15 such as Windows (registered trademark). The DBMS 5 is above the OS 15, and the AP 3 is above the DBMS 5. The AP may exist on a computer different from the DBMS. In that case, an inquiry request from the AP is accepted via the network. Further, a database buffer (hereinafter referred to as a DB buffer) 12 used in the DBMS 5 can be constructed by using a part of the storage resource, for example.

DBMS5は、例えば、AP3からクエリを受け付けるクエリ受付部7と、クエリ受付部7が受け付けたクエリに基づいて例えば図1Aに例示したようなクエリプランを生成するクエリプラン生成部11と、生成されたクエリプランに従がってクエリを実行するクエリ実行部9と、クエリの実行のためのタスクを管理する(例えばタスクに対してCPUやメモリ等のリソースを割り当てる)実行タスク管理部13とを有する。クエリプランは、複数のデータベースオペレーション(OP)の実行順序を定義したものである。   The DBMS 5 is generated, for example, a query receiving unit 7 that receives a query from the AP 3, a query plan generating unit 11 that generates a query plan as exemplified in FIG. 1A based on the query received by the query receiving unit 7, and the like. A query execution unit 9 that executes a query according to a query plan, and an execution task management unit 13 that manages a task for executing the query (for example, assigns resources such as a CPU and a memory to the task). . The query plan defines the execution order of a plurality of database operations (OP).

この第一実施例では、特にクエリ実行部9が行う処理に特徴がある。クエリ実行部9は、少なくとも一つのOPを割り当てたタスクを実行することにより、当該少なくとも一つのOPを実行することができる。そして、クエリ実行部9は、そのタスクの実行中において、外部記憶装置19からのデータの読出しが必要になれば、そのデータを読み出して次のOPを実行するタスクを生成し、生成されたタスクを実行することにより、データの入出力要求(以下、「I/O要求」と記載)を発行することができる。タスクを複数個生成した場合には、複数個のタスクを並行して実行することができ、故に、複数個のI/O要求を並行して発行することができる。なお、タスクの実装としては、OSが管理するプロセスやスレッド、または、アプリケーションやミドルウェアが実装する擬似プロセスや擬似スレッドなど任意の実行環境が利用できる。   This first embodiment is particularly characterized in the processing performed by the query execution unit 9. The query execution unit 9 can execute at least one OP by executing a task to which at least one OP is assigned. When the query execution unit 9 needs to read data from the external storage device 19 during the execution of the task, the query execution unit 9 reads the data and generates a task to execute the next OP. The generated task By executing this, a data input / output request (hereinafter referred to as “I / O request”) can be issued. When a plurality of tasks are generated, a plurality of tasks can be executed in parallel, and therefore a plurality of I / O requests can be issued in parallel. As the task implementation, any execution environment such as a process or thread managed by the OS or a pseudo process or pseudo thread implemented by an application or middleware can be used.

以下、クエリ実行部9が行う処理について説明する。なお、以下、説明を分かり易くするために、一つのタスクを実行することにより一つのOPが実行されるものとする。しかし、勿論それに限定する必要は無く、例えば、一つのタスクを実行することにより、複数のOPが実行されても良い。具体的には、例えば、一つのタスクが、或るOPを実行し、その実行結果を引き継いで、次のOPを実行しても良い。   Hereinafter, processing performed by the query execution unit 9 will be described. Hereinafter, for the sake of easy understanding, it is assumed that one OP is executed by executing one task. However, of course, it is not necessary to limit to this. For example, a plurality of OPs may be executed by executing one task. Specifically, for example, one task may execute a certain OP, take over the execution result, and execute the next OP.

図3は、クエリ実行部9が行う処理の流れの一例を示す。   FIG. 3 shows an example of the flow of processing performed by the query execution unit 9.

クエリ実行部9は、或る段階のデータベースオペレーション(OP)を割り当てたタスク(以下、便宜上「親タスク」と言う)を実行することにより、そのOPを実行することができる。   The query execution unit 9 can execute the OP by executing a task to which a certain level of database operation (OP) is assigned (hereinafter referred to as “parent task” for convenience).

実行された親タスクは、そのOPの実行において、残りのデータ(例えば、索引25又は表23から未だ読み出されていないデータ)があれば(ステップS1で「データあり」)、タスク生成待ち処理を実行する(S2)。タスク生成待ち処理により、タスクを生成することができるようになったら、親タスクは、残りのデータを読み出して次のOPを実行することを割り当てたタスク(以下、便宜上「子タスク」と言う)31を生成する(S3)。親タスクの実行中においては(S4で「親タスク」)、再びS1が実行される。また、S1で「データなし」の場合には、当該親タスクは消滅することができる。   If the executed parent task has remaining data (for example, data that has not been read from the index 25 or the table 23) in the execution of the OP (“data present” in step S1), task generation waiting processing Is executed (S2). When a task can be generated by the task generation wait process, the parent task is assigned to read the remaining data and execute the next OP (hereinafter referred to as “child task” for convenience). 31 is generated (S3). While the parent task is being executed (“parent task” in S4), S1 is executed again. Further, in the case of “no data” in S1, the parent task can disappear.

クエリ実行部9は、並行して、生成された子タスク31を実行することができる。S1からS4の「親タスク」の処理が繰り返されることにより、同一の次のOPを実行する子タスクが複数個生成された場合には、生成された複数個の子タスク31、31、…を並行して実行することができる。   The query execution unit 9 can execute the generated child task 31 in parallel. When a plurality of child tasks that execute the same next OP are generated by repeating the processing of the “parent task” in S1 to S4, the generated plurality of child tasks 31, 31,. Can be executed in parallel.

実行された子タスク31は、S1における残りのデータを取得するデータ取得処理を実行し(S11)、データを取得できれば(S11で「データあり」)、その取得されたデータが選択条件にマッチするか否かを判断するS12の処理を行う(なお、このS12は、OPの種類によっては行われない)。マッチすれば(S12で「あり」)、子タスク31は、自分に割り当てられたOPの次のOPがあれば(S13で「あり」)、次のOPを実行し(S14)、なければ(S13で「なし」)、結果をリターンする(S15)。次のOPがあるか否かは、例えば、クエリプラン生成部11によって生成された図1Aに例示したクエリプランを参照することにより判別することができる。また、S14の次のOPの実行では、当該子タスクは、親タスクとして、上述したS1の処理を実行し、S3で子タスクを生成することができる。   The executed child task 31 executes a data acquisition process for acquiring the remaining data in S1 (S11). If the data can be acquired (“data present” in S11), the acquired data matches the selection condition. (S12 is not performed depending on the type of OP). If there is a match (“Yes” in S12), the child task 31 executes the next OP if there is an OP next to the OP assigned to itself (“Yes” in S13) (S14), otherwise ( The result is returned (S15). Whether or not there is a next OP can be determined by referring to the query plan illustrated in FIG. 1A generated by the query plan generation unit 11, for example. Further, in the execution of the next OP in S14, the child task can execute the above-described processing of S1 as a parent task and generate a child task in S3.

図4Aは、図3のS2のタスク生成待ち処理において行われる処理の流れの一例を示す。   FIG. 4A shows an example of the flow of processing performed in the task generation waiting process in S2 of FIG.

親タスクは、自分より高い優先度のタスクが生成待ちか否かを判定する(S2−1)。具体的には、例えば、親タスクは、クエリプランを参照し、他の親タスクの実行において生成待ちとなっている子タスクが、自分よりも後段のOPを実行するタスクか否かを判定する。   The parent task determines whether a task having a higher priority than itself is waiting to be generated (S2-1). Specifically, for example, the parent task refers to the query plan, and determines whether or not a child task that is waiting to be generated in the execution of another parent task is a task that executes an OP subsequent to itself. .

S2−1の判定の結果、待ちであれば(S2−1で「あり」)、親タスクは、タスクの生成が行われる契機となるイベントの発生を待つ(S2−2)。   If the result of the determination in S2-1 is a wait (“Yes” in S2-1), the parent task waits for the occurrence of an event that triggers the generation of the task (S2-2).

一方、S2−1の判定の結果、待ちでなければ(S2−1で「なし」)、親タスクは、現存するデータ取得待ちタスク数が所定の閾値未満か否かを判定する(S2−3)。現存するデータ取得待ちタスク数は、例えば、クエリ実行部9が、タスクを生成する都度に所定のカウント値を1増やし、データ取得が完了する都度にそのカウント値を1減らすことで、そのカウント値を参照することにより、判別することができる。また、閾値は、データベースサーバ1の記憶資源に記憶される値である。閾値は、例えば、一種のチューニングパラメータであり、DBMS5の管理者が所望の値とすることができる。また、閾値は、DBMSシステム全体で決めることも可能であるし、問合せやユーザなど任意の単位で設定することが可能である。   On the other hand, if the result of the determination in S2-1 is not waiting (“None” in S2-1), the parent task determines whether or not the number of existing data acquisition waiting tasks is less than a predetermined threshold (S2-3). ). The number of existing data acquisition waiting tasks is determined by, for example, increasing the predetermined count value by 1 each time the query execution unit 9 generates a task, and reducing the count value by 1 each time data acquisition is completed. It can be determined by referring to. The threshold value is a value stored in the storage resource of the database server 1. The threshold is, for example, a kind of tuning parameter, and can be set to a desired value by the administrator of the DBMS 5. Further, the threshold value can be determined for the entire DBMS system, and can be set in an arbitrary unit such as an inquiry or a user.

S2−3の判定の結果、残存タスク数が所定の閾値未満であれば(S2−3で「はい」)、親タスクは、図3のS2のタスク生成待ち処理を終えて次のS3を実行することができ、そうでなければ(S2−3で「いいえ」)、少なくとも一つのタスクが消滅する契機となるイベントの発生を待つ(S2−4)。ここでのイベントとしては、例えば、図3のS1において「データなし」となることが挙げられる。   As a result of the determination in S2-3, if the number of remaining tasks is less than the predetermined threshold (“Yes” in S2-3), the parent task finishes the task generation waiting process in S2 of FIG. 3 and executes the next S3 If not (“No” in S2-3), it waits for the occurrence of an event that triggers the disappearance of at least one task (S2-4). An example of the event here is “no data” in S1 of FIG.

図4Bは、図3のS11のデータ取得処理において行われる処理の流れの一例を示す。   FIG. 4B shows an example of the flow of processing performed in the data acquisition processing of S11 of FIG.

子タスクは、DBバッファ12にアクセスし、過去に読み出されたデータが残っている等の理由により、DBバッファ12に、自分の読出し対象のデータが存在していれば(S11−1で「ヒット」)、そのデータをDBバッファ12から取得して(S11−5)、このデータ取得処理を終える。   The child task accesses the DB buffer 12, and if the data to be read exists in the DB buffer 12 due to reasons such as remaining data read in the past (" Hit "), the data is acquired from the DB buffer 12 (S11-5), and the data acquisition process is completed.

子タスクは、DBバッファ12に、自分の読出し対象のデータが存在していない場合(S11−1で「フォルト」)、そのデータが存在する領域に対してI/O要求が未だ発行されていなければ(S11−2で「未」)、OSシステムコールによるI/O発行を行う(S11−3)。すなわち、子タスクは、OS15にI/O要求を出すことで、OS15から外部記憶装置19に対するI/O要求を発行させる。子タスクの実行は、それに応答して、外部記憶装置19からOS15を介してデータが読み出されるまで待ちとなる。データが読み出されたならば(S11−5)、子タスクは、処理を再開し、読み出されたデータをDBバッファ12に格納して、このデータ取得処理を終える。   When there is no data to be read out in the DB buffer 12 (“fault” in S11-1), the child task must still issue an I / O request to the area where the data exists. If this is the case (“No” in S11-2), I / O issuance by OS system call is performed (S11-3). That is, the child task issues an I / O request to the external storage device 19 from the OS 15 by issuing an I / O request to the OS 15. In response to the execution of the child task, it waits until data is read from the external storage device 19 via the OS 15. If the data is read (S11-5), the child task resumes the process, stores the read data in the DB buffer 12, and ends this data acquisition process.

子タスクは、S11−1で「フォルト」の場合、自分の読出し対象のデータが存在する領域に対してI/O要求が既に発行されていれば(S11−2で「既」)、I/O要求の完了を待つ(S11−4)。データが読み出されたならば(S11−5)、子タスクは、処理を再開し、読み出されたデータをDBバッファ12に格納して、このデータ取得処理を終える。なお、自分の読出し対象のデータが存在する領域に対してI/O要求が既に発行されているか否かは、例えば、各タスクが、I/O要求をOS15に発行する都度に、そのI/O要求によるアクセス先に関するI/O先情報を、データベースサーバ1の記憶資源上の所定記憶領域に書き、子タスクは、その所定記憶領域上の各I/O先情報を参照することにより、判定することができる。I/O先情報としては、例えば、外部記憶装置19に設けられた論理ユニットの識別子(例えば論理ユニット番号)と、アクセス先の論理ブロックアドレス(以下、LBA)とを含んだ情報とすることができる。データベースサーバ1の記憶資源は、例えば、DBオブジェクト(例えば、表23、索引25、又は表23や索引25上の各行要素(例えばPID、OID等))と記憶位置(例えば、論理ユニット識別子及び/又はLBA)との対応関係を表すマッピング情報を記憶することができ、各タスクは、そのマッピング情報に基づいて、OS15に対してI/O要求を発行したり、上記I/O先情報を所定記憶領域に書き込んだりすることができる。   If the child task is “fault” in S11-1, if the I / O request has already been issued to the area where the data to be read exists (“already” in S11-2), Wait for completion of the O request (S11-4). If the data is read (S11-5), the child task resumes the process, stores the read data in the DB buffer 12, and ends this data acquisition process. Note that whether each task issues an I / O request to the OS 15, for example, whether or not an I / O request has already been issued to the area where the data to be read is present. The I / O destination information related to the access destination by the O request is written in a predetermined storage area on the storage resource of the database server 1, and the child task is determined by referring to each I / O destination information on the predetermined storage area. can do. As the I / O destination information, for example, information including an identifier of a logical unit (for example, a logical unit number) provided in the external storage device 19 and a logical block address (hereinafter referred to as LBA) of an access destination may be used. it can. The storage resource of the database server 1 includes, for example, a DB object (for example, table 23, index 25, or each row element (for example, PID, OID) on the table 23 or index 25) and a storage location (for example, logical unit identifier and / or Or mapping information representing the correspondence relationship with the LBA), each task can issue an I / O request to the OS 15 based on the mapping information, and the I / O destination information can be specified. It can be written to the storage area.

上述した第一実施例によれば、クエリ実行部9は、タスクの実行中において、外部記憶装置19からのデータの読出しが必要になれば、そのデータを読み出して次のOPを実行するタスクを生成し、生成されたタスクを実行することにより、I/O要求を発行することができる。タスクを複数個生成した場合には、複数個のタスクを並行して実行することができ、故に、複数個のI/O要求を並行して発行することができる。このことを、図1Aに例示したクエリプランに従がってクエリを実行する場合を例に採って説明すると、従来の技術によれば、図5Aに示すように、パート表23Aから未読の行がなくなるまで、OP1からOP5までを終えて再びOP1から開始することを繰り返す必要があるが、上述した第一実施例によれば、図5Bに示すように、同一段階のOPを並行して実行することができる。具体的には、例えば、パート表23Aの行数は3なので、OP1が割り当てられたタスクが実行されることにより、複数の子タスクが生成され、それら複数の子タスクが並行して実行されることにより、パート表23Aの3行にそれぞれ対応した3つのOP2を並行して実行することができる。各OP2の実行後、OP3も並行して実行され、その実行結果に応じて、タスクが消滅してOP4以降が実行されなかったり(例えば、フェッチされたOIDが504未満であったため図3のS12の選択条件にマッチしないが故に終了となってタスクが消滅したり)、一つのOP3の実行後に更に複数のOP4が並行して実行されたりする(例えば、PID「301」に対応する行が2つ見つかったために2つの行にそれぞれ対応した2つのOP4が並行して実行されたりする)。I/O要求を発行する処理が必要となるOPが並行して実行されるため、複数のI/O要求が並行して発行される。これにより、例えば、生成されたタスク毎に読出し要求が発行され、その読出し要求に応答してデータが読み出されるまで該タスクの処理が中断しても、他の生成されたタスクは独立して実行されるので、クエリの実行それ自体が中断してしまうわけではない。以上の結果、従来に比べて、一つのクエリの実行に要する時間を短縮することができる。   According to the first embodiment described above, when the query execution unit 9 needs to read data from the external storage device 19 during the execution of the task, the query execution unit 9 reads the data and executes the next OP. An I / O request can be issued by generating and executing the generated task. When a plurality of tasks are generated, a plurality of tasks can be executed in parallel, and therefore a plurality of I / O requests can be issued in parallel. This will be described by taking an example in which a query is executed according to the query plan illustrated in FIG. 1A. According to the conventional technique, as shown in FIG. 5A, an unread line is read from the part table 23A. It is necessary to finish from OP1 to OP5 and start again from OP1 until there is no more, but according to the first embodiment described above, the OP at the same stage is executed in parallel as shown in FIG. 5B can do. Specifically, for example, since the number of rows in the part table 23A is 3, when a task to which OP1 is assigned is executed, a plurality of child tasks are generated, and the plurality of child tasks are executed in parallel. Thus, the three OP2 corresponding to the three rows of the part table 23A can be executed in parallel. After the execution of each OP2, OP3 is also executed in parallel. Depending on the execution result, the task disappears and OP4 and the subsequent steps are not executed (for example, because the fetched OID is less than 504, S12 in FIG. 3). The task ends and the task disappears because it does not match the selection condition of (1), and a plurality of OP4s are executed in parallel after execution of one OP3 (for example, two rows corresponding to PID “301” are 2 Since two of them are found, two OP4 corresponding to the two rows are executed in parallel). Since an OP requiring processing for issuing an I / O request is executed in parallel, a plurality of I / O requests are issued in parallel. Thus, for example, a read request is issued for each generated task, and even if processing of the task is interrupted until data is read in response to the read request, other generated tasks are executed independently. The query execution itself is not interrupted. As a result, the time required to execute one query can be shortened compared to the conventional case.

また、上述した第一実施例によれば、タスクが無制限に生成されるわけではなく、現存するデータ取得待ちタスク数が所定値になったら、新たにタスクは生成されず、現存のデータ取得待ちタスク数が所定値未満になった場合に、新たなタスクの生成が行われる。これにより、DBMS5での処理によって消費されるコンピュータリソース(例えば、CPU使用率、メモリ使用量等)の量を抑えることができる。   In addition, according to the first embodiment described above, tasks are not generated indefinitely. When the number of existing data acquisition waiting tasks reaches a predetermined value, no new task is generated and the existing data acquisition waiting When the number of tasks becomes less than a predetermined value, a new task is generated. Thereby, the amount of computer resources (for example, CPU usage rate, memory usage amount, etc.) consumed by the processing in the DBMS 5 can be suppressed.

以下、本発明の第二実施例を説明する。なお、その際、第一実施例との相違点を主に説明し、第一実施例との共通点については、重複した説明を省くために、説明を簡略或いは省略する。   The second embodiment of the present invention will be described below. In this case, differences from the first embodiment will be mainly described, and the description of the common points with the first embodiment will be simplified or omitted in order to omit redundant description.

図6は、本発明の第二実施例に係るシステムの構成例を示す。この図において、第一実施例と同一の要素については同一の番号を付してある。   FIG. 6 shows a configuration example of a system according to the second embodiment of the present invention. In this figure, the same elements as those in the first embodiment are denoted by the same reference numerals.

この第二実施例では、DBMS5に、I/O最適化部27が備えられる。この場合、クエリ実行部9は、OS15にではなく、I/O最適化部27にI/O要求を発行する。I/O最適化部27は、クエリ実行部9から並行して発行された複数のI/O要求を受けて保持し、受け付けた複数のI/O要求の順序を、データ読出し時間長を最適化するための順序に変更し、変更後の順序で複数のI/O要求をOS15に発行することができる。   In this second embodiment, the DBMS 5 is provided with an I / O optimization unit 27. In this case, the query execution unit 9 issues an I / O request not to the OS 15 but to the I / O optimization unit 27. The I / O optimization unit 27 receives and holds a plurality of I / O requests issued in parallel from the query execution unit 9, and optimizes the order of the received plurality of I / O requests and the data read time length. It is possible to issue a plurality of I / O requests to the OS 15 in the changed order.

以下、この第二実施例について詳細に説明する。   Hereinafter, the second embodiment will be described in detail.

図7Aは、本発明の第二実施例で行われるデータ取得処理の流れの一例を示す。   FIG. 7A shows an example of the flow of data acquisition processing performed in the second embodiment of the present invention.

この図7Aにおいて、S31、S32、S35及びS36は、図4AのS11−1、S11−2、S11−4及びS11−5にそれぞれ対応している。相違点は、S33及びS34である。   In FIG. 7A, S31, S32, S35, and S36 correspond to S11-1, S11-2, S11-4, and S11-5 of FIG. 4A, respectively. The difference is S33 and S34.

S33では、クエリ実行部9によって実行されている子タスクは、発行するI/O要求をスケジュール対象とするか否かを判断し、スケジュール対象とする場合に、スケジュールフラグを付与することを決定する。スケジュール対象とする場合とは、例えば、I/O要求をOS15に発行する緊急性が低い場合であり、そうではなく、その緊急性が高い場合には、スケジュール対象外となる。スケジュール対象とするか否かは、例えば、クエリプランの内容、又は、クエリの実行に求められる性能要件に応じて、決定することができる。前者の具体例では、当該子タスクが、クエリプランを参照し、当該子タスクに割り当てられているOPが或る段階よりも後段のOPであると認識された場合に、スケジュール対象外とし、そうではない場合には、スケジュール対象としても良い。後者の具体例では、当該子タスクは、意思決定支援システムなどの緊急性の低いアクセス特性を有するデータベースアクセスのためのI/O要求を発行する場合には、スケジュール対象とし、オンライントランザクションシステムなどの緊急性の高いアクセス特定を有するデータベースアクセスのためのI/O要求を発行する場合には、スケジュール対象外としてもよい。   In S33, the child task being executed by the query execution unit 9 determines whether or not an I / O request to be issued is to be scheduled, and determines that a schedule flag is to be given if the I / O request is to be scheduled. . The case of being a schedule target is, for example, a case where the urgency of issuing an I / O request to the OS 15 is low, and if that is not the case, the schedule target is excluded. Whether to be a schedule target can be determined, for example, according to the contents of the query plan or the performance requirements required for executing the query. In the specific example of the former, when the child task refers to the query plan and the OP assigned to the child task is recognized as an OP at a later stage than a certain stage, it is excluded from the schedule. If this is not the case, the schedule may be used. In the latter specific example, when issuing an I / O request for database access having a low urgency access characteristic such as a decision support system, the child task is a target of scheduling, such as an online transaction system. When issuing an I / O request for database access having a highly urgent access specification, it may be out of schedule.

S33の後、当該子タスクは、I/O要求発行処理を実行する(S34)。   After S33, the child task executes an I / O request issue process (S34).

図7Bは、I/O要求発行処理の流れの一例を示す。   FIG. 7B shows an example of the flow of I / O request issue processing.

子タスクは、スケジュールフラグを付与する場合(S34−1で「有」)、スケジュール対象キューに、I/O要求を挿入し(S34−2)、スケジュールフラグを付与しない場合(S34−1で「無」)、スケジュール対象外キューに、I/O要求を挿入する。   The child task inserts an I / O request into the schedule target queue (S34-2) when giving a schedule flag ("Yes" in S34-1), and does not add a schedule flag ("S34-1" No ”), an I / O request is inserted into the non-scheduled queue.

ここで、スケジュール対象キュー及びスケジュール対象外キューとは、I/O最適化部27が有するキューである。   Here, the schedule target queue and the non-schedule queue are queues that the I / O optimization unit 27 has.

図8は、I/O最適化部27の説明図である。   FIG. 8 is an explanatory diagram of the I / O optimization unit 27.

I/O最適化部27は、スケジュール対象外キュー61Aと、スケジュール対象キュー61Bとを有する。スケジュール対象外キュー61Aの優先度(換言すれば、I/O要求の発行の緊急度)は、スケジュール対象キュー61Bの優先度よりも高い。スケジュール対象外キュー61Aには、スケジュール対象外とされたI/O要求63がクエリ実行部9によって格納され、スケジュール対象キュー61Bには、スケジュール対象とされたI/O要求63がクエリ実行部9によって格納される。   The I / O optimization unit 27 includes a non-scheduled queue 61A and a scheduled queue 61B. The priority of the non-scheduled queue 61A (in other words, the urgency of issuing an I / O request) is higher than the priority of the scheduled queue 61B. The I / O request 63 excluded from the schedule is stored in the non-scheduled queue 61A by the query execution unit 9, and the I / O request 63 set as the schedule target is stored in the query execution unit 9 in the schedule target queue 61B. Stored by.

以下、図9A、図9B、図10A及び図10Bを参照して、I/O最適化部27が行う処理の流れについて説明する。その際、適宜に、図8も参照する。   The flow of processing performed by the I / O optimization unit 27 will be described below with reference to FIGS. 9A, 9B, 10A, and 10B. At that time, FIG. 8 is also referred to as appropriate.

図9Aは、I/O最適化部27が行う処理の流れの一例を示す。   FIG. 9A shows an example of the flow of processing performed by the I / O optimization unit 27.

I/O最適化部27は、条件1〜条件3のうちの少なくとも一つの条件にマッチするイベントが発生するのを待つ(S41)。ここで、条件1とは、スケジュール対象外キュー61AにI/O要求が格納されることである。条件2とは、スケジュールキャンセルコマンドの到着である。条件3とは、後述するバッチスケジューリング駆動条件の成立である。   The I / O optimization unit 27 waits for an event that matches at least one of the conditions 1 to 3 to occur (S41). Here, the condition 1 is that an I / O request is stored in the non-scheduled queue 61A. Condition 2 is arrival of a schedule cancel command. Condition 3 is the establishment of a batch scheduling drive condition described later.

上記の条件1〜条件3のうちの少なくとも一つの条件にマッチするイベントが発生した場合には、I/O最適化部27は、発生したイベントがマッチする条件を判別し(S42)、判別された条件に応じた処理を実行する。すなわち、I/O最適化部27は、条件1であると判別された場合には、即時発行処理を実行し(S43)、条件2であると判別された場合には、スケジュールキャンセル処理を実行し(S44)、条件3であると判別された場合には、バッチスケジュール処理を実行する(S45)。なお、複数の条件にマッチした場合には、例えば、I/O最適化部27は、優先順位の高い条件に対応した処理を優先して実行することができる。例えば、条件1の方が条件3よりも優先順位が高い場合において、条件1及び条件3の両方にマッチしたイベントが発生した場合には、I/O最適化部27は、条件1に対応した即時発行処理を、条件3に対応するバッチスケジュール処理よりも先に実行することができる。   When an event that matches at least one of the above conditions 1 to 3 occurs, the I / O optimization unit 27 determines a condition that matches the generated event (S42), and is determined. Execute the process according to the conditions. That is, the I / O optimization unit 27 executes the immediate issue process when it is determined that the condition 1 is satisfied (S43), and executes the schedule cancel process when it is determined that the condition 2 is satisfied. If it is determined that the condition 3 is satisfied (S44), batch schedule processing is executed (S45). When a plurality of conditions are matched, for example, the I / O optimization unit 27 can preferentially execute a process corresponding to a condition with a high priority. For example, in the case where condition 1 has a higher priority than condition 3, and an event that matches both condition 1 and condition 3 occurs, the I / O optimization unit 27 corresponds to condition 1 The immediate issue process can be executed before the batch schedule process corresponding to the condition 3.

図9Bは、即時発行処理の流れの一例を示す。   FIG. 9B shows an example of the flow of immediate issue processing.

I/O最適化部27は、スケジュール対象外キュー61Aから全てのI/O要求を取り出し(S43−1)、取り出したI/O要求を、OS15のシステムコールを用いて発行する(S43−2)。これにより、外部記憶装置19へとI/O要求が発行される。この即時発行処理は、スケジュール対象外キュー61AにI/O要求が格納されていることがI/O最適化部27によって検出される度に行われるので、後述のバッチスケジュール処理よりも、キューにおけるI/O要求の滞在時間が短い。   The I / O optimization unit 27 extracts all I / O requests from the non-scheduled queue 61A (S43-1), and issues the extracted I / O requests using the system call of the OS 15 (S43-2). ). As a result, an I / O request is issued to the external storage device 19. This immediate issuance process is performed every time the I / O optimization unit 27 detects that an I / O request is stored in the non-scheduled queue 61A. The stay time of I / O requests is short.

図10Aは、スケジュールキャンセル処理の流れの一例を示す。   FIG. 10A shows an example of the flow of schedule cancellation processing.

I/O最適化部27は、図8で点線で示すように、スケジュールキャンセルコマンドで指定されているI/O要求63Tをスケジュール対象キュー61Bから取得し(S44−1)、取得されたI/O要求63Tをスケジュール対象外キュー61Aに挿入する(S44−2)。挿入する位置は、どこでも良い。例えば、スケジュール対象外キュー61Aに存在する一以上のI/O要求の最後尾であっても良いし、先頭であっても良いし、それらの間の任意の位置であっても良い。   As indicated by a dotted line in FIG. 8, the I / O optimization unit 27 acquires the I / O request 63T specified by the schedule cancel command from the schedule target queue 61B (S44-1), and acquires the acquired I / O The O request 63T is inserted into the non-scheduled queue 61A (S44-2). The insertion position may be anywhere. For example, it may be the tail of one or more I / O requests existing in the non-scheduled queue 61A, may be the head, or may be an arbitrary position between them.

図10Bは、バッチスケジュール処理の流れの一例を示す。   FIG. 10B shows an example of the flow of batch schedule processing.

このバッチスケジュール処理は、前述したように、バッチスケジューリング駆動条件が成立した場合に開始される。バッチスケジューリング駆動条件としては、例えば、直前回にバッチスケジュール処理が行われてから所定時間経過した、又は、スケジュール対象キュー61Bの使用率が所定値以上になったという条件を採用することができる。   As described above, this batch schedule process is started when the batch scheduling drive condition is satisfied. As the batch scheduling driving condition, for example, a condition that a predetermined time has elapsed since the batch scheduling process was performed immediately before or the usage rate of the schedule target queue 61B has become a predetermined value or more can be employed.

I/O最適化部27は、スケジュール対象キュー61Bに格納されている複数のI/O要求の順序を、それら複数のI/O要求のトータルのデータ読出し時間長を最適化するための順序に並び替える(S45−1)。この並び替えは、例えば、前述したマッピング情報に基づいて行うことができる。具体的には、例えば、I/O最適化部27は、各I/O要求毎のアクセス先LBAを特定し、外部記憶装置19におけるディスクシーク時間長が最も短くなるような順序に並び替えることができる。なお、並び替えの対象は、例えば、バッチスケジュール処理が開始された時点でスケジュール対象キュー61Bに存在するI/O要求とすることができる。この場合、バッチスケジュール処理を開始した後にスケジュール対象キュー61BにI/O要求が入っても、そのI/O要求は、今回のバッチスケジュール処理では並び替えの対象とされず、次回以降のバッチスケジュール処理で、並び替えの対象とされることになる。   The I / O optimization unit 27 changes the order of the plurality of I / O requests stored in the schedule target queue 61B to the order for optimizing the total data read time length of the plurality of I / O requests. Rearrange (S45-1). This rearrangement can be performed based on the mapping information described above, for example. Specifically, for example, the I / O optimization unit 27 identifies the access destination LBA for each I / O request, and rearranges them in an order that minimizes the disk seek time length in the external storage device 19. Can do. The rearrangement target can be, for example, an I / O request that exists in the schedule target queue 61B at the time when the batch schedule process is started. In this case, even if an I / O request enters the schedule target queue 61B after starting the batch schedule process, the I / O request is not subject to reordering in the current batch schedule process, and the batch schedule for the next and subsequent times. In the process, it will be the target of sorting.

I/O最適化部27は、スケジュール対象外キュー61Aが空か否かを判別し(S45−2)、空あれば(S45−2でYES)、スケジュール対象キュー61BにI/O要求があるか否かを判断し(S45−3)、あれば(S45−3で「あり」)、スケジュール対象キュー61BからI/O要求を取り出し、取り出したI/O要求をOS15に発行する。I/O最適化部27は、S45−2において、スケジュール対象外キュー61Aが空でなければ(S45−2でNO)、スケジュール対象外キュー61AにおけるI/O要求を優先して出すために、バッチスケジュール処理を一旦終え、図9AのS41及びS42を経てS43の即時処理を実行することができる。   The I / O optimization unit 27 determines whether or not the non-scheduled queue 61A is empty (S45-2), and if it is empty (YES in S45-2), there is an I / O request in the scheduled queue 61B. If it is determined (S45-3) and if there is (“Yes” in S45-3), the I / O request is extracted from the schedule target queue 61B, and the extracted I / O request is issued to the OS 15. If the non-scheduled queue 61A is not empty in S45-2 (NO in S45-2), the I / O optimizer 27 gives priority to the I / O request in the non-scheduled queue 61A. Once the batch schedule processing is finished, the immediate processing of S43 can be executed through S41 and S42 of FIG. 9A.

以上が、第二実施例についての説明である。この第二実施例によれば、クエリ実行部9から発行された複数のI/O要求が、クエリ実行部9から発行された順序で外部記憶装置19に送信されるのではなく、一旦、蓄積され、蓄積された複数のI/O要求の順序が、I/O最適化部27によって最適化されてから出力される。これにより、複数のI/O要求がクエリ実行部9から発行されてからクエリ実行部9にデータが読出されるまでの全体としての読出し時間長を短縮することができる。以下、この第二実施例で期待される効果について、第一実施例で期待される効果と比較して説明する。なお、以下の説明は、第一実施例と第二実施例の理解をより深めるためのものに過ぎず、以下の期待される効果を奏しないからといって、本願発明の技術的範囲から外れるものではない。故に、その説明で用いる図11A〜図13Bは、必ずしも精密な記載にはなっていない。例えば、図11B、図12B及び図13Bのディスクシークイメージの図において、横軸における単位距離が表す時間長は必ずしも同じではない。   The above is the description of the second embodiment. According to the second embodiment, a plurality of I / O requests issued from the query execution unit 9 are temporarily stored rather than transmitted to the external storage device 19 in the order issued from the query execution unit 9. The order of the plurality of accumulated I / O requests is optimized by the I / O optimization unit 27 and then output. As a result, the overall read time length from when a plurality of I / O requests are issued from the query execution unit 9 to when data is read out to the query execution unit 9 can be reduced. Hereinafter, the effects expected in the second embodiment will be described in comparison with the effects expected in the first embodiment. In addition, the following description is only for deepening the understanding of the first embodiment and the second embodiment, and deviates from the technical scope of the present invention simply because the following expected effects are not achieved. It is not a thing. Therefore, FIGS. 11A to 13B used in the description are not necessarily precise descriptions. For example, in the disk seek image diagrams of FIGS. 11B, 12B, and 13B, the time length represented by the unit distance on the horizontal axis is not necessarily the same.

例えば、第一実施例において、図11Aに例示するように、クエリ実行部9から、6つのI/O要求A〜Fが発行されたとする。第一実施例では、I/O最適化部27が存在しないので、DBMS5において、第二実施例のように、DBMS5内で、OS15へ発行する複数のI/O要求A〜Fの並び替えは行われない。この場合には、例えば、OS15のカーネル、或いは、外部記憶装置19の機能によって、I/O要求の並び替えが行われる場合がある。例えば、全I/O要求A〜Fのうち、I/O要求A〜CとD〜Fとの各グループ別に並び替えが行われる場合がある。全I/O要求A〜Fではなく、グループ別に行われるのは、例えば、OS15や外部記憶装置19にとっては、どれだけの数のI/O要求が来るかわからないので、所定数或いは一定時間待って蓄積された段階でI/O要求の並び替えを行わないと、上位の装置或いはコンピュータプログラムを長く待たせてしまうことになるからである。図11Aの例では、OS15又は外部記憶装置19が、I/O要求A〜Cまで受け付けた段階で、「A→B→C」の順から「B→C→A」の順に並び替えてデータ読出しを行う。次に、OS15又は外部記憶装置19が、次のI/O要求D〜Fまで受け付けた段階で、「D→E→F」の順から「E→F→D」の順に並び替えてデータ読出しを行う。この結果、図11Bに例示するように、I/O要求A〜Fに対応するデータの読み出しのためのディスクシーク時間長をある程度短縮化することができる(しかし、前述したようにI/O要求が並行して発行されるので、これでも、従来技術に比べれば、短縮化される)。   For example, in the first example, it is assumed that six I / O requests A to F are issued from the query execution unit 9 as illustrated in FIG. 11A. In the first embodiment, since the I / O optimization unit 27 does not exist, in the DBMS 5, as in the second embodiment, the rearrangement of the plurality of I / O requests A to F issued to the OS 15 is performed in the DBMS 5. Not done. In this case, for example, the I / O requests may be rearranged by the kernel of the OS 15 or the function of the external storage device 19. For example, rearrangement may be performed for each group of I / O requests A to C and D to F among all I / O requests A to F. For example, the OS 15 or the external storage device 19 does not know how many I / O requests are received, but waits for a predetermined number or a fixed time, instead of all I / O requests A to F. This is because if the rearrangement of the I / O requests is not performed at the accumulated stage, the host device or the computer program will wait for a long time. In the example of FIG. 11A, when the OS 15 or the external storage device 19 receives the I / O requests A to C, the data is rearranged in the order of “A → B → C” to “B → C → A”. Read. Next, when the OS 15 or the external storage device 19 accepts the next I / O requests D to F, the data is read out in the order of “D → E → F” to “E → F → D”. I do. As a result, as illustrated in FIG. 11B, the disk seek time length for reading data corresponding to the I / O requests A to F can be reduced to some extent (however, as described above, the I / O request is Will be issued in parallel, which is still shorter than the prior art).

これに対し、第二実施例では、図12Aに例示するように、DBMS5内で、OS15へ発行する複数のI/O要求A〜Fの順序が最適化され、最適化後の順序で、I/O要求がOS15を介して外部記憶装置19へと発行される。このため、図12Bに例示するように、第一実施例に比べて、I/O要求A〜Fに対応するデータの読み出しのためのディスクシーク時間長を短縮化することができる。なお、この第二実施例において、第一実施例のように、OS15或いは外部記憶装置19によってI/O要求の並び替えが行われたとしても、I/O最適化部27によって並び返された順序と同じ順序になる可能性が大きいので、図12A及び図12Bに例示の効果が期待される。   On the other hand, in the second embodiment, as illustrated in FIG. 12A, the order of the plurality of I / O requests A to F issued to the OS 15 is optimized in the DBMS 5. A / O request is issued to the external storage device 19 via the OS 15. Therefore, as illustrated in FIG. 12B, the disk seek time length for reading data corresponding to the I / O requests A to F can be shortened as compared to the first embodiment. In the second embodiment, as in the first embodiment, even if the I / O requests are rearranged by the OS 15 or the external storage device 19, they are rearranged by the I / O optimization unit 27. Since there is a high possibility that the order is the same as the order, the effects illustrated in FIGS. 12A and 12B are expected.

また、第二実施例において、例えば、バッチスケジュール処理によってI/O要求の発行順序が最適化された後に、スケジュール対象外のI/O要求が発行されて、そのI/O要求が優先的にDBMS5から発行された場合には、I/O要求A〜Fに対応するデータの読み出しのためのディスクシーク時間長は、図13A及び図13Bに例示するように、即時発行が全く無い場合に比べて、長くなる可能性がある。しかし、それでも、少なくとも従来よりは、I/O要求A〜Fに対応するデータの読み出しのためのディスクシーク時間長を短縮化することができる。なお、図13A、図13Bにおいて、I/O最適化部27は、I/O要求Eの即時発行が決まった場合、残りのI/O要求A〜D及びFの並び替えをやり直しても良い。   In the second embodiment, for example, after the I / O request issuance order is optimized by batch schedule processing, an I / O request that is not scheduled is issued, and the I / O request is given priority. When issued from the DBMS 5, the disk seek time length for reading data corresponding to the I / O requests A to F is larger than that when there is no immediate issuance as illustrated in FIGS. 13A and 13B. Can be long. However, it is still possible to shorten the disk seek time length for reading data corresponding to the I / O requests A to F at least conventionally. 13A and 13B, the I / O optimization unit 27 may rearrange the remaining I / O requests A to D and F when the immediate issue of the I / O request E is determined. .

以下、本発明の第三実施例について説明する。   The third embodiment of the present invention will be described below.

この第三実施例では、クエリ実行部9は、第一実施例(又は第二実施例)において、複数のデータが読み出された場合、読み出された順にタスクの実行を再開していくのではなく、データ取得処理を開始した順に、タスクの実行を再開していく。タスクの実行を再開する順序を制御するための方法として、例えば、データ取得待ち表を用いる方法がある。   In the third embodiment, the query execution unit 9 resumes the execution of tasks in the order of reading when a plurality of data is read in the first embodiment (or the second embodiment). Instead, the task execution is resumed in the order in which the data acquisition processing is started. As a method for controlling the order in which task execution is resumed, for example, there is a method using a data acquisition waiting table.

図14Aは、本発明の第三実施例におけるデータ取得待ち表の構成例を示す。   FIG. 14A shows a configuration example of a data acquisition waiting table in the third embodiment of the present invention.

データ取得待ち表71は、データベースサーバ1の記憶資源に記憶される情報である。データ取得待ち表71は、複数の待ち情報71R、71R、…から構成される。待ち情報71Rは、データ取得順序番号とタスクIDとで構成される。データ取得順序番号は、データ取得処理を開始する順序を表した番号である。タスクIDは、待ち情報71Rを記述したタスクのIDである。   The data acquisition waiting table 71 is information stored in the storage resource of the database server 1. The data acquisition waiting table 71 includes a plurality of pieces of waiting information 71R, 71R,. The waiting information 71R includes a data acquisition sequence number and a task ID. The data acquisition order number is a number representing the order in which the data acquisition process is started. The task ID is an ID of a task describing the waiting information 71R.

図14Bは、生成された子タスクが第一実施例で行う処理との第一の相違部分を示す。   FIG. 14B shows a first difference from the process performed by the generated child task in the first embodiment.

生成された子タスクは、データ取得処理を実行する前に、データ取得待ち表71に、自分に対応した待ち情報を挿入する(S61)。具体的には、当該子タスクは、自分に対応した待ち情報71Rとして、図3のS11のデータ取得処理を開始する順番であるデータ取得順序番号と、自分のタスクのIDとを、データ取得待ち表71に挿入する。   The generated child task inserts waiting information corresponding to itself into the data acquisition waiting table 71 before executing the data acquisition processing (S61). Specifically, the child task, as wait information 71R corresponding to itself, sets the data acquisition sequence number that is the order of starting the data acquisition process of S11 in FIG. 3 and the ID of its own task to wait for data acquisition. Insert into Table 71.

図14Cは、生成された子タスクが第一実施例で行う処理との第二の相違部分を示す。   FIG. 14C shows a second difference from the process performed by the generated child task in the first embodiment.

当該子タスクは、データ取得処理によってデータが取得された場合、データ取得待ち表71を検索し、自タスクが最も古い待ちタスクとなるまで待ち、そうなった後、データ取得待ち表71から、S61で自分が挿入した待ち情報71Rを削除する(S62)。なお、最も古い待ちタスクになったかどうかは、データ取得待ち表71に記入されているデータ取得順序番号の中で、自分が挿入した待ち情報71R中のデータ取得順序番号が若い番号かどうかを判別することにより、特定することができる。なお、別法として、例えば、データ取得待ち表71Rが、待ち行列であって、自分が書いた待ち情報71Rが先頭アドレスになったときに、自タスクが最も古い待ちタスクであると判別しても良い。   When the data is acquired by the data acquisition process, the child task searches the data acquisition waiting table 71 and waits until its own task becomes the oldest waiting task. The waiting information 71R inserted by the user is deleted (S62). Whether or not the oldest waiting task has been reached is determined by determining whether or not the data acquisition sequence number in the waiting information 71R inserted by itself is a lower number among the data acquisition sequence numbers entered in the data acquisition waiting table 71. This can be specified. As another method, for example, when the data acquisition waiting table 71R is a queue, and the waiting information 71R written by itself becomes the head address, it is determined that the own task is the oldest waiting task. Also good.

以上の処理により、生成された複数の子タスクは、データ取得処理によってデータ待ちとなった場合、データが取得された順に実行の再開となるのではなく、データ取得処理を開始した順に、実行の再開となる。具体的には、例えば、図15Aに例示するように、データ取得処理の開始順序と同じ順序でI/O要求A〜Fが発行された場合、その順序と違って、例えば、I/O要求Aに対応したデータAよりも先に、I/O要求B、Cの応答としてデータB、Cが取得されたとしても、データB、Cを処理するタスクB、Cの実行の再開は待ちとなり、データAが取得されてそれを処理するタスクAの実行が再開された後に、タスクB、Cの順序で実行が再開される(なお、ディスクシークイメージとしては、図15Bに例示する通りであり、例えば第一実施例と同じである)。このように、この第三実施例では、各タスクの実行を、データ取得処理の開始順序と同じ順序で再開していくことができる。   With the above processing, when the plurality of child tasks generated are waiting for data in the data acquisition process, the execution is not resumed in the order in which the data was acquired, but in the order in which the data acquisition process was started. It will be resumed. Specifically, for example, as illustrated in FIG. 15A, when the I / O requests A to F are issued in the same order as the start order of the data acquisition processing, for example, the I / O request is different from the order. Even if data B, C is acquired as a response to I / O requests B, C before data A corresponding to A, execution of tasks B, C that process data B, C is resumed. After the data A is acquired and the execution of the task A that processes the data A is resumed, the execution is resumed in the order of the tasks B and C (note that the disk seek image is as illustrated in FIG. 15B) For example, the same as the first embodiment). Thus, in the third embodiment, the execution of each task can be resumed in the same order as the start order of the data acquisition process.

以上、本発明の好適な幾つかの実施例を説明したが、本発明は、それらの実施例に限定されるものでなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。   As mentioned above, although several suitable Example of this invention was described, it cannot be overemphasized that this invention is not limited to those Examples, and can be variously changed in the range which does not deviate from the summary. Absent.

例えば、第二実施例において、I/O最適化部27は、別種の所定のキャンセルコマンドを受け付けた場合には、そのキャンセルコマンドで指定されているI/O要求、又は、スケジュール対象外キュー61Aに残っている全てのI/O要求を、スケジュール対象外キュー61Aから取り出し、取り出されたI/O要求を、スケジュール対象キュー61Bに格納してもよい。   For example, in the second embodiment, when the I / O optimization unit 27 receives another type of predetermined cancel command, the I / O request specified by the cancel command or the non-scheduled queue 61A All I / O requests remaining in the queue may be taken out from the non-scheduled queue 61A, and the retrieved I / O requests may be stored in the scheduled queue 61B.

また、例えば、各実施例において、DBMS5の処理は、それを読込んだプロセッサによって実行することができる。具体的には、例えば、親タスクを実行するプロセッサは、データベースサーバ1の記憶資源(例えばメモリ)上に子タスクを生成し、その子タスクを読込んで実行することにより、例えば図3のS11以降の処理を実行することができる。   Further, for example, in each embodiment, the processing of the DBMS 5 can be executed by a processor that has read it. Specifically, for example, a processor that executes a parent task generates a child task on a storage resource (for example, a memory) of the database server 1 and reads and executes the child task, for example, after S11 in FIG. Processing can be executed.

また、例えば、実行タスク管理部13が、所定のタイミングで、クエリプランに基づいて、残存ステップ数(例えば、最後のOPまでに残っているOPの数)を計算し、残存ステップ数の少ないタスクの優先度を上げても良い。この場合、例えば、図3のS2、S3の処理によって、優先度が上げられたタスクを優先的に生成することができる。また、そのタスクは、自分の優先度が高いので、I/O要求を発行する場合、スケジュール対象外キュー61Aに、発行したI/O要求を挿入することができる。   In addition, for example, the execution task management unit 13 calculates the number of remaining steps (for example, the number of OPs remaining until the last OP) based on the query plan at a predetermined timing, and the task having a small number of remaining steps. You may raise the priority. In this case, for example, it is possible to preferentially generate a task whose priority is increased by the processing of S2 and S3 in FIG. Also, since the task has a high priority, when issuing an I / O request, the issued I / O request can be inserted into the non-scheduled queue 61A.

また、例えば、第二実施例において、スケジュール対象とスケジュール対象外との二種類のキューではなく、三以上の優先度の異なるキューが用意されても良い。その場合、クエリ実行部9は、I/O要求の優先度に応じた値のスケジュールフラグを決定し、その決定されたスケジュールフラグ値に応じたキューに、I/O要求を格納してもよい。   Further, for example, in the second embodiment, three or more queues with different priorities may be prepared instead of the two types of queues for the schedule target and the non-schedule target. In this case, the query execution unit 9 may determine a schedule flag having a value corresponding to the priority of the I / O request, and store the I / O request in a queue corresponding to the determined schedule flag value. .

また、例えば、第二実施例において、I/O最適化部27は、DBMS5の外に存在しても良い。具体的には、例えば、I/O最適化部27は、DBMS5とOS15との間に介在しても良い。I/O最適化部27は、DBMS5から発行された複数のI/O要求を受け付けることができる。また、I/O最適化部27は、AP3からもI/O要求をうつけても良い。I/O最適化部27は、受け付けた複数のI/O要求(発行元はDBMS5又はAP3)を、受け付けた順序と異なる順序に並び替え、並び替え後の順序でI/O要求をOS15に発行することができる。   Further, for example, in the second embodiment, the I / O optimization unit 27 may exist outside the DBMS 5. Specifically, for example, the I / O optimization unit 27 may be interposed between the DBMS 5 and the OS 15. The I / O optimization unit 27 can accept a plurality of I / O requests issued from the DBMS 5. Further, the I / O optimization unit 27 may receive an I / O request from the AP 3 as well. The I / O optimization unit 27 rearranges the received plurality of I / O requests (issuer is DBMS5 or AP3) in an order different from the accepted order, and sends the I / O request to the OS 15 in the order after the rearrangement. Can be issued.

また、例えば、データベース管理システムは、一つのコンピュータマシン上に構築されてもよいし、複数のコンピュータマシン上に構築されても良い。具体的には、例えば、各実施例にけるDBMS5の処理は複数のコンピュータ上で並列に動作する並列DBMSにおいても同様に適用することができる。並列DBMSでは、クエリ生成部でクエリプランを生成した後、処理を複数のDBMSサーバに割り当てる。そのため、各DBMSサーバにおいて、本発明の技術を用いて、割り当てられた処理を複数のタスクを生成しながらI/O要求を並列に処理することで、問合せの実行時間の短縮を図ることが可能である。   Further, for example, the database management system may be constructed on one computer machine or may be constructed on a plurality of computer machines. Specifically, for example, the processing of the DBMS 5 in each embodiment can be similarly applied to a parallel DBMS operating in parallel on a plurality of computers. In parallel DBMS, after a query plan is generated by a query generation unit, processing is assigned to a plurality of DBMS servers. Therefore, each DBMS server can reduce the query execution time by processing I / O requests in parallel while generating a plurality of tasks using the technology of the present invention. It is.

1…データベースサーバ 3…アプリケーションプログラム 5…データベース管理システム 7…クエリ受付部 9…クエリ実行部 11…クエリプラン生成部 12…データベースバッファ 13…実行タスク管理部 15…オペレーティングシステム 17…通信ネットワーク 19…外部記憶装置 21…データベース 23…表 25…索引 27…I/O最適化部 61A…スケジュール対象外キュー 61B…スケジュール対象キュー 63…I/O要求 DESCRIPTION OF SYMBOLS 1 ... Database server 3 ... Application program 5 ... Database management system 7 ... Query reception part 9 ... Query execution part 11 ... Query plan production | generation part 12 ... Database buffer 13 ... Execution task management part 15 ... Operating system 17 ... Communication network 19 ... External Storage device 21 ... Database 23 ... Table 25 ... Index 27 ... I / O optimization unit 61A ... Non-scheduled queue 61B ... Schedule-targeted queue 63 ... I / O request

Claims (10)

クエリを受け付けるクエリ受付部と、
前記受け付けたクエリを実行し、その際、必要に応じて、記憶装置からデータベースのデータを読み出すためのデータ読出し要求を発行するクエリ実行部と
を備え、
前記クエリ実行部は、
動的にタスクを生成していき、生成された複数のタスクを並行して実行するようになっており、
各タスクの実行において、前記データベースのデータを必要とする都度に、そのデータを取得するためのタスクを生成し、
該生成されたタスクの実行において、必要に応じて、前記データベースからデータを読み出すための前記データ読出し要求を発行する、
データベース管理システム。
A query acceptance unit for accepting queries,
A query execution unit that executes the accepted query, and issues a data read request for reading database data from the storage device, if necessary,
The query execution unit
The task is dynamically generated and the generated tasks are executed in parallel.
In each task execution, each time the data of the database is required, a task for acquiring the data is generated,
In the execution of the generated task, if necessary, issue the data read request for reading data from the database.
Database management system.
前記クエリ実行部は、所定の状況にあるタスクの現存数が所定数に達している場合には、新たなタスクの生成を待ち、前記現存数が減った場合に、前記新たなタスクを生成する、
請求項1記載のデータベース管理システム。
The query execution unit waits for generation of a new task when the existing number of tasks in a predetermined situation reaches a predetermined number, and generates the new task when the existing number decreases. ,
The database management system according to claim 1.
前記クエリ実行部から発行された複数個のデータ読出し要求を受け付け、受け付けた複数個のデータ読出し要求を、前記複数個のデータ読出し要求を受け付けた順序とは異なる、全体としてのデータ読出し時間長を短縮化するための順序で発行する読出し順序制御部を更に備える、
請求項1記載のデータベース管理システム。
A plurality of data read requests issued from the query execution unit are received, and the received data read requests are different from the order in which the plurality of data read requests are received. It further comprises a read order control unit that issues in an order for shortening.
The database management system according to claim 1.
優先度の異なる複数のキューを更に備え、
前記クエリ実行部が、前記生成されたタスクの実行により、前記複数のキューのうち、所定の条件に適合する優先度に対応したキューに、前記データ読出し要求を格納し、
前記読出し順序制御部は、優先度の高いキューに格納されているデータ読出し要求ほど優先的に発行する、
請求項3記載のデータベース管理システム。
A plurality of queues having different priorities,
The query execution unit stores the data read request in a queue corresponding to a priority meeting a predetermined condition among the plurality of queues by executing the generated task,
The read order control unit issues data read requests stored in a high priority queue with priority.
The database management system according to claim 3.
前記読出し順序制御部は、所定のコマンドを受け付けた場合には、或る優先度のキューに格納されている少なくとも一つの読出し要求を別の優先度のキューに移動させる、
請求項4記載のデータベース管理システム。
The read order control unit, when receiving a predetermined command, moves at least one read request stored in a queue with a certain priority to a queue with another priority,
The database management system according to claim 4.
前記クエリ実行部は、前記受け付けたクエリの実行プランの内容、又は、前記受け付けたクエリの実行に求められる性能要件に応じて、どの優先度のキューに読出し要求を格納するかを決定する、
請求項4記載のデータベース管理システム。
The query execution unit determines in which priority queue the read request is stored according to the content of the execution plan of the received query or the performance requirement required for the execution of the received query.
The database management system according to claim 4.
クエリ実行プランに基づいて残存ステップ数を計算し、前記計算された残存ステップ数の少ないタスクの優先度を上げるタスク管理部を更に備え、
前記クエリ実行部が、優先度の上がったタスクを実行することにより発行される読出し要求を、該優先度に対応するキューに格納する、
請求項4記載のデータベース管理システム。
A task management unit that calculates the number of remaining steps based on the query execution plan and raises the priority of the task with the small number of remaining steps calculated;
The query execution unit stores a read request issued by executing a task with an increased priority in a queue corresponding to the priority.
The database management system according to claim 4.
前記クエリ実行部は、生成された各タスクの実行において、前記データベースのデータの取得を待ち、該データを取得した後、データの取得待ちを開始した順序と同じ順序で、タスクの実行を再開する、
請求項1又は3記載のデータベース管理システム。
In the execution of each generated task, the query execution unit waits for the acquisition of data in the database, and after acquiring the data, resumes the execution of tasks in the same order as the order in which the data acquisition wait was started ,
The database management system according to claim 1 or 3.
クエリを受け付けるステップと、
前記受け付けたクエリを実行し、その際、必要に応じて、記憶装置からデータベースのデータを読み出すためのデータ読出し要求を発行するクエリ実行ステップと
を有し
前記クエリ実行ステップでは、
動的にタスクを生成していき、生成された複数のタスクを並行して実行し、
各タスクの実行において、前記データベースのデータを必要とする都度に、そのデータを取得するためのタスクを生成し、
該生成されたタスクの実行において、必要に応じて、前記データベースからデータを読み出すための前記データ読出し要求を発行する、
データベース管理方法。
Receiving a query;
A query execution step of executing the accepted query, and issuing a data read request for reading the data of the database from the storage device, if necessary, in the query execution step,
Dynamically generate tasks, execute multiple generated tasks in parallel,
In each task execution, each time the data of the database is required, a task for acquiring the data is generated,
In the execution of the generated task, if necessary, issue the data read request for reading data from the database.
Database management method.
請求項1記載のデータベース管理システムと、
前記データベース管理システムから発行された複数個のデータ読出し要求を受け付け、受け付けた複数個のデータ読出し要求を、前記複数個のデータ読出し要求を受け付けた順序とは異なる、全体としてのデータ読出し時間長を短縮化するための順序で発行する読出し順序制御部と
を備えるコンピュータシステム。
A database management system according to claim 1;
A plurality of data read requests issued from the database management system are received, and the received data read requests are different from the order in which the plurality of data read requests are received, and the overall data read time length is set. A computer system comprising: a reading order control unit that issues in an order for shortening.
JP2014224023A 2014-11-04 2014-11-04 Database management system and method Pending JP2015026396A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014224023A JP2015026396A (en) 2014-11-04 2014-11-04 Database management system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014224023A JP2015026396A (en) 2014-11-04 2014-11-04 Database management system and method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2013080323A Division JP5674850B2 (en) 2013-04-08 2013-04-08 Database management system and method

Publications (1)

Publication Number Publication Date
JP2015026396A true JP2015026396A (en) 2015-02-05

Family

ID=52490941

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014224023A Pending JP2015026396A (en) 2014-11-04 2014-11-04 Database management system and method

Country Status (1)

Country Link
JP (1) JP2015026396A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11941029B2 (en) 2022-02-03 2024-03-26 Bank Of America Corporation Automatic extension of database partitions

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11941029B2 (en) 2022-02-03 2024-03-26 Bank Of America Corporation Automatic extension of database partitions

Similar Documents

Publication Publication Date Title
JP4611830B2 (en) Database management system and method
US8856193B2 (en) Merge monitor for table delta partitions
KR101721892B1 (en) Managing queries
US8510316B2 (en) Database processing system and method
US9639576B2 (en) Database management system, computer, and database management method
US10885030B2 (en) Database management system and computer system having first and second query execution parts which execute database operations in parallel
EP2843559A1 (en) Database management system, computer, and database management method
JP5858308B2 (en) Database management system, computer, database management method
JP6272556B2 (en) Shared resource update device and shared resource update method
US20220067108A1 (en) Microservices data aggregation search engine updating
JP2018147301A (en) Computer system and processing assignment method
JP5674850B2 (en) Database management system and method
JP5283675B2 (en) Database management system and method
JP2015026396A (en) Database management system and method
JP6677605B2 (en) Program, storage system, and storage system control method
JP6108418B2 (en) Database management system, computer, database management method
CN114942953A (en) Cross-system data updating and querying method and related equipment
JP4951326B2 (en) Computer program for optimizing the processing order of I / O requests
JP2019101595A (en) Database management system and method
US20170147408A1 (en) Common resource updating apparatus and common resource updating method
JP2016184272A (en) Database management system, method of buffering the same, and computer program
CN111737298A (en) Cache data control method and device based on distributed storage
JP2008052635A (en) Database access system and its program

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20141201

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20141201

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150707

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20160126