JP2007293723A - Database managing system and managing method - Google Patents

Database managing system and managing method Download PDF

Info

Publication number
JP2007293723A
JP2007293723A JP2006122621A JP2006122621A JP2007293723A JP 2007293723 A JP2007293723 A JP 2007293723A JP 2006122621 A JP2006122621 A JP 2006122621A JP 2006122621 A JP2006122621 A JP 2006122621A JP 2007293723 A JP2007293723 A JP 2007293723A
Authority
JP
Japan
Prior art keywords
sql query
execution plan
execution
unit
cost
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.)
Withdrawn
Application number
JP2006122621A
Other languages
Japanese (ja)
Inventor
Koichi Hattori
孝一 服部
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.)
Hitachi Information Systems Ltd
Original Assignee
Hitachi Information Systems Ltd
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 Hitachi Information Systems Ltd filed Critical Hitachi Information Systems Ltd
Priority to JP2006122621A priority Critical patent/JP2007293723A/en
Publication of JP2007293723A publication Critical patent/JP2007293723A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To provide an optimal performance plan in consideration of cache in a short time. <P>SOLUTION: A database managing system includes: a cache area 11 for storing an SQL query; an SQL query performing part 21 for performing the SQL query; an SQL query syntax analyzing/normalizing part 22 for analyzing and normalizing a syntax; an SQL query optimizing part 23 for determining an performance plan by optimization processing; a DBMS control part 26 for managing the cach area 11, etc.; an performance plan storage file 28 for storing the determined performance plan and information concerning a cost; and a cost calculating part 24 for calculating the cost of the performance plan. The DBMS control part 26 determines whether the SQL query being the same as that stored in the performance plan storage file is stored or not. When the same SQL query is stored, the cost calculating part 24 calculates the cost of the performance plan of the SQl query by interruption processing. The SQL performing part 21 selects the performance plan with the minimum cost as the result of the calculation and performs the plan. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、共有データとしてデータベースを管理し、データに対する問い合わせを処理するデータベース管理システム及びデータベース管理方法に係り、特にデータに対する問い合わせを処理するための手順である実行プランを高速にすることができるデータベース管理システム及びデータベース管理方法に関する。   The present invention relates to a database management system and a database management method for managing a database as shared data and processing a query for data, and in particular, a database capable of speeding up an execution plan which is a procedure for processing a query for data. The present invention relates to a management system and a database management method.

一般に従来技術によるデータベース管理システム(DBMS:DataBase Management System )は、ユーザからの問い合わせが入力された場合、当該問い合わせがあったSQLクリエが正しい構文か否か並びに冗長構文の削除を行う解析・正規化ステップと、問い合わせに際して利用するインデックスの検討、テーブルの結合順序の決定、実行プランのコスト計算並びに最適な実行プランを選択する最適化ステップと、前記選択された実行プランを実行し、該実行中にデータベースから読み込んだデータをキャッシュに格納する実行ステップとを順次実行することによって、この実行結果をユーザに提示する様に構成されている。   Generally, a database management system (DBMS: DataBase Management System) according to a conventional technique, when a query from a user is input, analyzes and normalizes whether or not the SQL query that has been queried is correct syntax and deletes redundant syntax. A step, an examination of an index to be used at the time of inquiry, determination of a joining order of tables, a cost calculation of an execution plan and an optimization step of selecting an optimal execution plan, and executing the selected execution plan, The execution result of storing the data read from the database in the cache is sequentially executed, so that the execution result is presented to the user.

前記最適化ステップは、問合せに対する応答時間に非常に大きな影響を与える場合があり、例えば、適切でない実行プランを選択してしまうと、前記実行ステップの処理時間が数倍以上に延びてしまうことがあり、実行される問合せのクエリ内容が複雑になり、最適化処理中に検討される実行プランのパターンが増加し、適切な実行プランの選択にかかる時間が延びてしまう傾向がある。つまり、データベース管理システム(DBMS)の問合せ応答時間を短縮するには、最適な実行プランをできるだけ短い時間で選択することが重要である。   The optimization step may have a very large effect on the response time to a query. For example, if an inappropriate execution plan is selected, the processing time of the execution step may increase several times or more. There is a tendency that the query content of the query to be executed becomes complicated, the pattern of execution plans considered during the optimization process increases, and the time taken to select an appropriate execution plan increases. That is, in order to shorten the query response time of the database management system (DBMS), it is important to select an optimal execution plan in the shortest possible time.

この最適な実行プランを短時間で選択する技術が記載された文献としては、例えば下記特許文献が挙げられる。この文献記載技術は、所定の問合せについて、候補となる実行プランのコストを取得し、その中で最小のコストとなる実行プランを問合せ内容と共にファイルに格納し、同じ問合せが実行された場合は、最適化ステップを行う替わりにこのファイルから実行プランを読み出して実行するというものである。
特開2005−18430号公報
As a document describing a technique for selecting this optimal execution plan in a short time, for example, the following patent document can be cited. This document description technology acquires the cost of a candidate execution plan for a given query, stores the execution plan with the lowest cost in the file together with the query content, and when the same query is executed, Instead of performing an optimization step, the execution plan is read from this file and executed.
JP 2005-18430 A

前述の従来技術による最適な実行プランを短時間で選択する技術は、同じ問合せが実行された場合に以前の実行プランを再利用することにより、最適化のステップの時間を大幅に短縮することができるものの、実行中にキャッシュに読み込んだデータについて考慮していないため、キャッシュに読み込み済のデータによっては、新規にキャッシュ上にデータを読み込むオーバーヘッド(メモリ領域が不足していた場合の既存のキャッシュの削除やページファイルへの退避を含む)が実行プラン再利用の短縮効果を上回ってしまう可能性があると言う不具合があった。尚、一般に物理ディスクとのIO(Input/Output)は、メモリ上での処理に比べ低速であるため、このような状況は十分に考えられる。   The technique for selecting the optimal execution plan in the previous technology in a short time can greatly reduce the time of the optimization step by reusing the previous execution plan when the same query is executed. Although it does not consider the data read into the cache during execution, depending on the data that has already been read into the cache, the overhead of reading data into the cache newly (the existing cache when the memory area is insufficient) (Including deletion and saving to a page file) may outweigh the effect of reducing execution plan reuse. In general, IO (Input / Output) with a physical disk is slower than processing on a memory, and such a situation is sufficiently conceivable.

本発明の目的は、前述の従来技術による不具合を除去することであり、キャッシュ上のメモリを考慮した最適な実行プランを短時間で提供することができるデータベース管理システムおよび管理方法を提供することである。   An object of the present invention is to eliminate the problems caused by the prior art described above, and to provide a database management system and a management method capable of providing an optimal execution plan in consideration of the memory on the cache in a short time. is there.

前記目的を達成するために本発明は、データベース管理システム用のSQLクエリを一時的に格納するキャッシュ領域と、受け付けたSQLクエリを実行プランに従って実行するSQLクエリ実行部と、入力された問合せのSQLクエリに対して構文解析及び正規化を行うSQLクエリ構文解析・正規化部と、前記SQLクエリの最適化処理により実行プランを決定するSQLクエリ最適化部と、前記キャッシュ領域の管理並びに割り込み処理を行うDBMS制御部と、前記SQLクエリ最適化部により決定した実行プランとコストに関する情報とを格納する実行プラン格納ファイルと、実行プランのコスト計算を行うコスト計算部とを備えるデータベース管理システムであって、前記DBMS制御部が、前記実行プラン格納ファイルに格納されたSQLクエリと同一のSQLクエリが格納されているか否かを判定し、該判定の結果、同一のSQLクエリが格納されている場合、割り込み処理によって前記SQLクリエの実行プランのコスト計算をコスト計算部により行い、前記SQL実行部が、前記計算の結果の最小コストとなった実行プランを選択して実行することを第1の特徴とし、該データベース管理システムにおいて、前記DBMS制御部が、前記SQLクエリ最適化部により最適化した実行プランの内、相対的にコストの低い所定数の実行プランを、前記実行プラン格納ファイルに格納することを第2の特徴とする。   To achieve the above object, the present invention provides a cache area for temporarily storing an SQL query for a database management system, an SQL query execution unit for executing an accepted SQL query according to an execution plan, and an SQL of an input query. An SQL query syntax analysis / normalization unit that parses and normalizes a query, an SQL query optimization unit that determines an execution plan by the optimization processing of the SQL query, management of the cache area, and interrupt processing A database management system comprising: a DBMS control unit to perform; an execution plan storage file for storing information related to the execution plan and cost determined by the SQL query optimization unit; and a cost calculation unit for calculating the cost of the execution plan. The DBMS control unit stores the execution plan in the execution plan storage file. If the same SQL query is stored as a result of the determination, if the same SQL query is stored as a result of the determination, the cost calculation of the execution plan of the SQL query is performed by interrupt processing. The first feature is that the SQL execution unit selects and executes an execution plan that results in the minimum cost of the calculation result. In the database management system, the DBMS control unit A second feature is that a predetermined number of execution plans having a relatively low cost among the execution plans optimized by the SQL query optimization unit are stored in the execution plan storage file.

更に本発明は、データベース管理システム用のSQLクエリを一時的に格納するキャッシュ領域と、受け付けたSQLクエリを実行プランに従って実行するSQLクエリ実行部と、入力された問合せのSQLクエリに対して構文解析及び正規化を行うSQLクエリ構文解析・正規化部と、前記SQLクエリの最適化処理により実行プランを決定するSQLクエリ最適化部と、前記キャッシュ領域の管理並びに割り込み処理を行うDBMS制御部と、前記SQLクエリ最適化部により決定した実行プランとコストに関する情報とを格納する実行プラン格納ファイルと、実行プランのコスト計算を行うコスト計算部とを備えるデータベース管理システムのデータベース管理方法であって、前記DBMS制御部が、前記実行プラン格納ファイルに格納されたSQLクエリと同一のSQLクエリが格納されているか否かを判定するステップと、該判定の結果、同一のSQLクエリが格納されている場合、割り込み処理によって前記SQLクリエの実行プランのコスト計算をコスト計算部により行うステップと、前記SQL実行部が、前記計算の結果の最小コストとなった実行プランを選択して実行するステップとを実行することを第3の特徴とし、該データベース管理方法において、前記DBMS制御部が、前記SQLクエリ最適化部により最適化した実行プランの内、相対的にコストの低い所定数の実行プランを、前記実行プラン格納ファイルに格納することを第4の特徴とする。   Further, the present invention provides a cache area for temporarily storing an SQL query for a database management system, an SQL query execution unit for executing an accepted SQL query according to an execution plan, and parsing the SQL query of the input query. A SQL query syntax analysis / normalization unit that performs normalization, an SQL query optimization unit that determines an execution plan by the optimization processing of the SQL query, a DBMS control unit that performs management of the cache area and interrupt processing, A database management method for a database management system, comprising: an execution plan storage file that stores an execution plan determined by the SQL query optimization unit and information related to costs; and a cost calculation unit that performs cost calculation of the execution plan, The DBMS control unit stores the execution plan storage file. A step of determining whether or not the same SQL query as the executed SQL query is stored, and if the same SQL query is stored as a result of the determination, the cost calculation of the execution plan of the SQL query is performed by interrupt processing The database management method has the third feature of executing the steps of: performing by the cost calculating unit; and executing the step of selecting and executing the execution plan having the minimum cost as a result of the calculation by the SQL execution unit. The DBMS control unit stores, in the execution plan storage file, a predetermined number of execution plans having a relatively low cost among the execution plans optimized by the SQL query optimization unit. And

本発明によるデータベース管理システム及び管理方法は、キャッシュ領域に既にデータベース管理システム用のSQLクエリを格納しているときは、SQLクエリ構文解析・正規化部によるSQLクエリの構文チェック並びに冗長な構文の削除を行う正規化が既に行われていることを実行プラン格納ファイルに格納された実行プランの有無により判定し、該判定した実行プランのコスト計算を行って最適な実行プランを選定することによって、キャッシュ上のメモリを考慮した最適な実行プランを短時間で提供することができる。   In the database management system and management method according to the present invention, when the SQL query for the database management system is already stored in the cache area, the syntax check of the SQL query by the SQL query parsing / normalization unit and the deletion of redundant syntax are performed. By determining whether or not normalization has already been performed based on the presence or absence of the execution plan stored in the execution plan storage file, the cost calculation of the determined execution plan is performed, and the optimal execution plan is selected. It is possible to provide an optimal execution plan in consideration of the above memory in a short time.

以下、本発明によるデータベース管理システムおよび管理方法の一実施形態を図面を参照して詳細に説明する。図1は本発明に係るデータベース管理システムの構成例を示す図、図2は実行プラン格納ファイルに格納される問合せのSQLテキストに関するテーブル情報の一例を示す説明図、図3は実行プラン格納ファイルに格納される、問合せの実行プランとそのコストに関するテーブル情報の一例を示す説明図、図4はDBMS制御部が管理するDBMSキャッシュ領域上のキャッシュ情報の一例を示す説明図、図5は業務データベース内のテーブルやインデックスに関する管理情報の一例を示す説明図、図6はコスト再計算部により行われるコスト再計算処理を示すフローチャート、図7はユーザからの問合せに対してデータベースシステム内で行われる処理を示すフローチャートである。
<構成の説明>
Hereinafter, an embodiment of a database management system and a management method according to the present invention will be described in detail with reference to the drawings. FIG. 1 is a diagram showing a configuration example of a database management system according to the present invention, FIG. 2 is an explanatory diagram showing an example of table information relating to an SQL text of an inquiry stored in an execution plan storage file, and FIG. 3 is an execution plan storage file FIG. 4 is an explanatory diagram showing an example of cache information stored in the DBMS cache area managed by the DBMS control unit, and FIG. 5 is a diagram in the business database. FIG. 6 is a flowchart showing cost recalculation processing performed by the cost recalculation unit, and FIG. 7 shows processing performed in the database system in response to a query from the user. It is a flowchart to show.
<Description of configuration>

本実施形態によるデータベース管理システムは、図1に示す如く、公衆回線30を介して複数のクラスアント40に接続されるサーバを含むコンピュータシステムにおいて、少なくとも主記憶装置10上にDBMS制御部26により動的に管理されるDBMS用のキャッシュ領域11と、受け付けたSQLクエリを実行プランに沿って実行するSQLクエリ実行部21と、入力された問合せのSQLクエリが正しい構文で書かれているかのチェックおよび冗長な構文の削除を行うSQLクエリ構文解析・正規化部22と、最適な実行プランを決定する最適化処理を行うSQLクエリ最適化部23と、実行プラン格納ファイル28に格納する情報を管理する実行プラン格納ファイル管理部25と、キャッシュ領域11の管理および業務データベース27へのIOを含むDBMS全体を制御するDBMS制御部26と、業務データベース27と、問合せのSQLクエリおよびSQLクエリ最適化部23で最適化中に検討された上位10個の実行プランとその検討途中ステップごとのコストに関する情報を格納する実行プラン格納ファイル28と、実行プラン格納ファイル28に格納されたSQLクエリと同じSQLクエリが実行された際に、登録された実行プランのコストの再計算を行い、もっともコストの低い実行プランをSQL実行部に返すコスト再計算部24を備える。   As shown in FIG. 1, the database management system according to the present embodiment is a computer system including a server connected to a plurality of clant 40 via a public line 30 and is operated at least on the main storage device 10 by the DBMS control unit 26. Managed DBMS cache area 11, SQL query execution unit 21 that executes the accepted SQL query according to the execution plan, check whether the SQL query of the input query is written in the correct syntax, and The SQL query syntax analysis / normalization unit 22 that deletes redundant syntax, the SQL query optimization unit 23 that performs optimization processing to determine an optimal execution plan, and information stored in the execution plan storage file 28 are managed. Execution plan storage file management unit 25, management of cache area 11 and business database The DBMS control unit 26 that controls the entire DBMS including IO to the server 27, the business database 27, the top 10 execution plans examined during optimization by the query SQL query and the SQL query optimization unit 23, and Execution plan storage file 28 that stores information about costs for each step in the course of examination, and recalculation of the cost of the registered execution plan when the same SQL query as the SQL query stored in the execution plan storage file 28 is executed And a cost recalculation unit 24 that returns the execution plan with the lowest cost to the SQL execution unit.

前記実行プラン格納ファイル28に格納する問合せのSQLテキストに関するSQLテキストテーブル情報は、例えば図2に示す如く、その項目としてSQLクエリに対して一意に割り当てられるSQLクエリIDと、実行されたSQLクエリテキストとその最終実行日時とから構成され、同実行プラン格納ファイル28に格納される問合せの実行プランとそのコストに関するテーブル情報は、例えば図3に示す如く、その項目として図2のSQLクエリIDに対応するSQLクエリIDと、プランごとに割り当てられるプランIDと、プラン内のステップごとに割り当てられるステップIDと、ステップの処理内容と、ステップで利用されるオブジェクトのIDと、ステップにかかる実行コストと、実行コストの内物理IOのコストにかかる物理IOコストとから構成される。尚、ここで記載しているステップとは実行プランを構成する手順のことを指すものとする。   The SQL text table information relating to the SQL text of the query stored in the execution plan storage file 28 includes, for example, as shown in FIG. 2, the SQL query ID uniquely assigned to the SQL query as the item and the executed SQL query text. The table of the execution plan of the query and its cost stored in the execution plan storage file 28 corresponds to the SQL query ID of FIG. 2 as an item, for example, as shown in FIG. SQL query ID to be executed, plan ID assigned to each plan, step ID assigned to each step in the plan, processing contents of the step, ID of the object used in the step, execution cost for the step, Of the execution costs, the cost of physical IO It consists of a physical IO cost. It should be noted that the steps described here indicate procedures that constitute an execution plan.

この実行プラン格納ファイル28内の図2及び図3に示したテーブルには、SQLクエリ最適化部23によって検討された実行プランの内、コストの低い方から上位10個の実行プランが、実行プラン格納ファイル管理部25によって格納される。尚、図3のテーブルに格納される物理IOコストの項目に入る数値はキャッシュデータを考慮しないものである。   The table shown in FIG. 2 and FIG. 3 in the execution plan storage file 28 includes the execution plans of the top 10 execution plans from the lowest cost among the execution plans examined by the SQL query optimization unit 23. Stored by the storage file management unit 25. It should be noted that the numerical values in the physical IO cost item stored in the table of FIG. 3 do not consider cache data.

DBMS制御部26が管理するDBMSキャッシュ領域上のキャッシュ情報は、図4に示す如く、キャッシュ上の読み込まれたオブジェクトごとに一意に割り当てられるキャッシュIDと、データベース内のオブジェクトを一意に示すオブジェクトIDと、キャッシュとして読み込まれているキャッシュブロック数を項目とから構成される。尚、ここで書くオブジェクトとは、データベースを構成するテーブルやインデックスのことを指し、ブロックとは、DBMSの管理するIO単位サイズのことを指すものである。   As shown in FIG. 4, the cache information on the DBMS cache area managed by the DBMS control unit 26 includes a cache ID that is uniquely assigned to each read object on the cache, and an object ID that uniquely indicates an object in the database. And the number of cache blocks read as a cache. The object written here refers to a table or an index constituting a database, and the block refers to an IO unit size managed by the DBMS.

前記業務データベース27内のテーブルやインデックスに関する管理情報は、例えば図5に示す如く、データベース内のオブジェクトごとに一意に割り当てられるオブジェクトIDと、そのオブジェクトの種類(テーブル、インデックス)を示すオブジェクトタイプと、オブジェクト名と、そのオブジェクトが使用する合計ブロック数と、オブジェクトタイプがインデックスの場合はその親となるテーブルのオブジェクトIDとから構成される。
<動作説明>
<最小実行プラン判定処理>
As shown in FIG. 5, for example, the management information related to the table and index in the business database 27 includes an object ID uniquely assigned to each object in the database, an object type indicating the type (table, index) of the object, It consists of the object name, the total number of blocks used by the object, and the object ID of the parent table when the object type is an index.
<Description of operation>
<Minimum execution plan determination process>

さて、この様に構成されたデータベース管理システムは、コスト再計算部24がコストの再計算を行うものであり、この処理手順は、図6に示す如く、まず実行プランコストテーブル(図3)から実行されたプランに関するレコードを抽出するステップS1と、次に抽出したレコードについてプランID1及びステップID1を基に計算を行うステップS2と、実行プランコストテーブル(図3)のオブジェクトIDに一致するキャッシュ情報が図4に示したキャッシュ領域にあるか否かを判定するステップS3と、キャッシュ領域にデータがある場合は、データベース管理テーブル(図5)のブロック数とキャッシュブロック数の割合と実行プランコストテーブルの物理IOコストからステップのコストを計算するステップS4とを実行する。   In the database management system configured as described above, the cost recalculation unit 24 recalculates the cost. This processing procedure starts with an execution plan cost table (FIG. 3) as shown in FIG. Step S1 for extracting a record relating to the executed plan, step S2 for calculating the next extracted record based on the plan ID 1 and step ID 1, and cache information matching the object ID of the execution plan cost table (FIG. 3) 4 is determined in the cache area shown in FIG. 4, and if there is data in the cache area, the number of blocks in the database management table (FIG. 5), the ratio of the number of cache blocks, and the execution plan cost table Step S4 for calculating the cost of the step from the physical IO cost of .

該ステップS4における計算は、今回の例では、顧客テーブルのインデックス姓のデータがキャッシュ上にないため、プランID1、ステップID1の物理IOコストが「150」のままとなり、顧客テーブルのデータが全てキャッシュ上にあるため、プランID2,ステップID1の物理IOコストが「0」となり、ステップコストも「150」(=650−500)となる。   In the calculation in step S4, in this example, since the data of the index surname of the customer table is not in the cache, the physical IO cost of the plan ID 1 and step ID 1 remains “150”, and all the data of the customer table is cached. Therefore, the physical IO cost of plan ID 2 and step ID 1 is “0”, and the step cost is also “150” (= 650−500).

次いで本システムは、キャッシュ上にデータがない場合や、ステップの再計算が完了したとき、その実行プランに対して計算していないステップがあるかを判定するステップS5を実行し、未計算のステップがある場合は、次のステップへ進む処理を行うステップS6を介してステップS3に戻り、未計算のステップがないことを判定した場合は、その実行プランに対する再計算結果を求めるステップS7と、未計算のプランがないかを判定するステップS8と、該ステップS8において未計算のプランがあると判定したときは、同じ手順で次のプランの計算を行うステップS9と、同未計算のプランがないと判定したとき(全プランの計算終了)は、最もコストの低い実行プランをSQLクエリ実行部21へ返すステップS10を実行する。   Next, when there is no data on the cache or when the recalculation of the step is completed, the system executes Step S5 for determining whether there is a step that has not been calculated for the execution plan. If there is, the process returns to step S3 via step S6 for performing the process of proceeding to the next step. If it is determined that there is no uncalculated step, step S7 for obtaining a recalculation result for the execution plan, Step S8 for determining whether there is a calculation plan, and if it is determined in step S8 that there is an uncalculated plan, step S9 for calculating the next plan in the same procedure, and no uncalculated plan. If it is determined that the calculation of all plans has been completed, step S10 is executed to return the execution plan with the lowest cost to the SQL query execution unit 21.

この様に本実施形態によるデータベース管理システムは、ステップのコストを計算し、コストを判定することによって、最小となる実行プランをSQLクエリ実行部21へ返す様に動作する。
<実行処理>
As described above, the database management system according to the present embodiment operates to return the minimum execution plan to the SQL query execution unit 21 by calculating the cost of the step and determining the cost.
<Execution process>

次に、本実施形態によるデータベース管理システムは、ユーザにより問合せとなるSQLクエリを実行するものであり、この処理を図7を参照して説明する。
本処理手順は、図7に示す如く、まず、SQLクエリ実行部21により問合せのSQLクエリが実行プラン格納ファイル28内のテーブル(図2)に登録されているかの判定を行うステップS11を実行する。
Next, the database management system according to the present embodiment executes an SQL query that is a query by the user, and this process will be described with reference to FIG.
As shown in FIG. 7, in this processing procedure, first, the SQL query execution unit 21 executes step S11 for determining whether the query SQL query is registered in the table (FIG. 2) in the execution plan storage file 28. .

次いで本システムは、前記ステップS11により問合せのSQLクエリを登録していると判定したとき、そのSQLクエリに関する情報(図2に示したSQLクエリID)をコスト再計算部24に引渡し、コスト再計算部24が図6に示した手順によりキャッシュ領域上のキャッシュ情報(図4)やコストに関するテーブル情報(図4)を利用してコストの再計算を行うステップS12と、この計算の結果、キャッシュのデータを考慮した最小コストの実行プランを得るステップS13とを実行する。   Next, when the system determines that the query SQL query is registered in step S11, the system delivers the information related to the SQL query (SQL query ID shown in FIG. 2) to the cost recalculation unit 24, and recalculates the cost. Step S12 in which the unit 24 recalculates the cost by using the cache information (FIG. 4) on the cache area and the table information about the cost (FIG. 4) according to the procedure shown in FIG. Step S13 for obtaining an execution plan with the minimum cost considering the data is executed.

他方、本システムは、前記ステップS11において問合せのSQLクエリが実行プラン格納ファイル28内のテーブル(図2)に登録されていないと判定したとき、SQLクエリ構文解析・正規化部22によりSQLクエリの構文解析・最適化処理を行い、SQL構文のチェックや、冗長な構文の削除を行うステップS14と、SQLクエリ最適化部23によりコスト計算を行い最適な実行プランを決定するステップS15と、この過程で検討された上位10個の実行プランとその検討途中ステップごとのコストに関する情報を実行プラン格納ファイル管理部25が実行プラン格納ファイル28に格納するステップS16と、前記ステップS17を実行する。   On the other hand, when it is determined in step S11 that the SQL query of the query is not registered in the table (FIG. 2) in the execution plan storage file 28, the SQL query parsing / normalizing unit 22 executes the SQL query. Step S14 in which syntax analysis / optimization processing is performed, SQL syntax is checked and redundant syntax is deleted, cost calculation is performed by the SQL query optimization unit 23, and an optimal execution plan is determined in step S15. Step S16 in which the execution plan storage file management unit 25 stores the information related to the top 10 execution plans examined in step 1 and the cost for each step in the middle of the examination in the execution plan storage file 28, and Step S17 are executed.

次いで本システムは、前記ステップS13又は16に続き、以上の手順で決定された実行プランに沿って、SQLクエリ実行部21はSQLクエリを実行するステップ17と、実行結果をユーザの表示部に表示するステップS18とを実行する。   Subsequently, following the step S13 or 16, the present system performs step 17 in which the SQL query execution unit 21 executes the SQL query according to the execution plan determined by the above procedure, and displays the execution result on the display unit of the user. Step S18 is executed.

この様に本実施形態によるデータベース管理システムは、実行プランファイルに一致するSQLクリエが既に登録されているか否かを判定し、既に登録されているとき、即ちSQLクリエがキヤッシュされているときには登録プランコスチの再計算を行ってから実行プランを決定し、登録されていないときには、構文解析他の処理を行うことによって、既にキャッシュされているSQLクリエ(構文解析−最適化−実行プラン生成の一連の処理済みのSQLクリエ)の有効的な利用を図ることができ、従って最適な実行プランを短時間で提供することができる。   As described above, the database management system according to the present embodiment determines whether or not the SQL query that matches the execution plan file has already been registered. When the SQL query has already been registered, that is, when the SQL query has been cached, the registered plan cost is determined. The execution plan is determined after recalculation, and when it is not registered, by performing parsing and other processes, a series of processes of SQL cache (syntax analysis-optimization-execution plan generation) already cached are performed. In other words, an effective execution plan can be provided in a short time.

本発明に係るデータベース管理システムの構成例を示す図。The figure which shows the structural example of the database management system which concerns on this invention. 実行プラン格納ファイルに格納される問合せのSQLテキストに関するテーブル情報の一例を示す図。The figure which shows an example of the table information regarding the SQL text of the inquiry stored in an execution plan storage file. 実行プラン格納ファイルに格納される、問合せの実行プランとそのコストに関するテーブル情報の一例を示す図。The figure which shows an example of the table information regarding the execution plan of a query and its cost stored in an execution plan storage file. DBMS制御部が管理するDBMSキャッシュ領域上のキャッシュ情報の一例を示す図。The figure which shows an example of the cache information on the DBMS cache area | region which a DBMS control part manages. 業務データベース内のテーブルやインデックスに関する管理情報の一例を示す図。The figure which shows an example of the management information regarding the table and index in a business database. コスト再計算部により行われるコスト再計算処理を示すフローチャート。The flowchart which shows the cost recalculation process performed by the cost recalculation part. ユーザからの問合せに対してデータベースシステム内で行われる処理を示すフローチャート。The flowchart which shows the process performed in a database system with respect to the inquiry from a user.

符号の説明Explanation of symbols

10:主記憶装置、11:キャッシュ領域、21:クエリ実行部、22:クエリ構文解析・正規化部、23:クエリ最適化部、24:コスト再計算部、25:実行プラン格納ファイル管理部、26:DBMS制御部、27:業務データベース、28:実行プラン格納ファイル、28:実行プラン格納ファイル、30:公衆回線、40:クラスアント。   10: Main storage device 11: Cache area 21: Query execution unit 22: Query syntax analysis / normalization unit 23: Query optimization unit 24: Cost recalculation unit 25: Execution plan storage file management unit 26: DBMS control unit, 27: business database, 28: execution plan storage file, 28: execution plan storage file, 30: public line, 40: clantant.

Claims (4)

データベース管理システム用のSQLクエリを一時的に格納するキャッシュ領域と、受け付けたSQLクエリを実行プランに従って実行するSQLクエリ実行部と、入力された問合せのSQLクエリに対して構文解析及び正規化を行うSQLクエリ構文解析・正規化部と、前記SQLクエリの最適化処理により実行プランを決定するSQLクエリ最適化部と、前記キャッシュ領域の管理並びに割り込み処理を行うDBMS制御部と、前記SQLクエリ最適化部により決定した実行プランとコストに関する情報とを格納する実行プラン格納ファイルと、実行プランのコスト計算を行うコスト計算部とを備えるデータベース管理システムであって、
前記DBMS制御部が、前記実行プラン格納ファイルに格納されたSQLクエリと同一のSQLクエリが格納されているか否かを判定し、該判定の結果、同一のSQLクエリが格納されている場合、割り込み処理によって前記SQLクリエの実行プランのコスト計算をコスト計算部により行い、前記SQL実行部が、前記計算の結果の最小コストとなった実行プランを選択して実行することを特徴とするデータベース管理システム。
A cache area for temporarily storing an SQL query for a database management system, an SQL query execution unit for executing an accepted SQL query according to an execution plan, and parsing and normalizing the SQL query of the input query SQL query parsing and normalization unit, SQL query optimization unit for determining an execution plan by the optimization processing of the SQL query, DBMS control unit for managing the cache area and interrupt processing, and the SQL query optimization A database management system comprising an execution plan storage file that stores an execution plan determined by a section and information on costs, and a cost calculation section that performs cost calculation of the execution plan,
The DBMS control unit determines whether or not the same SQL query as the SQL query stored in the execution plan storage file is stored. If the same SQL query is stored as a result of the determination, an interrupt is generated. A database management system, wherein a cost calculation unit performs cost calculation of the execution plan of the SQL query by processing, and the SQL execution unit selects and executes an execution plan that has a minimum cost as a result of the calculation .
前記DBMS制御部が、前記SQLクエリ最適化部により最適化した実行プランの内、相対的にコストの低い所定数の実行プランを、前記実行プラン格納ファイルに格納することを特徴とする請求項1記載のデータベース管理システム。   2. The DBMS control unit stores, in the execution plan storage file, a predetermined number of execution plans having relatively low costs among the execution plans optimized by the SQL query optimization unit. The database management system described. データベース管理システム用のSQLクエリを一時的に格納するキャッシュ領域と、受け付けたSQLクエリを実行プランに従って実行するSQLクエリ実行部と、入力された問合せのSQLクエリに対して構文解析及び正規化を行うSQLクエリ構文解析・正規化部と、前記SQLクエリの最適化処理により実行プランを決定するSQLクエリ最適化部と、前記キャッシュ領域の管理並びに割り込み処理を行うDBMS制御部と、前記SQLクエリ最適化部により決定した実行プランとコストに関する情報とを格納する実行プラン格納ファイルと、実行プランのコスト計算を行うコスト計算部とを備えるデータベース管理システムのデータベース管理方法であって、
前記DBMS制御部が、前記実行プラン格納ファイルに格納されたSQLクエリと同一のSQLクエリが格納されているか否かを判定するステップと、該判定の結果、同一のSQLクエリが格納されている場合、割り込み処理によって前記SQLクリエの実行プランのコスト計算をコスト計算部により行うステップと、前記SQL実行部が、前記計算の結果の最小コストとなった実行プランを選択して実行するステップとを実行することを特徴とするデータベース管理方法。
A cache area for temporarily storing an SQL query for a database management system, an SQL query execution unit for executing an accepted SQL query according to an execution plan, and parsing and normalizing the SQL query of the input query SQL query parsing and normalization unit, SQL query optimization unit for determining an execution plan by the optimization processing of the SQL query, DBMS control unit for managing the cache area and interrupt processing, and the SQL query optimization A database management method of a database management system comprising an execution plan storage file that stores an execution plan determined by a unit and information about costs, and a cost calculation unit that performs cost calculation of the execution plan,
When the DBMS control unit determines whether or not the same SQL query as the SQL query stored in the execution plan storage file is stored, and as a result of the determination, the same SQL query is stored Performing a cost calculation of the execution plan of the SQL query by the interrupt processing by the cost calculation unit, and a step of the SQL execution unit selecting and executing the execution plan having the minimum cost as a result of the calculation A database management method characterized by:
前記DBMS制御部が、前記SQLクエリ最適化部により最適化した実行プランの内、相対的にコストの低い所定数の実行プランを、前記実行プラン格納ファイルに格納することを特徴とする請求項3記載のデータベース管理方法。   4. The DBMS control unit stores, in the execution plan storage file, a predetermined number of execution plans having relatively low costs among the execution plans optimized by the SQL query optimization unit. The database management method described.
JP2006122621A 2006-04-26 2006-04-26 Database managing system and managing method Withdrawn JP2007293723A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006122621A JP2007293723A (en) 2006-04-26 2006-04-26 Database managing system and managing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006122621A JP2007293723A (en) 2006-04-26 2006-04-26 Database managing system and managing method

Publications (1)

Publication Number Publication Date
JP2007293723A true JP2007293723A (en) 2007-11-08

Family

ID=38764281

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006122621A Withdrawn JP2007293723A (en) 2006-04-26 2006-04-26 Database managing system and managing method

Country Status (1)

Country Link
JP (1) JP2007293723A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100906454B1 (en) * 2009-03-18 2009-07-08 주식회사 신시웨이 Database log data management apparatus and method thereof
JP2012128522A (en) * 2010-12-13 2012-07-05 Canon Inc Data retrieval device, method, and program
JP2014102641A (en) * 2012-11-19 2014-06-05 Bank Of Tokyo-Mitsubishi Ufj Ltd Database management device
KR101512647B1 (en) * 2013-10-18 2015-04-16 에스케이 텔레콤주식회사 Method For Choosing Query Processing Engine
KR20150113796A (en) * 2014-03-31 2015-10-08 삼성전자주식회사 Computing System, Driving Method of Computing System, and Computer-readable Recording Medium
JP2018509666A (en) * 2016-02-19 2018-04-05 華為技術有限公司Huawei Technologies Co.,Ltd. Method and apparatus for determining a SQL execution plan

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100906454B1 (en) * 2009-03-18 2009-07-08 주식회사 신시웨이 Database log data management apparatus and method thereof
JP2012128522A (en) * 2010-12-13 2012-07-05 Canon Inc Data retrieval device, method, and program
JP2014102641A (en) * 2012-11-19 2014-06-05 Bank Of Tokyo-Mitsubishi Ufj Ltd Database management device
KR101512647B1 (en) * 2013-10-18 2015-04-16 에스케이 텔레콤주식회사 Method For Choosing Query Processing Engine
KR20150113796A (en) * 2014-03-31 2015-10-08 삼성전자주식회사 Computing System, Driving Method of Computing System, and Computer-readable Recording Medium
KR102249839B1 (en) 2014-03-31 2021-05-10 삼성전자주식회사 Computing System, Driving Method of Computing System, and Computer-readable Recording Medium
JP2018509666A (en) * 2016-02-19 2018-04-05 華為技術有限公司Huawei Technologies Co.,Ltd. Method and apparatus for determining a SQL execution plan
US10901976B2 (en) 2016-02-19 2021-01-26 Huawei Technologies Co., Ltd. Method and apparatus for determining SQL execution plan

Similar Documents

Publication Publication Date Title
US20180060420A1 (en) Method and apparatus for natural language query in a workspace analytics system
CN111670433A (en) Query optimizer constraints
WO2017183065A1 (en) Device and method for tuning relational database
JP6070936B2 (en) Information processing apparatus, information processing method, and program
JP2007293723A (en) Database managing system and managing method
JP6198845B2 (en) Active database query maintenance
US20210240710A1 (en) Query plan overrides
CN108475266A (en) For removing the matching reparation of matching document
US20080005077A1 (en) Encoded version columns optimized for current version access
KR20160117691A (en) Storage system and method for operating thereof
US20080288307A1 (en) Project management support device and method thereof
CN106503027B (en) Database operation method and device
US10140337B2 (en) Fuzzy join key
JP5355497B2 (en) Product management device, product management method, and product management program
JP5790820B2 (en) Inconsistency detection apparatus, program and method, correction support apparatus, program and method
CN101405727A (en) Management of statistical views in a database system
JP2008077285A (en) Sql management system and sql management method and program
JP4091586B2 (en) Structured document management system, index construction method and program
JP2012027525A (en) File storage auxiliary system, method and program
JP2017010376A (en) Mart-less verification support system and mart-less verification support method
JP2010122716A (en) Modification area division program, modification area division apparatus and modification area division method
WO2013147172A1 (en) Cfd updating device and method, data cleansing apparatus and method, and programs
JP5359446B2 (en) Information processing system, access path determination method, and access path determination program
WO2017179163A1 (en) Application analysis system, method, and program
JP2011113298A (en) Shared source code analysis system, program, and recording medium

Legal Events

Date Code Title Description
RD05 Notification of revocation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7425

Effective date: 20081208

A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20090707