JP7242343B2 - Analysis device and analysis method - Google Patents
Analysis device and analysis method Download PDFInfo
- Publication number
- JP7242343B2 JP7242343B2 JP2019031561A JP2019031561A JP7242343B2 JP 7242343 B2 JP7242343 B2 JP 7242343B2 JP 2019031561 A JP2019031561 A JP 2019031561A JP 2019031561 A JP2019031561 A JP 2019031561A JP 7242343 B2 JP7242343 B2 JP 7242343B2
- Authority
- JP
- Japan
- Prior art keywords
- execution plan
- tables
- database system
- node
- binary
- 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.)
- Active
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
本発明は、データベースに格納されている複数のテーブルの関連性を分析する分析装置及び分析方法に関する。 The present invention relates to an analysis apparatus and analysis method for analyzing relationships between multiple tables stored in a database.
従来、データベースを効率的に利用するために、関連性が高い2つのテーブルを1つにまとめたり、関連性が高い2つのテーブルの結合結果を優先的にメモリ上にキャッシュしたりすることが行われている。 Conventionally, in order to use databases efficiently, it has been common practice to combine two highly related tables into one or to preferentially cache the results of joining two highly related tables in memory. It is
関連性が高いテーブルを特定するにあたり、例えば、特許文献1には、データベースシステムにおいて実行されたクエリに含まれるテキストを分析してテーブルの結合条件を特定することにより、複数のテーブルの関連性を分析する分析方法が開示されている。
To identify highly related tables, for example,
ところで、データベースシステムでは、3つ以上のテーブルを結合する場合、テーブルのサイズや2つのテーブルを結合する二項演算のコストに基づいてテーブルの結合順序を決定し、当該結合順序に基づいて2つのテーブルの結合を繰り返すことにより、3つ以上のテーブルを結合する。 By the way, in a database system, when joining three or more tables, the table joining order is determined based on the size of the tables and the cost of the binary operation for joining two tables, and two tables are joined based on the joining order. Join three or more tables by repeating the joining of the tables.
これに対し、特許文献1に開示されている分析方法は、クエリに含まれるテキストにおいて規定されているカラム同士の関係に基づいてテーブル同士の関連度を算出するので、1:1のテーブル同士の関連性しか特定できない。したがって、クエリに含まれるテキストに基づいて特定したテーブル同士の関連度が、データベースシステムが決定した結合順序に基づくテーブル同士の関連度と必ずしも一致しないという問題がある。そこで、関連性が高いテーブルを精度良く特定することが求められている。
On the other hand, the analysis method disclosed in
そこで、本発明はこれらの点に鑑みてなされたものであり、関連性が高いテーブルを精度良く特定することができる分析装置及び分析方法を提供することを目的とする。 Therefore, the present invention has been made in view of these points, and it is an object of the present invention to provide an analysis apparatus and an analysis method that can accurately identify highly relevant tables.
本発明の第1の態様に係る分析装置は、データベースシステムにおいて実行されたクエリに対して前記データベースシステムが前記クエリに対応する演算を行うために生成した実行計画を取得する実行計画取得部と、前記実行計画取得部が取得した前記実行計画に基づいて、前記実行計画に対応して前記データベースシステムにおいて行われるテーブルを結合する演算を示す二項演算を特定し、当該二項演算に関連する演算関連情報として、当該二項演算により結合される一以上のテーブルを含む第1のテーブル群と、一以上のテーブルを含む第2のテーブル群とを特定する解析部と、前記解析部が特定した前記演算関連情報を出力する出力部と、を備える。 An analysis apparatus according to a first aspect of the present invention includes an execution plan acquisition unit that acquires an execution plan generated for a query executed in a database system by the database system to perform an operation corresponding to the query; Based on the execution plan acquired by the execution plan acquisition unit, a binary operation indicating an operation for joining tables performed in the database system in correspondence with the execution plan is specified, and an operation related to the binary operation. As related information, an analysis unit that identifies a first table group including one or more tables that are combined by the binary operation, and a second table group that includes one or more tables, and and an output unit that outputs the calculation-related information.
前記実行計画は、前記データベースシステムにおいて行われる演算の処理順を規定する木構造のデータ構造を有しており、前記解析部は、前記実行計画取得部が取得した前記実行計画において規定されているデータ構造を解析することにより前記二項演算を特定してもよい。 The execution plan has a tree-structured data structure that defines the processing order of operations performed in the database system, and the analysis unit is defined in the execution plan acquired by the execution plan acquisition unit. The binary operation may be identified by parsing the data structure.
前記解析部は、前記演算関連情報として、前記データベースシステムにおいて前記第1のテーブル群と、前記第2のテーブル群を結合する場合の処理負荷に関連する情報を特定してもよい。 The analysis unit may specify, as the operation-related information, information related to a processing load when combining the first table group and the second table group in the database system.
前記実行計画取得部は、複数の前記クエリのそれぞれに対応する複数の前記実行計画を取得し、前記解析部は、前記演算関連情報として、前記実行計画取得部が取得した複数の前記実行計画のそれぞれにおいて行われる前記二項演算を特定し、結合するテーブル群が同一の前記二項演算の統計情報として、前記処理負荷の統計値を示す情報を生成する統計情報生成部をさらに備え、前記出力部は、前記統計情報生成部が生成した前記統計情報を出力してもよい。 The execution plan acquisition unit acquires the plurality of execution plans corresponding to each of the plurality of queries, and the analysis unit acquires the plurality of execution plans acquired by the execution plan acquisition unit as the operation-related information. further comprising a statistical information generating unit that identifies the binary operations performed in each and generates information indicating the statistical value of the processing load as statistical information of the binary operations in which the combined table group is the same; The unit may output the statistical information generated by the statistical information generation unit.
前記実行計画取得部は、複数の前記クエリのそれぞれに対応する複数の前記実行計画を取得し、前記解析部は、前記演算関連情報として、前記実行計画取得部が取得した複数の前記実行計画のそれぞれにおいて行われる前記二項演算を特定し、結合するテーブル群が同一の前記二項演算の統計情報として、前記データベースシステムにおいて前記二項演算が行われた回数を示す情報を生成する統計情報生成部をさらに備え、前記出力部は、前記統計情報生成部が生成した前記統計情報を出力してもよい。 The execution plan acquisition unit acquires the plurality of execution plans corresponding to each of the plurality of queries, and the analysis unit acquires the plurality of execution plans acquired by the execution plan acquisition unit as the operation-related information. Statistical information generation for specifying the binary operations performed in each and generating information indicating the number of times the binary operations are performed in the database system as statistical information of the binary operations in which the table group to be linked is the same. A unit may be further provided, and the output unit may output the statistical information generated by the statistical information generation unit.
本発明の第2の態様に係る分析方法は、コンピュータが実行する、データベースシステムにおいて実行されたクエリに対して前記データベースシステムが前記クエリに対応する演算を行うために生成した実行計画を取得するステップと、取得された前記実行計画に基づいて、前記実行計画に対応して前記データベースシステムにおいて行われるテーブルを結合する演算を示す二項演算を特定するステップと、特定された前記二項演算に関連する演算関連情報として、当該二項演算により結合される一以上のテーブルを含む第1のテーブル群と、一以上のテーブルを含む第2のテーブル群とを特定するステップと、特定された前記演算関連情報を出力するステップと、を備える。 An analysis method according to a second aspect of the present invention is a computer-executed step of acquiring, for a query executed in a database system, an execution plan generated by the database system for performing an operation corresponding to the query. and identifying, based on the obtained execution plan, a binary operation indicating an operation that joins tables to be performed in the database system corresponding to the execution plan; and associated with the identified binary operation. identifying a first table group including one or more tables to be combined by the binary operation and a second table group including one or more tables as operation-related information to be performed; and and outputting relevant information.
本発明によれば、関連性が高いテーブルを精度良く特定することができるという効果を奏する。 ADVANTAGE OF THE INVENTION According to this invention, it is effective in being able to specify a table with high relevance accurately.
[分析装置10の概要]
図1は、本実施形態に係る分析装置10の概要を説明する図である。分析装置10は、データベースに格納されている複数のテーブルの関連性について分析するコンピュータである。
[Overview of analyzer 10]
FIG. 1 is a diagram illustrating an overview of an
分析装置10は、データベースシステム1にLAN(Local Area Network)やインターネット等により通信可能に接続されている。分析装置10は、データベースシステム1において実行されたクエリに対してデータベースシステム1が生成した実行計画を取得する。クエリは、SQL等のテキスト文である。実行計画は、データベースシステム1がクエリに対応する複数の演算を行うために生成する情報であり、当該複数の演算の処理順を規定する木構造のデータ構造を有している。クエリ及び実行計画は、例えばクエリログに含まれている。クエリログは、データベースシステム1が実行したクエリに関する情報である。クエリログは、例えば、実行計画、クエリ、クエリを特定するID、実行時刻、処理時間、クエリを実行したユーザを識別するユーザ識別情報を含んでいる。
The
分析装置10は、取得した実行計画に基づいて、実行計画に対応してデータベースシステム1が行う演算の中から二項演算を特定する。二項演算は、テーブルを結合する演算である。分析装置10は、特定した二項演算により結合される一以上のテーブルを含む第1のテーブル群と、一以上のテーブルを含む第2のテーブル群とを、二項演算に関連する演算関連情報として特定し、当該演算関連情報を出力する。
Based on the acquired execution plan, the
実行計画は、複数の演算の処理順を規定するデータ構造を有しているところ、分析装置10は、二項演算の処理順に基づいて、二項演算により結合される第1のテーブル群と、第2のテーブル群とを特定することができる。これにより、分析装置10は、3つ以上のテーブルを結合する場合であっても関連性が高いテーブルを精度良く特定することができる。
The execution plan has a data structure that defines the processing order of a plurality of operations. Based on the processing order of the binary operations, the
[分析装置10の構成]
続いて、分析装置10の構成を説明する。図2は、本実施形態に係る分析装置10の構成を示す図である。図2に示すように、分析装置10は、通信部11と、操作部12と、表示部13と、記憶部14と、制御部15とを備える。
[Configuration of analyzer 10]
Next, the configuration of the
通信部11は、データベースシステム1とデータを送受信するための通信インターフェースである。操作部12は、例えば、キーボードやマウス等により構成されており、分析装置10のユーザから操作入力を受け付ける。表示部13は、例えば、液晶ディスプレイ又は有機EL(Electro-Luminescence)ディスプレイ等により構成される。表示部13は、制御部15の制御に応じて各種情報を表示する。
The
記憶部14は、ROM(Read Only Memory)及びRAM(Random Access Memory)等を含む記憶媒体である。記憶部14は、制御部15が実行するプログラムを記憶している。例えば、記憶部14は、制御部15を、実行計画取得部151、解析部152、統計情報生成部153、及び出力部154として機能させる分析プログラムを記憶している。
The
制御部15は、例えばCPU(Central Processing Unit)である。制御部15は、記憶部14に記憶された分析プログラムを実行することにより、実行計画取得部151、解析部152、統計情報生成部153、及び出力部154として機能する。
The
図3は、本実施形態に係る制御部15における処理の流れを示すフローチャートを示す図である。以下、図3に示すフローチャートを参照しながら、実行計画取得部151、解析部152、統計情報生成部153、及び出力部154の機能を説明する。
FIG. 3 is a diagram showing a flowchart showing the flow of processing in the
実行計画取得部151は、データベースシステム1において実行されたクエリに対して、データベースシステム1が当該クエリに対応する演算を行うために生成した実行計画を取得する(S10)。実行計画取得部151は、データベースシステム1において実行された複数のクエリのそれぞれに対応する複数の実行計画を取得する。
The execution
例えば、実行計画取得部151は、操作部12が、分析装置10のユーザから実行計画を取得する操作を受け付けると、データベースシステム1にアクセスし、現在時刻から所定期間前までに実行されたクエリを含むクエリログを特定する。そして、実行計画取得部151は、特定したクエリログに含まれている実行計画を取得する。実行計画取得部151は、ユーザから、クエリが実行された期間を受け付け、当該期間内に実行されたクエリに対応する実行計画を取得してもよい。
For example, when the
図4及び図5は、本実施形態に係るデータベースシステム1において実行されたクエリの一例を示す図である。図6は、図4に示すクエリに対応してデータベースシステム1が生成した実行計画を示す図である。図7は、図5に示すクエリに対応してデータベースシステム1が生成した実行計画を示す図である。本実施形態では、実行計画取得部151が、図6及び図7に示す実行計画を取得するものとする。
4 and 5 are diagrams showing examples of queries executed in the
実行計画は、データベースシステム1において実行されるクエリに対応する演算の処理順を規定しており、木構造のデータ構造を有している。図8は、図6に示す実行計画に対応するデータ構造を示す図であり、図9は、図7に示す実行計画に対応するデータ構造を示す図である。図8及び図9に示すように、実行計画は、二分木構造を有している。また、図8及び図9に示すように、二分木は、処理の内容を示すノードと、他のノードからのデータの入力を示すエッジとを有している。図8に示す二分木は、ノードN1~N7を有しており、図9に示す二分木は、ノードN11~N23を有している。データベースシステム1は、図8及び図9に示す二分木における最下層のノードから順番に演算を行う。
The execution plan defines the processing order of operations corresponding to queries executed in the
また、実行計画には、各演算に対して推定又は実際に算出された処理コストと、データの行数とを示す情報が含まれている。このため、図8及び図9に示す二分木では、各ノードの右側に、ノードに対応する処理を行う場合の処理コスト(Cost)と、ノードに対応する処理を行うことにより出力されるデータの行数(Rows)とを示している。なお、データベースシステム1の種類によっては、実行計画に、各演算に対して推定又は実際に算出された処理コストと、データの行数とを示す情報が含まれていない場合もある。この場合、分析装置10が、データベースシステム1に格納されているテーブルのメタ情報を参照して、これらの処理コストやデータの行数を推定してもよい。
The execution plan also includes information indicating the estimated or actually calculated processing cost and the number of rows of data for each operation. For this reason, in the binary trees shown in FIGS. 8 and 9, on the right side of each node are the processing cost (Cost) when performing the processing corresponding to the node, and the data output by performing the processing corresponding to the node. and the number of rows (Rows). Depending on the type of
続いて、解析部152は、実行計画取得部151が取得した実行計画のうち、1つの実行計画を選択する(S20)。本実施形態では、まず、図6に示す実行計画が選択されたものとして説明を進める。
Subsequently, the
続いて、解析部152は、S20において選択された実行計画について、実行計画を解析する処理である実行計画解析処理を実行する(S30)。解析部152は、選択された実行計画に対する実行計画解析処理の実行を繰り返すことにより、実行計画取得部151が取得した複数の実行計画のそれぞれに対応してデータベースシステム1において行われる二項演算を特定する。解析部152は、実行計画において規定されている木構造のデータ構造を解析することにより二項演算を特定する。解析部152は、特定した二項演算に関連する演算関連情報として、当該二項演算により結合される第1のテーブル群と、第2のテーブル群とを特定する。ここで、テーブル群は、一以上のテーブルを含むものとする。なお、1つのテーブルのみ含む場合もテーブル群と呼ぶものとする。
Subsequently, the
図10は、本実施形態に係る実行計画解析処理における処理の流れを示すフローチャートである。図10を参照しながら、実行計画解析処理の詳細について説明する。
まず、解析部152は、実行計画のルートに対応するノードから順にノードを選択する(S31)。例えば、図8に示す二分木において、ノードN1がルートノードであることから、解析部152は、まずノードN1を選択する。
FIG. 10 is a flow chart showing the flow of processing in execution plan analysis processing according to this embodiment. Details of the execution plan analysis process will be described with reference to FIG.
First, the
続いて、解析部152は、選択したノードにおいて、テーブルを結合する演算を示す二項演算が行われているか否かを判定する(S32)。ここで、二項演算は、例えば、結合演算及び集合演算を指す。結合演算は、例えば、自然結合(Natural join)、内部結合(Inner join)、外部結合(Left/Right/Full outer join)、直積(Cross join)、部分結合(Semi-join)を含む。集合演算は、和集合(Union及びUnion all)、差集合(Difference)、積集合(Intersect)、商集合(Division)を含む。
Subsequently, the
解析部152は、選択したノードにおいて二項演算が行われていると判定すると、S33に処理を移し、二項演算が行われていないと判定すると、S31に処理を移す。図8に示す例では、ノードN1、N2が二項演算ではないことから、解析部152は、S31及びS32を繰り返し、その後、ノードN3が二項演算であることを特定する。
If the
解析部152は、S32において二項演算が行われていると判定すると、当該二項演算に対応する演算関連情報を特定する(S33)。演算関連情報は、特定した二項演算に対応して結合される2つのテーブル群、及び、当該2つのテーブル群を結合する場合の処理負荷に関連する情報である。
When the
具体的には、解析部152は、二項演算に対応するノードを含み、当該ノードの下位の二分木であるサブツリーを走査することにより、結合するテーブル群としての2つのテーブル群を演算関連情報として特定する。図8に示す例では、解析部152は、ノードN3において二項演算が行われていると判定した後、ノードN3のサブツリーであるノードN3~N7を走査することにより、第1のテーブル群をlineitemテーブルと特定し、第2のテーブル群をordersテーブル及びcustomerテーブルと特定する。
Specifically, the
また、解析部152は、演算関連情報に含まれる処理負荷に関連する情報として、二項演算に対応するノードの出力結果と、当該ノードの直下の2つのノードの出力結果とを特定する。図11は、図6に示す実行計画に対応する演算関連情報を示す図である。図11に示すように、二項演算に対応する演算関連情報として、第1テーブル群、第1テーブル群に対応する入力データ数、第2テーブル群、第2テーブル群に対応する入力データ数、結合タイプ、結合条件、出力データ数が特定されていることが確認できる。図8に示す例では、解析部152は、ノードN3の二項演算に対して、一行目に示される演算関連情報を特定する。なお、解析部152は、演算関連情報として、二項演算が行われるノードに対応する処理コストを特定してもよい。
Further, the
続いて、統計情報生成部153は、演算関連情報の統計値を含む統計情報を更新する(S34)。具体的には、統計情報生成部153は、結合するテーブル群が同一の二項演算の統計情報として、処理負荷の統計値を示す情報と、データベースシステム1において二項演算が行われた回数を示す情報とを生成する。統計情報は、記憶部14に記憶されており、統計情報生成部153は、当該統計情報を更新することにより、処理負荷の統計値を示す情報と、データベースシステム1において二項演算が行われた回数を示す情報とを生成する。図12は、図6に示す実行計画に対応する演算関連情報の一部と統計情報とを示す図である。ここで、図12に示す演算関連情報の一部は、第1テーブル群及び第2テーブル群を示す情報である。
Subsequently, the statistical
図12に示される実行回数は、二項演算が行われた回数を示す。また、図12に示されるデータ数の合計値は、第1テーブル群に対応する入力データ数と、第2テーブル群に対応する入力データ数と、出力データ数との合計値を示す。図8に示す例では、統計情報生成部153は、ノードN3の二項演算に対して、一行目に示される統計情報を生成する。
The number of executions shown in FIG. 12 indicates the number of times the binary operation was performed. Also, the total number of data shown in FIG. 12 indicates the total number of input data corresponding to the first table group, input data corresponding to the second table group, and output data. In the example shown in FIG. 8, the statistical
S34の処理が終了すると、解析部152は、全ノードを選択したか否かを判定する(S35)。解析部152は、全ノードを選択したと判定すると、本フローチャートに係る処理を終了し、全ノードを選択していないと判定すると、S31に処理を移す。図8に示す例では、解析部152は、ノードN3において二項演算が行われていることを特定した後、ノードN5において二項演算が行われていることを特定する。その後、ノードN5の二項演算に対して、解析部152が、図11の二行目に示される演算関連情報を特定し、統計情報生成部153が、図12の二行目に示される統計情報が生成する。
After the processing of S34 is completed, the
図3に説明を戻す。解析部152は、S10において取得された全ての実行計画が選択されたか否かを判定する(S40)。解析部152は、全ての実行計画が選択されたと判定すると、S50に処理を移し、全ての実行計画が選択されていないと判定すると、S20に処理を移す。
Returning to FIG. The
図6に示す実行計画に対して実行計画解析処理が実行された後、解析部152は、図7に示す実行計画を選択していないことから、S20に処理を移し、図7に示す実行計画を選択する。そして、解析部152は、図7に示す実行計画に対して実行計画解析処理を実行する。これにより、解析部152が図7に示す実行計画に対応する演算関連情報を特定し、統計情報生成部153が、当該演算関連情報に基づいて統計情報を更新する。
After executing the execution plan analysis process for the execution plan shown in FIG. 6, the
図13は、図7に示す実行計画に対応する演算関連情報を示す図であり、図14は、図12に示す統計情報に対して、図7に示す実行計画に対応する統計情報が反映された例を示す図である。 13 is a diagram showing operation-related information corresponding to the execution plan shown in FIG. 7, and FIG. 14 shows the statistical information corresponding to the execution plan shown in FIG. 7 reflected in the statistical information shown in FIG. and FIG. 11 is a diagram showing an example.
図7に示す実行計画に対応する二分木が示されている図9を参照すると、ノードN13、N14、N15、N17、N20において二項演算が行われている。これに対応して、図13に示すように、テーブルの結合が5回行われたことが確認できる。また、図14に示すように、図7に示す実行計画が解析された結果、第1テーブル群がlineitemテーブル、第2テーブル群がordersテーブル及びcustomerテーブルであるテーブルの結合が2回行われているとともに、第1テーブル群がordersテーブル、第2テーブル群がcustomerテーブルであるテーブルの結合が2回行われていることが確認できる。これらのテーブルの結合では、データ数の合計値も大きいことから、これらのテーブル群の関連性が高いことが確認できる。 Referring to FIG. 9, which shows the binary tree corresponding to the execution plan shown in FIG. 7, binary operations are performed at nodes N13, N14, N15, N17, N20. Correspondingly, as shown in FIG. 13, it can be confirmed that the tables are joined five times. Also, as shown in FIG. 14, as a result of analyzing the execution plan shown in FIG. 7, the first table group is the lineitem table, and the second table group is the orders table and the customer table. In addition, it can be confirmed that the first table group is the orders table and the second table group is the customer table, and that the tables are joined twice. In the join of these tables, the total value of the number of data is also large, so it can be confirmed that these table groups are highly related.
図3に説明を戻す。出力部154は、S40において全ての実行計画が選択されたと判定されると、解析部152が特定した演算関連情報と、統計情報生成部153が生成した統計情報とを出力する(S50)。例えば、出力部154は、図14に示す演算関連情報の一部(第1テーブル群及び第2テーブル群)と、統計情報(実行回数及びデータ数の合計値)とを示す情報を表示部13に出力する。ユーザは、図14に示す情報を確認することにより、関連性の高いテーブル群を特定し、テーブルの配置等を検討することができる。
Returning to FIG. When it is determined in S40 that all execution plans have been selected, the
[テーブルの配置例]
図14に示す結果を利用する例を以下に示す。図15は、2つのデータベースシステムを仮想統合した仮想統合環境を示す図である。図15に示すように、仮想統合環境は、2つのデータベースシステム1A及び1Bと、データ仮想化システム2とを備える。データ仮想化システム2は、2つのデータベースシステム1A及び1Bと、LANやインターネット等の通信ネットワークで接続されている。
[Table arrangement example]
An example utilizing the results shown in FIG. 14 is provided below. FIG. 15 is a diagram showing a virtual integration environment in which two database systems are virtually integrated. As shown in FIG. 15, the virtual integration environment includes two
データ仮想化システム2は、クエリの入力インターフェースを備え、2つのデータベースシステム1A及び1Bのスキーマのみを統合している。データ仮想化システム2は、クエリの入力を受け付けたことに応じて、当該クエリに対応する物理データを2つのデータベースシステム1A及び1Bから取得する。仮想統合環境では、結合対象の2つのテーブル群が1つのデータベースシステムに含まれている場合は、当該データベースシステム内でテーブル群の結合処理が完結する。一方、結合対象のテーブル群が異なるデータベースシステムに格納されている場合、データ仮想化システム2が、通信ネットワークを介して当該テーブル群に対応するデータを取得する必要がある。
The
このため、結合される頻度の高いテーブル群は、同じデータベースシステムに配置することが好ましい。図16は、仮想統合環境において使用されるテーブルと、当該テーブルの容量とを示す図である。図16に示すテーブルは、図14等に示すテーブルに対応している。また、2つのデータベースシステム1A及び1Bの容量制限が3,000GBであるものとする。
For this reason, it is preferable to place tables that are frequently combined in the same database system. FIG. 16 is a diagram showing tables used in the virtual integration environment and the capacities of the tables. The table shown in FIG. 16 corresponds to the table shown in FIG. 14 and the like. It is also assumed that the capacity limit of the two
図14に示す結果では、第1のテーブル群であるlineitemテーブルと、第2のテーブル群であるordersテーブル及びcustomerテーブルとが結合される頻度が高い。このため、これらのテーブルをデータベースシステム1Aに配置する。この時点で、データベースシステム1Aに配置されているテーブルの合計容量は3,000GBに達するので、他のテーブルをデータベースシステム1Bに配置する。このようにすることで、仮想統合環境において、テーブルの配置が最適化され、性能を向上させることができる。
In the results shown in FIG. 14, the lineitem table, which is the first table group, and the orders table and the customer table, which are the second table group, are frequently joined. Therefore, these tables are arranged in the
[本実施形態における効果]
以上説明したように、本実施形態に係る分析装置10は、データベースシステム1がクエリに対応する演算を行うために生成した実行計画に基づいて二項演算を特定する。そして、分析装置10は、特定した二項演算に関連する演算関連情報として、当該二項演算により結合される第1のテーブル群と、第2のテーブル群とを特定し、特定した演算関連情報を出力する。このようにすることで、分析装置10は、3つ以上のテーブルを結合する場合であっても関連性が高いテーブルを精度良く特定することができる。
[Effects of this embodiment]
As described above, the
また、分析装置10は、二項演算に関連するすべてのテーブルをテーブル群として関連付けることにより、クエリにおいて規定されているものの、実際にはデータベースシステム1において実行されない1:1の結合演算に係るテーブルの関係を排除することができる。これにより、ユーザは、分析装置10の出力結果に基づいて、データベースシステム1における利用実態や処理状態を正確に把握することができる。
In addition, the
また、ユーザは、分析装置10の出力結果に基づいて、頻繁に結合されるテーブル群を検出することができる。これにより、ユーザは、図14に示すような、複数のデータベースシステムを連結した環境において、頻繁に結合されるテーブル群を同じデータベースシステムに配置して、これらのテーブル群の結合を1つのデータベースシステムで完結させることで、マルチデータベースシステム環境の性能を向上させることができる。
In addition, the user can detect frequently combined table groups based on the output result of the
以上、本発明を実施の形態を用いて説明したが、本発明の技術的範囲は上記実施の形態に記載の範囲には限定されず、その要旨の範囲内で種々の変形及び変更が可能である。例えば、上述の実施形態では、分析装置10は、操作部12及び表示部13を備えることとしたが、これに限らない。分析装置10は、操作部12及び表示部13を備えなくてもよい。この場合において、実行計画取得部151は、ユーザから、クエリが実行された期間を受け付けず、指定した時刻に定期的にクエリに対応する実行計画を取得してもよい。また、実行計画取得部151は、データベースシステム1に蓄積されているクエリログの数が増加していることを検出した場合に実行計画を取得してもよい。このようにすることで、分析装置10は、自動的に実行計画を取得することができるので、当該実行計画に基づいて自動的に二項演算を特定することができる。
Although the present invention has been described above using the embodiments, the technical scope of the present invention is not limited to the scope described in the above embodiments, and various modifications and changes are possible within the scope of the gist thereof. be. For example, in the above-described embodiment, the
また、装置の全部又は一部は、任意の単位で機能的又は物理的に分散・統合して構成することができる。また、複数の実施の形態の任意の組み合わせによって生じる新たな実施の形態も、本発明の実施の形態に含まれる。組み合わせによって生じる新たな実施の形態の効果は、もとの実施の形態の効果を併せ持つ。 Also, all or part of the device can be functionally or physically distributed and integrated in arbitrary units. In addition, new embodiments resulting from arbitrary combinations of multiple embodiments are also included in the embodiments of the present invention. The effect of the new embodiment caused by the combination has the effect of the original embodiment.
1・・・データベースシステム、2・・・データ仮想化システム、10・・・分析装置、11・・・通信部、12・・・操作部、13・・・表示部、14・・・記憶部、15・・・制御部、151・・・実行計画取得部、152・・解析部、153・・・統計情報生成部、154・・・出力部
DESCRIPTION OF
Claims (6)
データベースシステムにおいて実行されたクエリに対して前記データベースシステムが前記クエリに対応する演算を行うために生成した、処理の内容を示すノードと、当該ノードに対する他のノードからのデータの入力を示すエッジとから構成される二分木のデータ構造を有する実行計画を取得する実行計画取得部と、
前記実行計画取得部が取得した前記実行計画に含まれるノードに基づいて、前記実行計画に対応して前記データベースシステムにおいて行われるテーブルを結合する演算を示す二項演算に対応するノードを特定し、前記実行計画が示す二分木に含まれる、特定したノードにデータを入力するエッジを介して当該ノードに接続される下位の二分木であるサブツリーに含まれる複数のノードである下位の複数のノードを走査することにより、特定したノードに対応する二項演算により結合される一以上のテーブルを含む第1のテーブル群と、一以上のテーブルを含む第2のテーブル群とを特定し、特定した前記第1のテーブル群と、前記第2のテーブル群とを含み、前記分析装置のユーザが確認する演算関連情報を生成する解析部と、
前記解析部が生成した前記演算関連情報を出力する出力部と、
を備える分析装置。 An analysis device for analyzing relationships between multiple tables stored in a database system,
A node indicating the content of processing generated for a query executed in the database system so that the database system performs an operation corresponding to the query, and an edge indicating the input of data from another node to the node an execution plan acquisition unit that acquires an execution plan having a binary tree data structure consisting of
Based on the nodes included in the execution plan acquired by the execution plan acquisition unit, identify a node corresponding to a binary operation indicating an operation for joining tables performed in the database system in correspondence with the execution plan, A plurality of lower nodes that are included in a subtree that is a lower binary tree that is connected to a specified node via an edge that inputs data to the specified node included in the binary tree indicated by the execution plan . By scanning, a first table group including one or more tables connected by a binary operation corresponding to the specified node and a second table group including one or more tables are specified, and the specified an analysis unit that includes a first group of tables and the second group of tables and generates calculation-related information to be confirmed by a user of the analysis device ;
an output unit that outputs the calculation-related information generated by the analysis unit;
Analyzer with
請求項1に記載の分析装置。 The analysis unit identifies the binary operation by analyzing a data structure defined in the execution plan acquired by the execution plan acquisition unit.
The analyzer according to claim 1.
請求項1又は2に記載の分析装置。 The analysis unit generates the operation-related information including information related to a processing load when combining the first table group and the second table group in the database system,
The analyzer according to claim 1 or 2.
前記解析部は、前記実行計画取得部が取得した複数の前記実行計画のそれぞれにおいて行われる前記二項演算を特定し、
結合するテーブル群が同一の前記二項演算の統計情報として、前記処理負荷の統計値を示し、前記分析装置のユーザが確認する情報を生成する統計情報生成部をさらに備え、
前記出力部は、前記統計情報生成部が生成した前記統計情報を出力する、
請求項3に記載の分析装置。 The execution plan acquisition unit acquires a plurality of execution plans corresponding to each of the plurality of queries,
The analysis unit identifies the binary operation performed in each of the plurality of execution plans acquired by the execution plan acquisition unit;
further comprising a statistical information generation unit that indicates the statistical value of the processing load as statistical information of the binary operation with the same group of tables to be combined and generates information that is confirmed by the user of the analysis device ;
The output unit outputs the statistical information generated by the statistical information generation unit.
The analyzer according to claim 3.
前記解析部は、前記実行計画取得部が取得した複数の前記実行計画のそれぞれにおいて行われる前記二項演算を特定し、
結合するテーブル群が同一の前記二項演算の統計情報として、前記データベースシステムにおいて前記二項演算が行われた回数と、前記第1のテーブル群に含まれる一以上のテーブルに含まれるデータ数と前記第2のテーブル群に含まれる一以上のテーブルに含まれるデータ数との合計値とを示し、前記分析装置のユーザが確認する情報を生成する統計情報生成部をさらに備え、
前記出力部は、前記統計情報生成部が生成した前記統計情報を出力する、
請求項1から4のいずれか1項に記載の分析装置。 The execution plan acquisition unit acquires a plurality of execution plans corresponding to each of the plurality of queries,
The analysis unit identifies the binary operation performed in each of the plurality of execution plans acquired by the execution plan acquisition unit;
The number of times the binary operation was performed in the database system and the number of data contained in one or more tables included in the first table group as statistical information of the binary operation with the same group of tables to be joined. a statistical information generating unit that generates information that indicates the total number of data included in one or more tables included in the second table group and the number of data included in the second table group and that is confirmed by the user of the analysis device ;
The output unit outputs the statistical information generated by the statistical information generation unit.
The analyzer according to any one of claims 1 to 4.
データベースシステムにおいて実行されたクエリに対して前記データベースシステムが前記クエリに対応する演算を行うために生成した、処理の内容を示すノードと、当該ノードに対する他のノードからのデータの入力を示すエッジとから構成される二分木のデータ構造を有する実行計画を取得するステップと、
取得された前記実行計画に含まれるノードに基づいて、前記実行計画に対応して前記データベースシステムにおいて行われるテーブルを結合する演算を示す二項演算に対応するノードを特定するステップと、
前記実行計画が示す二分木に含まれる、特定したノードにデータを入力するエッジを介して当該ノードに接続される下位の二分木であるサブツリーに含まれる複数のノードである下位の複数のノードを走査することにより、特定されたノードに対応する前記二項演算により結合される一以上のテーブルを含む第1のテーブル群と、一以上のテーブルを含む第2のテーブル群とを特定するステップと、
特定した前記第1のテーブル群と、前記第2のテーブル群とを示す情報を含み、前記コンピュータのユーザが確認する演算関連情報を生成するステップと、
生成された前記演算関連情報を出力するステップと、
を備える分析方法。 the computer runs
A node indicating the content of processing generated for a query executed in the database system so that the database system performs an operation corresponding to the query, and an edge indicating the input of data from another node to the node obtaining an execution plan having a binary tree data structure consisting of
a step of identifying a node corresponding to a binary operation representing an operation of joining tables performed in the database system corresponding to the execution plan, based on the nodes included in the acquired execution plan;
A plurality of lower nodes that are included in a subtree that is a lower binary tree that is connected to a specified node via an edge that inputs data to the specified node included in the binary tree indicated by the execution plan. identifying, by scanning , a first group of tables including one or more tables joined by the binary operation corresponding to the identified node, and a second group of tables including one or more tables; ,
a step of generating operation-related information including information indicating the identified first table group and the second table group and confirmed by a user of the computer ;
outputting the generated operation-related information;
A method of analysis comprising
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2019031561A JP7242343B2 (en) | 2019-02-25 | 2019-02-25 | Analysis device and analysis method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2019031561A JP7242343B2 (en) | 2019-02-25 | 2019-02-25 | Analysis device and analysis method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2020135717A JP2020135717A (en) | 2020-08-31 |
JP7242343B2 true JP7242343B2 (en) | 2023-03-20 |
Family
ID=72263408
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2019031561A Active JP7242343B2 (en) | 2019-02-25 | 2019-02-25 | Analysis device and analysis method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP7242343B2 (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001142898A (en) | 1999-11-16 | 2001-05-25 | Hitachi Ltd | Execution propriety judging method of inquiry processing |
JP2014519080A (en) | 2011-05-02 | 2014-08-07 | アビニシオ テクノロジー エルエルシー | Managing data queries |
WO2016067370A1 (en) | 2014-10-28 | 2016-05-06 | 株式会社Murakumo | Information processing device, method, and program |
US20170004173A1 (en) | 2014-01-28 | 2017-01-05 | Hewlett Packard Enterprise Development Company Lp | Real-time monitoring and analysis of query execution |
US20170147644A1 (en) | 2015-11-20 | 2017-05-25 | Sap Se | Query optimization using join cardinality |
US20190005092A1 (en) | 2017-06-30 | 2019-01-03 | Microsoft Technology Licensing, Llc | Query optimization using propagated data distinctness |
-
2019
- 2019-02-25 JP JP2019031561A patent/JP7242343B2/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001142898A (en) | 1999-11-16 | 2001-05-25 | Hitachi Ltd | Execution propriety judging method of inquiry processing |
JP2014519080A (en) | 2011-05-02 | 2014-08-07 | アビニシオ テクノロジー エルエルシー | Managing data queries |
US20170004173A1 (en) | 2014-01-28 | 2017-01-05 | Hewlett Packard Enterprise Development Company Lp | Real-time monitoring and analysis of query execution |
WO2016067370A1 (en) | 2014-10-28 | 2016-05-06 | 株式会社Murakumo | Information processing device, method, and program |
US20170147644A1 (en) | 2015-11-20 | 2017-05-25 | Sap Se | Query optimization using join cardinality |
US20190005092A1 (en) | 2017-06-30 | 2019-01-03 | Microsoft Technology Licensing, Llc | Query optimization using propagated data distinctness |
Also Published As
Publication number | Publication date |
---|---|
JP2020135717A (en) | 2020-08-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10360212B2 (en) | Guided keyword-based exploration of data | |
US9378269B1 (en) | Method and computing device for maintaining dependencies among reference elements | |
US20060074858A1 (en) | Method and apparatus for querying relational databases | |
US8898146B2 (en) | System and method for comparing database query plans | |
US6434545B1 (en) | Graphical query analyzer | |
US9652498B2 (en) | Processing queries using hybrid access paths | |
US20160098448A1 (en) | Dynamic database query efficiency improvement | |
CN105630881A (en) | Data storage method and query method for RDF (Resource Description Framework) | |
US11288266B2 (en) | Candidate projection enumeration based query response generation | |
US20130054566A1 (en) | Acceleration of ranking algorithms using a graphics processing unit | |
US20140067853A1 (en) | Data search method, information system, and recording medium storing data search program | |
US20060074857A1 (en) | Method and apparatus for querying relational databases | |
CN114328612A (en) | Data processing method and device of query optimizer and electronic equipment | |
US10223086B2 (en) | Systems and methods for code parsing and lineage detection | |
US9405853B2 (en) | Reading object queries | |
JP7242343B2 (en) | Analysis device and analysis method | |
CN110580170A (en) | software performance risk identification method and device | |
KR20160047239A (en) | The column group selection method for storing datea efficiently in the mixed olap/oltp workload environment | |
JP7022712B2 (en) | Query recommendation device and query recommendation method | |
EP3086244A1 (en) | Database system and method of operation thereof | |
US11481392B2 (en) | Transformation reconstruction for optimized database query | |
KR20170128666A (en) | Query processing method and system thereof | |
Horiuchi et al. | JupySim: Jupyter Notebook Similarity Search System. | |
US20200311067A1 (en) | Database partition pruning using dependency graph | |
JP2021033695A (en) | Computer system and business support method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20201217 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20211029 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20211207 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20220124 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20220621 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20220726 |
|
C60 | Trial request (containing other claim documents, opposition documents) |
Free format text: JAPANESE INTERMEDIATE CODE: C60 Effective date: 20220726 |
|
A911 | Transfer to examiner for re-examination before appeal (zenchi) |
Free format text: JAPANESE INTERMEDIATE CODE: A911 Effective date: 20220817 |
|
C21 | Notice of transfer of a case for reconsideration by examiners before appeal proceedings |
Free format text: JAPANESE INTERMEDIATE CODE: C21 Effective date: 20220823 |
|
A912 | Re-examination (zenchi) completed and case transferred to appeal board |
Free format text: JAPANESE INTERMEDIATE CODE: A912 Effective date: 20221028 |
|
C211 | Notice of termination of reconsideration by examiners before appeal proceedings |
Free format text: JAPANESE INTERMEDIATE CODE: C211 Effective date: 20221101 |
|
C22 | Notice of designation (change) of administrative judge |
Free format text: JAPANESE INTERMEDIATE CODE: C22 Effective date: 20221108 |
|
C22 | Notice of designation (change) of administrative judge |
Free format text: JAPANESE INTERMEDIATE CODE: C22 Effective date: 20230104 |
|
C23 | Notice of termination of proceedings |
Free format text: JAPANESE INTERMEDIATE CODE: C23 Effective date: 20230131 |
|
C03 | Trial/appeal decision taken |
Free format text: JAPANESE INTERMEDIATE CODE: C03 Effective date: 20230307 |
|
C30A | Notification sent |
Free format text: JAPANESE INTERMEDIATE CODE: C3012 Effective date: 20230307 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20230308 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 7242343 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |