Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP6971929B2 - Inquiry statement output device and inquiry statement output method - Google Patents
[go: Go Back, main page]

JP6971929B2 - Inquiry statement output device and inquiry statement output method - Google Patents

Inquiry statement output device and inquiry statement output method Download PDF

Info

Publication number
JP6971929B2
JP6971929B2 JP2018136623A JP2018136623A JP6971929B2 JP 6971929 B2 JP6971929 B2 JP 6971929B2 JP 2018136623 A JP2018136623 A JP 2018136623A JP 2018136623 A JP2018136623 A JP 2018136623A JP 6971929 B2 JP6971929 B2 JP 6971929B2
Authority
JP
Japan
Prior art keywords
execution plan
query statement
execution
unit
statement
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
Application number
JP2018136623A
Other languages
Japanese (ja)
Other versions
JP2020013448A (en
Inventor
茂莉 黒川
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.)
KDDI Corp
Original Assignee
KDDI Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by KDDI Corp filed Critical KDDI Corp
Priority to JP2018136623A priority Critical patent/JP6971929B2/en
Publication of JP2020013448A publication Critical patent/JP2020013448A/en
Application granted granted Critical
Publication of JP6971929B2 publication Critical patent/JP6971929B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

本発明は、データベースシステムにおいて実行可能な問合せ文を出力する問合せ文出力装置及び問合せ文出力方法に関する。 The present invention relates to a query statement output device and a query statement output method that output query statements that can be executed in a database system.

従来、リレーショナルデータベースにおいて、処理コストを削減することを目的として、複数の問合せにおいて共通して行われる処理に対応する物理的なビューであるマテリアライズドビューを作成することが行われている(例えば、特許文献1参照)。 Conventionally, in a relational database, for the purpose of reducing processing costs, a materialized view, which is a physical view corresponding to processing commonly performed in a plurality of queries, has been created (for example, a patent). See Document 1).

特開2006−343798号公報Japanese Unexamined Patent Publication No. 2006-343798

マテリアライズドビューは、データベースシステムにおいて実行される複数の実行計画において共通する処理のうち、処理コストが高い処理に対応して作成することが好ましい。このため、複数の実行計画において共通する処理を特定することが行われている。しかしながら、実行計画では、共通の処理であっても記述が異なることがある。また、異なる処理であっても記述が同じことがある。このように処理と実行計画が多対多であるため、実行計画に基づいて共通する処理を特定することが困難であるという問題が発生する。 It is preferable to create the materialized view corresponding to the process having a high processing cost among the processes common to a plurality of execution plans executed in the database system. For this reason, it is performed to identify common processes in a plurality of execution plans. However, in the execution plan, the description may be different even if it is a common process. Moreover, the description may be the same even if the processing is different. Since there are many-to-many processes and execution plans in this way, there arises a problem that it is difficult to identify common processes based on the execution plans.

そこで、本発明はこれらの点に鑑みてなされたものであり、複数の実行計画において共通する処理を特定することを可能にする問合せ文出力装置及び問合せ文出力方法を提供することを目的とする。 Therefore, the present invention has been made in view of these points, and an object of the present invention is to provide a query statement output device and a query statement output method that enable identification of common processes in a plurality of execution plans. ..

本発明の第1の態様に係る問合せ文出力装置は、データベースシステムにおいて実行された、複数の実行計画を特定する特定部と、前記特定部により特定された複数の前記実行計画を、当該実行計画に含まれる文字列の並びと、当該実行計画に対応する前記データベースシステムにおける問合せ文に含まれる文字列の並びとの関連性に基づいて前記問合せ文に変換するとともに、当該実行計画の一部である部分実行計画を前記問合せ文に変換する第1変換部と、前記第1変換部により変換された問合せ文を出力する出力部と、を備える。 The query statement output device according to the first aspect of the present invention has a specific unit that specifies a plurality of execution plans executed in a database system, and a plurality of the execution plans specified by the specific unit. Is converted into the query statement based on the relationship between the sequence of character strings included in the query statement and the sequence of character strings included in the query statement in the database system corresponding to the execution plan, and is part of the execution plan. It includes a first conversion unit that converts a certain partial execution plan into the query statement, and an output unit that outputs the query statement converted by the first conversion unit.

前記出力部は、前記第1変換部により変換された複数の問合せ文のうち、他の問合せ文と類似度が高い問合せ文を出力してもよい。 The output unit may output a query statement having a high degree of similarity to other query statements among the plurality of query statements converted by the first conversion unit.

前記問合せ文出力装置は、前記実行計画を問合せ文に変換する変換モデルを生成する生成部をさらに備え、前記第1変換部は、複数の前記実行計画のそれぞれを前記変換モデルに入力し、前記変換モデルから出力される前記問合せ文を取得することにより、複数の実行計画のそれぞれを問合せ文に変換するとともに、複数の前記部分実行計画のそれぞれを前記変換モデルに入力し、前記変換モデルから出力される前記問合せ文を取得することにより、複数の前記部分実行計画のそれぞれを問合せ文に変換してもよい。 The query statement output device further includes a generation unit that generates a conversion model that converts the execution plan into a query statement, and the first conversion unit inputs each of the plurality of execution plans into the conversion model, and the above-mentioned By acquiring the query statement output from the conversion model, each of the plurality of execution plans is converted into a query statement, and each of the plurality of the partial execution plans is input to the conversion model and output from the conversion model. By acquiring the query statement to be performed, each of the plurality of partial execution plans may be converted into a query statement.

前記問合せ文出力装置は、問合せ文を実行計画に変換する第2変換部をさらに備え、前記生成部は、前記変換モデルを生成し、当該変換モデルに対して前記特定部により特定された前記実行計画を入力することにより問合せ文を取得し、当該問合せ文を前記第2変換部に入力することにより、当該問合せ文に対応する実行計画を取得し、前記特定部により特定された前記実行計画と、当該変換モデルに対応する実行計画との類似度を算出し、前記変換モデルにおける設定情報を変更しながら、算出される類似度が相対的に高い変換モデルを選択してもよい。 The query statement output device further includes a second conversion unit that converts the query statement into an execution plan, the generation unit generates the conversion model, and the execution unit specified by the specific unit for the conversion model. By inputting a plan, an inquiry statement is acquired, and by inputting the inquiry statement into the second conversion unit, an execution plan corresponding to the inquiry statement is acquired, and the execution plan specified by the specific unit is obtained. , The degree of similarity with the execution plan corresponding to the conversion model may be calculated, and the conversion model having a relatively high degree of similarity may be selected while changing the setting information in the conversion model.

前記問合せ文出力装置は、問合せ文を実行計画に変換する第2変換部をさらに備え、前記生成部は、問合せ文を前記第2変換部に入力することにより、当該問合せ文に対応する実行計画を取得し、取得した当該実行計画を前記変換モデルに対して入力することにより問合せ文を取得し、前記第2変換部に入力された問合せ文と、前記変換モデルから取得した問合せ文との類似度を算出し、前記変換モデルにおける設定情報を変更しながら、算出される当該類似度が相対的に高い変換モデルを選択してもよい。 The inquiry statement output device further includes a second conversion unit that converts the inquiry statement into an execution plan, and the generation unit inputs the inquiry statement to the second conversion unit to provide an execution plan corresponding to the inquiry statement. Is obtained, and the obtained execution plan is input to the conversion model to acquire a query statement, and the query statement input to the second conversion unit is similar to the query statement acquired from the conversion model. A conversion model having a relatively high degree of similarity may be selected while calculating the degree and changing the setting information in the conversion model.

前記第2変換部は、前記データベースシステムに、問合せ文に対応する実行計画を生成させることにより、当該問合せ文を実行計画に変換してもよい。
前記特定部は、データベースシステムにおいて実行された、実行コストが相対的に高い複数の実行計画を特定してもよい。
The second conversion unit may convert the query statement into an execution plan by causing the database system to generate an execution plan corresponding to the query statement.
The specific unit may specify a plurality of execution plans executed in the database system and having a relatively high execution cost.

本発明の第2の態様に係る問合せ文出力方法は、コンピュータが実行する、データベースシステムにおいて実行された、複数の実行計画を特定するステップと、特定された複数の前記実行計画を、当該実行計画に含まれる文字列の並びと、当該実行計画に対応する前記データベースシステムにおける問合せ文に含まれる文字列の並びとの関連性に基づいて前記問合せ文に変換するとともに、当該実行計画の一部である部分実行計画を前記問合せ文に変換するステップと、前記実行計画から変換された問合せ文を出力するステップと、を備える。 In the query statement output method according to the second aspect of the present invention, a step of specifying a plurality of execution plans executed by a computer and executed in a database system, and the specified plurality of the execution plans are combined with the execution plan. Is converted into the query statement based on the relationship between the sequence of character strings included in the query statement and the sequence of character strings included in the query statement in the database system corresponding to the execution plan, and is part of the execution plan. It includes a step of converting a certain partial execution plan into the query statement and a step of outputting the query statement converted from the execution plan.

本発明によれば、複数の実行計画において共通する処理を特定することができるという効果を奏する。 According to the present invention, there is an effect that a common process can be specified in a plurality of execution plans.

本実施形態に係る問合せ文出力装置の概要を示す図である。It is a figure which shows the outline of the inquiry sentence output device which concerns on this embodiment. 本実施形態に係る問合せ文出力装置の構成を示す図である。It is a figure which shows the structure of the inquiry sentence output device which concerns on this embodiment. 問合せ文の一例を示す図である。It is a figure which shows an example of an inquiry sentence. 図3に示す問合せ文に対応する実行計画を示す図である。It is a figure which shows the execution plan corresponding to the query statement shown in FIG. 図4に示す実行計画に対応する実行計画ツリーを示す図である。It is a figure which shows the execution plan tree corresponding to the execution plan shown in FIG. 図5に示す実行計画ツリーに対応する実行計画文字列を示す図である。It is a figure which shows the execution plan character string corresponding to the execution plan tree shown in FIG. 変換モデルの選択例を示す図である。It is a figure which shows the selection example of the transformation model. 変換モデルの他の選択例を示す図である。It is a figure which shows the other selection example of the transformation model. 本実施形態に係る問合せ文出力装置における処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process in the inquiry sentence output apparatus which concerns on this embodiment.

[問合せ文出力装置1の概要]
図1は、本実施形態に係る問合せ文出力装置1の概要を示す図である。問合せ文出力装置1は、データベースシステム2が生成した実行計画を問合せ文に変換して出力するコンピュータである。
[Overview of inquiry message output device 1]
FIG. 1 is a diagram showing an outline of the inquiry text output device 1 according to the present embodiment. The query statement output device 1 is a computer that converts an execution plan generated by the database system 2 into a query statement and outputs it.

問合せ文出力装置1は、データベースシステム2と、LAN(Local Area Network)やインターネット等の通信ネットワークを介して通信可能に接続されている。問合せ文出力装置1は、データベースシステム2において実行された問合せ文に対応する実行計画をデータベースシステム2から取得する(図1の(1))。 The inquiry text output device 1 is communicably connected to the database system 2 via a communication network such as a LAN (Local Area Network) or the Internet. The query statement output device 1 acquires an execution plan corresponding to the query statement executed in the database system 2 from the database system 2 ((1) in FIG. 1).

問合せ文出力装置1は、実行計画を問合せ文に変換する変換モデルに基づいて、取得した実行計画を問合せ文に変換する(図1の(2))。問合せ文出力装置1は、変換された複数の問合せ文のうち、他の問合せ文と類似度が高い問合せ文を、マテリアライズドビューの作成に適している可能性が高い処理が実行される問合せ文として出力する(図1の(3))。 The query statement output device 1 converts the acquired execution plan into a query statement based on the conversion model that converts the execution plan into a query statement ((2) in FIG. 1). The query statement output device 1 uses a query statement having a high degree of similarity to other query statements among a plurality of converted query statements as a query statement for which processing that is likely to be suitable for creating a materialized view is executed. Output ((3) in FIG. 1).

実行計画は、同じ問合せ文であっても異なる記述となる場合があるところ、問合せ文出力装置1は、当該異なる記述を含む複数の実行計画を、同じ問合せ文に変換して出力することができる。これにより、問合せ文出力装置1のユーザは、複数の実行計画のみを参照する場合に比べて、これらの実行計画において共通する処理を特定することができる。
以下、問合せ文出力装置1の構成について説明する。
Although the execution plan may have different descriptions even if they are the same query statement, the query statement output device 1 can convert a plurality of execution plans including the different description into the same query statement and output the query statement. .. As a result, the user of the query statement output device 1 can specify the processes common to these execution plans as compared with the case where only a plurality of execution plans are referred to.
Hereinafter, the configuration of the inquiry statement output device 1 will be described.

[問合せ文出力装置1の構成例]
図2は、第1実施形態に係る問合せ文出力装置1の構成を示す図である。
問合せ文出力装置1は、記憶部11と、制御部12とを備える。
[Configuration example of inquiry message output device 1]
FIG. 2 is a diagram showing a configuration of the inquiry text output device 1 according to the first embodiment.
The inquiry text output device 1 includes a storage unit 11 and a control unit 12.

記憶部11は、例えば、ROM(Read Only Memory)及びRAM(Random Access Memory)等である。記憶部11は、問合せ文出力装置1を機能させるための各種プログラムを記憶する。記憶部11は、問合せ文出力装置1の制御部12を、後述する特定部121、生成部122、第2変換部123、第1変換部124、及び出力部125として機能させる問合せ文出力プログラムを記憶する。また、記憶部11は、生成部122により生成される、実行計画を問合せ文に変換するプログラムである変換モデルMを記憶する。 The storage unit 11 is, for example, a ROM (Read Only Memory), a RAM (Random Access Memory), or the like. The storage unit 11 stores various programs for operating the inquiry statement output device 1. The storage unit 11 provides a query text output program that causes the control unit 12 of the query text output device 1 to function as a specific unit 121, a generation unit 122, a second conversion unit 123, a first conversion unit 124, and an output unit 125, which will be described later. Remember. Further, the storage unit 11 stores the conversion model M, which is a program generated by the generation unit 122 to convert the execution plan into a query statement.

制御部12は、例えばCPU(Central Processing Unit)である。制御部12は、記憶部11に記憶されている各種プログラムを実行することにより、問合せ文出力装置1に係る機能を制御する。制御部12は、問合せ文出力プログラムを実行することにより、特定部121、生成部122、第2変換部123、第1変換部124、及び出力部125として機能する。また、制御部12は、変換モデルMを実行することにより、実行計画を問合せ文に変換する。 The control unit 12 is, for example, a CPU (Central Processing Unit). The control unit 12 controls the function related to the inquiry statement output device 1 by executing various programs stored in the storage unit 11. By executing the inquiry statement output program, the control unit 12 functions as a specific unit 121, a generation unit 122, a second conversion unit 123, a first conversion unit 124, and an output unit 125. Further, the control unit 12 converts the execution plan into a query statement by executing the conversion model M.

特定部121は、データベースシステム2から、データベースシステム2において実行された複数の実行計画のうち、実行コストが相対的に高い複数の実行計画を取得することにより、複数の実行計画を特定する。例えば、データベースシステム2において生成された実行計画には、実行コストが関連付けられており、特定部121は、関連付けられている実行コストが相対的に高い複数の実行計画を特定する。 The specifying unit 121 identifies a plurality of execution plans by acquiring from the database system 2 a plurality of execution plans having a relatively high execution cost among the plurality of execution plans executed in the database system 2. For example, the execution plan generated in the database system 2 is associated with an execution cost, and the specifying unit 121 identifies a plurality of execution plans having a relatively high associated execution cost.

また、特定部121は、データベースシステム2から、複数の実行計画のそれぞれに対応する問合せ文を取得することにより、複数の実行計画のそれぞれに関連付けられている問合せ文を特定する。ここで、実行計画は、データベースシステム2が、問合せ文に対応する処理を実行する際に生成する情報である。問合せ文は、データベースシステム2において実行されたSQL等の問合せ文である。 Further, the specifying unit 121 identifies the query statements associated with each of the plurality of execution plans by acquiring the query statements corresponding to each of the plurality of execution plans from the database system 2. Here, the execution plan is information generated when the database system 2 executes the process corresponding to the query statement. The inquiry statement is an inquiry statement such as SQL executed in the database system 2.

図3は、問合せ文の一例を示す図である。図4は、図3に示す問合せ文に対応する実行計画を示す図である。図4において最初に示される文字列「Sort」と、「−>」の後に示される文字列とは、問合せ文によって実行される処理としてのノードを示している。また、文字列「Scan」を含むノード(以下、Scanノードともいう。)に続く文字列は、参照されるテーブルのテーブル名を示している。 FIG. 3 is a diagram showing an example of a query statement. FIG. 4 is a diagram showing an execution plan corresponding to the query statement shown in FIG. The character string "Sort" first shown in FIG. 4 and the character string shown after "->" indicate a node as a process executed by a query statement. Further, the character string following the node including the character string "Scan" (hereinafter, also referred to as "Scan node") indicates the table name of the referenced table.

特定部121は、特定した実行計画に基づいて実行計画が示す木構造を表す実行計画文字列を生成する。具体的には、特定部121は、特定した実行計画に基づいて、実行計画に含まれる処理を示すノードと、実行計画に対応する処理において参照されるテーブルのテーブル名を抽出する。特定部121は、特定した実行計画を示すコードの記載順序と、抽出したノード及びテーブル名とに基づいて、実行計画に対応する問合せ文の木構造を抽出する。特定部121は、木構造のグラフである実行計画ツリーを生成する。 The specific unit 121 generates an execution plan character string representing the tree structure indicated by the execution plan based on the specified execution plan. Specifically, the specifying unit 121 extracts the node indicating the process included in the execution plan and the table name of the table referred to in the process corresponding to the execution plan based on the specified execution plan. The specific unit 121 extracts the tree structure of the query statement corresponding to the execution plan based on the description order of the code indicating the specified execution plan and the extracted node and table name. The specific unit 121 generates an execution plan tree which is a graph of a tree structure.

図5は、図4に示す実行計画に対応する実行計画ツリーを示す図である。実行計画ツリーでは、各ノードN1〜N9における処理の略称を、括弧内に示している。例えば、ルートノードに対応する処理「Sort」の略称は「S」であり、処理「Group Aggregate」の略称は「GA」である。また、実行計画ツリーでは、Scanノードの下部にテーブル名を示している。 FIG. 5 is a diagram showing an execution plan tree corresponding to the execution plan shown in FIG. In the execution plan tree, the abbreviations of the processes in each node N1 to N9 are shown in parentheses. For example, the abbreviation of the process "Sort" corresponding to the root node is "S", and the abbreviation of the process "Group Aggregate" is "GA". In the execution plan tree, the table name is shown at the bottom of the Scan node.

特定部121は、抽出された実行計画ツリーを、ルートとなるノードから行きがけ順及び帰りがけ順に走査することにより実行計画文字列を生成する。すなわち、特定部121は、実行計画ツリーを、ルートとなるノードから行きがけ順及び帰りがけ順に走査したときに検出されたノードの略称を、検出された順番で並べた文字列を実行計画文字列として生成する。 The specific unit 121 generates an execution plan character string by scanning the extracted execution plan tree in the order of going and returning from the node that is the root. That is, the specific unit 121 generates a character string in which the abbreviations of the nodes detected when the execution plan tree is scanned from the root node in the order of going and returning are arranged in the order of detection as the execution plan character string. do.

ここで、特定部121は、処理が重複するノードには通し番号を付与する。例えば、図5に示されるノードN1と、ノードN3とは、いずれも「Sort(S)」である。そこで、特定部121は、ノードN1の略称を「S1」とし、ノードN2の略称を「S2」とする。また、特定部121は、Scanノードに対応する略称に、当該Scanノードにおいて参照されるテーブルのテーブル名称、カラム名称のリスト、フィルタ条件を関連付ける。 Here, the specific unit 121 assigns a serial number to the nodes whose processes overlap. For example, the node N1 and the node N3 shown in FIG. 5 are both “Sort (S)”. Therefore, in the specific unit 121, the abbreviation of the node N1 is "S1", and the abbreviation of the node N2 is "S2". Further, the specific unit 121 associates the abbreviation corresponding to the Scan node with the table name, the list of column names, and the filter conditions of the table referenced in the Scan node.

特定部121は、実行計画ツリーを行きがけ順に走査する際、各ノードで検出されたカラム名称と対応するテーブル名称を記憶することによりカラム名称のリストを作成する。そして、特定部121は、当該テーブル名称に関するScanノードが検出された際、当該テーブルに対応付けられたカラム名称のリストを関連付ける。
また、特定部121は、当該Scanノードにおいて参照されるテーブルのフィルタ条件を関連付ける。
The specific unit 121 creates a list of column names by storing the column names detected in each node and the corresponding table names when scanning the execution plan tree in the order of the destinations. Then, when the Scan node related to the table name is detected, the specific unit 121 associates a list of column names associated with the table.
Further, the specific unit 121 associates the filter condition of the table referred to in the Scan node.

図6は、図5に示す実行計画ツリーに対応する実行計画文字列を示す図である。図6に示すように、実行計画文字列では、ノードが検出された順番に、当該ノードの略称が羅列されていることが確認できる。さらに、図6では、Scanノードの略称について、“→ テーブル名称[カラム名称リスト](フィルタ条件)”のように、参照されるテーブルのテーブル名称等が関連付けられていることが確認できる。 FIG. 6 is a diagram showing an execution plan character string corresponding to the execution plan tree shown in FIG. As shown in FIG. 6, in the execution plan character string, it can be confirmed that the abbreviations of the nodes are listed in the order in which the nodes are detected. Further, in FIG. 6, it can be confirmed that the abbreviation of the Scan node is associated with the table name of the referenced table, such as “→ table name [column name list] (filter condition)”.

特定部121は、特定した複数の実行計画のそれぞれについて実行計画文字列を生成する。また、特定部121は、特定した実行計画から、当該実行計画の一部である部分実行計画をさらに特定し、当該部分実行計画についても実行計画文字列を生成する。 The specific unit 121 generates an execution plan character string for each of the specified plurality of execution plans. Further, the specifying unit 121 further specifies a partial execution plan that is a part of the execution plan from the specified execution plan, and generates an execution plan character string for the partial execution plan as well.

具体的には、特定部121は、実行計画ツリーにおいて、複数のテーブルの結合を示す「Nested Loop」や「Hash Join」の下位のノード群を部分実行計画として抽出する。そして、特定部121は、抽出した部分実行計画について実行計画文字列を生成する。特定部121は、実行計画文字列を作成する際に、Scanノードの略称について参照先のテーブル名称等を挿入又は置換を行うことにより、参照先のテーブル名称等の文字列を実行計画文字列に取り込んでもよい。例えば、特定部121は、参照先のテーブル名称等の文字列を実行計画文字列に取り込む際、括弧、カンマ等を空白(スペース)に置換してもよい。例えば、“IS → lineitem[l_extendedprice, l_discount, l_orderkey](l_shipdate > '1995-03-12'::date)”という文字列の場合、“IS lineitem l_extendedprice l_discount l_orderkey l_shipdate > 1995-03-12 date”という文字列に変換してもよい。 Specifically, the specific unit 121 extracts a group of nodes under "Next Loop" and "Hash Join" indicating the join of a plurality of tables as a partial execution plan in the execution plan tree. Then, the specific unit 121 generates an execution plan character string for the extracted partial execution plan. When creating the execution plan character string, the specific unit 121 inserts or replaces the reference table name or the like with respect to the abbreviation of the Scan node, so that the character string such as the reference table name or the like is used as the execution plan character string. You may take it in. For example, the specific unit 121 may replace parentheses, commas, etc. with spaces when incorporating a character string such as a referenced table name into the execution plan character string. For example, in the case of the character string "IS → lineitem [l_extendedprice, l_discount, l_orderkey] (l_shipdate> '1995-03-12' :: date)", it is "IS lineitem l_extendedprice l_discount l_orderkey l_shipdate> 1995-03-12 date". It may be converted into a character string.

[変換モデルMの生成]
生成部122は、実行計画を問合せ文に変換する変換モデルMを生成する。具体的には、生成部122は、実行計画を示す実行計画文字列を入力すると、当該実行計画文字列に対応する問合せ文を出力する変換モデルMを生成する。例えば、生成部122は、記号列を入力すると対応する記号列を出力するモデルであるSequence-to-Sequenceモデルに教師データを与えて学習させることにより、変換モデルMを生成する。
[Generation of conversion model M]
The generation unit 122 generates a conversion model M that converts an execution plan into a query statement. Specifically, when the generation unit 122 inputs an execution plan character string indicating an execution plan, the generation unit 122 generates a conversion model M that outputs a query statement corresponding to the execution plan character string. For example, the generation unit 122 generates a conversion model M by giving teacher data to a Sequence-to-Sequence model, which is a model that outputs a corresponding symbol string when a symbol string is input, and training the model.

教師データは、入力される記号列と、出力される記号列との組み合わせである。入力される記号列は、特定部121が特定した実行計画から生成した実行計画文字列であり、出力される記号列は、当該実行計画に関連付けられている問合せ文である。 The teacher data is a combination of the input symbol string and the output symbol string. The input symbol string is an execution plan character string generated from the execution plan specified by the specific unit 121, and the output symbol string is a query statement associated with the execution plan.

生成部122は、変換モデルMを生成し、当該変換モデルMに対して特定部121により特定された実行計画を入力することにより問合せ文を取得する。そして、生成部122は、当該問合せ文を、第2変換部123に入力することにより、当該問合せ文に対応する実行計画を取得する。 The generation unit 122 generates a conversion model M, and acquires an inquiry statement by inputting an execution plan specified by the specific unit 121 to the conversion model M. Then, the generation unit 122 acquires the execution plan corresponding to the inquiry statement by inputting the inquiry statement into the second conversion unit 123.

ここで、第2変換部123は、問合せ文を実行計画に変換する機能を有している。第2変換部123は、データベースシステム2に問合せ文を入力し、当該問合せ文に対応する実行計画を生成させる。そして、第2変換部123は、データベースシステム2から当該実行計画を取得することにより、当該問合せ文を実行計画に変換する。 Here, the second conversion unit 123 has a function of converting the query statement into an execution plan. The second conversion unit 123 inputs a query statement into the database system 2 and generates an execution plan corresponding to the query statement. Then, the second conversion unit 123 converts the query statement into an execution plan by acquiring the execution plan from the database system 2.

続いて、生成部122は、特定部121により特定された一以上の実行計画と、変換モデルMから出力された問合せ文から変換された一以上の実行計画との類似度を算出する。例えば、生成部122は、特定部121により特定された実行計画と、変換モデルMから出力された問合せ文から変換された実行計画とのレーベンシュタイン距離を算出する。ここで、レーベンシュタイン距離は、文字列を比較対象の文字列に変換する場合に要する編集の回数を示しており、0回であれば、文字列と、比較対象の文字列とが一致していることを示している。また、レーベンシュタイン距離の値が小さければ小さいほど、文字列と、比較対象の文字列との類似度が高いことを示している。生成部122は、算出したレーベンシュタイン距離が小さければ小さいほど類似度が大きくなるように類似度を算出する。 Subsequently, the generation unit 122 calculates the degree of similarity between the one or more execution plans specified by the specific unit 121 and the one or more execution plans converted from the query statement output from the conversion model M. For example, the generation unit 122 calculates the Levenshtein distance between the execution plan specified by the specific unit 121 and the execution plan converted from the query statement output from the conversion model M. Here, the Levenshtein distance indicates the number of edits required when converting a character string to a character string to be compared, and if it is 0 times, the character string and the character string to be compared match. It shows that there is. Further, the smaller the value of the Levenshtein distance is, the higher the similarity between the character string and the character string to be compared is shown. The generation unit 122 calculates the similarity so that the smaller the calculated Levenshtein distance, the greater the similarity.

生成部122は、Sequence-to-Sequenceモデルにおける設定情報を変更しながら、複数の変換モデルMを生成する。そして、生成部122は、生成した複数の変換モデルMのそれぞれについて、一以上の実行計画と、変換モデルMに対応する一以上の実行計画との類似度を算出し、算出した類似度に基づいて類似度の平均値を算出する。そして、生成部122は、算出される類似度の平均値が相対的に高い1つの変換モデルMを選択する。 The generation unit 122 generates a plurality of conversion models M while changing the setting information in the Sequence-to-Sequence model. Then, the generation unit 122 calculates the similarity between one or more execution plans and one or more execution plans corresponding to the conversion model M for each of the generated plurality of conversion models M, and based on the calculated similarity. And calculate the average value of the degree of similarity. Then, the generation unit 122 selects one conversion model M having a relatively high average value of the calculated similarity.

図7は、変換モデルMの選択例を示す図である。図7に示すように、生成部122は、異なる設定情報により設定された複数の変換モデルを生成する。図7に示す例では、設定情報Aにより設定された変換モデルM1と、設定情報Bにより設定された変換モデルM2とが生成されている。 FIG. 7 is a diagram showing a selection example of the conversion model M. As shown in FIG. 7, the generation unit 122 generates a plurality of conversion models set by different setting information. In the example shown in FIG. 7, the conversion model M1 set by the setting information A and the conversion model M2 set by the setting information B are generated.

生成部122は、生成した複数の変換モデルのそれぞれに、特定部121が特定した実行計画を入力して問合せ文に変換させ、第2変換部123により、当該問合せ文を実行計画に変換させる。そして、生成部122は、図7に示すように、複数の変換モデルのそれぞれに入力される、特定部121が特定した一以上の実行計画と、第2変換部123により変換された一以上の実行計画との類似度の平均である平均類似度を算出し、当該平均類似度が最も高い変換モデルを選択する。このようにすることで、問合せ文出力装置1は、変換精度の高い変換モデルMを生成することができる。 The generation unit 122 inputs an execution plan specified by the specific unit 121 into each of the generated conversion models and converts the query statement into an execution plan, and the second conversion unit 123 converts the query statement into an execution plan. Then, as shown in FIG. 7, the generation unit 122 has one or more execution plans specified by the specific unit 121 and one or more converted by the second conversion unit 123, which are input to each of the plurality of conversion models. The average similarity, which is the average of the similarity with the execution plan, is calculated, and the transformation model having the highest average similarity is selected. By doing so, the query statement output device 1 can generate a conversion model M with high conversion accuracy.

なお、生成部122は、図7に示すように、特定部121が特定した一以上の実行計画と、第2変換部123により変換された一以上の実行計画との類似度に基づいて、複数の変換モデルの中から変換モデルMを選択したが、これに限らない。 As shown in FIG. 7, a plurality of generation units 122 are provided based on the degree of similarity between the one or more execution plans specified by the specific unit 121 and the one or more execution plans converted by the second conversion unit 123. The transformation model M was selected from the transformation models of, but it is not limited to this.

生成部122は、特定部121が特定した問合せ文を第2変換部123に入力することにより、当該問合せ文に対応する実行計画を取得し、取得した当該実行計画を変換モデルに対して入力することにより問合せ文を取得し、第2変換部123に入力された問合せ文と、変換モデルから取得した問合せ文との類似度を算出してもよい。そして、生成部122は、変換モデルにおける設定情報を変更しながら、算出される当該類似度が相対的に高い変換モデルを選択してもよい。 The generation unit 122 acquires the execution plan corresponding to the query statement by inputting the query statement specified by the specific unit 121 into the second conversion unit 123, and inputs the acquired execution plan to the conversion model. By doing so, the query text may be acquired, and the similarity between the query text input to the second conversion unit 123 and the query text acquired from the conversion model may be calculated. Then, the generation unit 122 may select a conversion model having a relatively high degree of similarity calculated while changing the setting information in the conversion model.

図8は、変換モデルMの他の選択例を示す図である。図8に示す例では、図7に示す例と同様に、生成部122が、異なる設定情報により設定された複数の変換モデルを生成する。図8に示す例では、設定情報Aにより設定された変換モデルM1と、設定情報Bにより設定された変換モデルM2とが生成されている。 FIG. 8 is a diagram showing another selection example of the transformation model M. In the example shown in FIG. 8, similarly to the example shown in FIG. 7, the generation unit 122 generates a plurality of conversion models set by different setting information. In the example shown in FIG. 8, the conversion model M1 set by the setting information A and the conversion model M2 set by the setting information B are generated.

生成部122は、第2変換部123により、特定部121が特定した一以上の実行計画が生成された生成元となる問合せ文を実行計画に変換させる。そして、生成部122は、生成した複数の変換モデルのそれぞれに、変換された実行計画を入力して問合せ文に変換させる。そして、生成部122は、図8に示すように、複数の変換モデルのそれぞれに入力される、第2変換部123が変換した一以上の問合せ文と、変換モデルにより変換された一以上の問合せ文との類似度の平均である平均類似度を算出し、当該平均類似度が最も高い変換モデルを選択する。このようにすることで、問合せ文出力装置1は、図7に示す例と同様に変換精度の高い変換モデルMを生成することができる。 The generation unit 122 converts the query statement that is the generation source into which one or more execution plans specified by the specific unit 121 are generated by the second conversion unit 123 into the execution plan. Then, the generation unit 122 inputs the converted execution plan into each of the generated transformation models and converts them into query statements. Then, as shown in FIG. 8, the generation unit 122 includes one or more query statements converted by the second conversion unit 123 and one or more queries converted by the conversion model, which are input to each of the plurality of conversion models. The average similarity with the sentence is calculated, and the transformation model with the highest average similarity is selected. By doing so, the inquiry sentence output device 1 can generate a conversion model M having high conversion accuracy as in the example shown in FIG. 7.

[問合せ文の出力]
第1変換部124は、特定部121により特定された複数の実行計画を、当該実行計画に含まれる文字列の並びと、当該実行計画に対応するデータベースシステム2における問合せ文に含まれる文字列の並びとの関連性に基づいて、データベースシステム2における問合せ文に変換するとともに、特定部121により特定された、当該実行計画の一部である部分実行計画を問合せ文に変換する。なお、第1変換部124は、問合せ文に含まれるテーブル名称に対して、部分実行計画に含まれるテーブル名称に関連付けられたカラム名称やフィルタ条件のうち問合せ文に含まれないものを、不足した情報として問合せ文に追加しても構わない。
[Output of inquiry statement]
The first conversion unit 124 describes a plurality of execution plans specified by the specific unit 121 as a sequence of character strings included in the execution plan and a character string included in a query statement in the database system 2 corresponding to the execution plan. Based on the relationship with the sequence, it is converted into a query statement in the database system 2, and the partial execution plan that is a part of the execution plan specified by the specific unit 121 is converted into a query statement. It should be noted that the first conversion unit 124 lacks the column names and filter conditions associated with the table names included in the partial execution plan that are not included in the query statement with respect to the table names included in the query statement. You may add it to the query statement as information.

具体的には、第1変換部124は、複数の実行計画のそれぞれに対応する実行計画文字列を変換モデルMに入力し、当該変換モデルMから出力される問合せ文を取得することにより、複数の実行計画のそれぞれを問合せ文に変換する。同様に、第1変換部124は、複数の部分実行計画のそれぞれに対応する実行計画文字列を変換モデルMに入力し、当該変換モデルMから出力される問合せ文を取得することにより、複数の部分実行計画のそれぞれを問合せ文に変換する。 Specifically, the first conversion unit 124 inputs an execution plan character string corresponding to each of the plurality of execution plans into the conversion model M, and acquires a plurality of query statements output from the conversion model M. Convert each of the execution plans of. Similarly, the first conversion unit 124 inputs an execution plan character string corresponding to each of the plurality of partial execution plans into the conversion model M, and acquires a plurality of query statements output from the conversion model M. Convert each of the partial execution plans into a query statement.

なお、第1変換部124が変換モデルMに入力する実行計画及び部分実行計画は、変換モデルMの生成に用いられた実行計画及び部分実行計画と異なっていてもよい。この場合、特定部121は、生成部122が変換モデルMを生成した後に、新たに実行計画及び部分実行計画を特定してもよい。そして、第1変換部124は、新たに特定された実行計画及び部分実行計画に対応する実行計画文字列を変換モデルMに入力し、これらの実行計画を問合せ文に変換してもよい。 The execution plan and the partial execution plan input by the first conversion unit 124 to the conversion model M may be different from the execution plan and the partial execution plan used to generate the conversion model M. In this case, the specifying unit 121 may newly specify the execution plan and the partial execution plan after the generation unit 122 generates the conversion model M. Then, the first conversion unit 124 may input the execution plan character string corresponding to the newly specified execution plan and the partial execution plan into the conversion model M, and convert these execution plans into the query statement.

出力部125は、第1変換部124により変換された問合せ文を出力する。具体的には、出力部125は、第1変換部124により変換された複数の問合せ文のうち、他の問合せ文と類似度が高い問合せ文を、問合せ文出力装置1に設けられた表示部(非表示)に出力したり、テキストファイルに出力して当該テキストファイルを記憶部11に記憶させたりする。また、出力部125は、問合せ文出力装置1と通信可能に接続されている管理端末(不図示)に出力してもよい。 The output unit 125 outputs the inquiry statement converted by the first conversion unit 124. Specifically, the output unit 125 displays a query statement having a high degree of similarity to other query statements among the plurality of query statements converted by the first conversion unit 124, provided in the query statement output device 1. It is output to (hidden) or output to a text file and the text file is stored in the storage unit 11. Further, the output unit 125 may output to a management terminal (not shown) that is communicably connected to the inquiry text output device 1.

例えば、出力部125は、第1変換部124により変換された複数の問合せ文のそれぞれについて、同様に変換された他の問合せ文と比較し、同一の文字列の問合せ文があれば名寄せし、名寄せされた問合せ文の個数に基づいて出現頻度を算出する。そして、出力部125は、出現頻度の高い問合せ文を、マテリアライズドビューの作成に適している可能性が高い処理が実行される問合せ文として出力する。 For example, the output unit 125 compares each of the plurality of query statements converted by the first conversion unit 124 with other query statements converted in the same manner, and if there is a query statement having the same character string, names it. The frequency of appearance is calculated based on the number of query statements that have been identified. Then, the output unit 125 outputs a query statement having a high frequency of appearance as a query statement to be executed, which is likely to be suitable for creating a materialized view.

また、出力部125は、第1変換部124により変換された複数の問合せ文のそれぞれについて、同様に変換された他の複数の問合せ文とのレーベンシュタイン距離を算出し、当該レーベンシュタイン距離に基づいて類似度の合計値を算出してもよい。例えば、出力部125は、他の複数の問合せ文のそれぞれとのレーベンシュタイン距離の合計値を、類似度の合計値として算出する。そして、出力部125は、類似度の合計値が高い問合せ文を、マテリアライズドビューの作成に適している可能性が高い処理が実行される問合せ文として出力してもよい。 Further, the output unit 125 calculates the Levenshtein distance between each of the plurality of query statements converted by the first conversion unit 124 and the other plurality of query statements converted in the same manner, and is based on the Levenshtein distance. The total value of the similarity may be calculated. For example, the output unit 125 calculates the total value of the Levenshtein distances with each of the other plurality of query statements as the total value of the similarity. Then, the output unit 125 may output a query statement having a high total similarity value as a query statement to be executed, which is likely to be suitable for creating a materialized view.

また、出力部125は、部分実行計画から変換された一以上の副問合せ文のそれぞれについて類似度を比較し、類似度が副問合せ文を、マテリアライズドビューの作成に適している可能性が高い処理に対応する副問合せ文として出力してもよい。 Further, the output unit 125 compares the similarity of each of the one or more subquery statements converted from the partial execution plan, and the processing is likely to be suitable for creating the materialized view of the subquery statement having the similarity degree. It may be output as a subquery statement corresponding to.

[問合せ文出力装置1における処理の流れ]
続いて、問合せ文出力装置1における処理の流れについて説明する。図9は、本実施形態に係る問合せ文出力装置1における処理の流れを示すフローチャートである。
[Process flow in inquiry message output device 1]
Subsequently, the flow of processing in the inquiry statement output device 1 will be described. FIG. 9 is a flowchart showing a processing flow in the inquiry text output device 1 according to the present embodiment.

まず、特定部121は、実行コストが相対的に高い複数の実行計画を取得することにより、複数の実行計画を特定するとともに、当該実行計画に含まれる部分実行計画を特定する(S1)。
続いて、生成部122は、S1において特定された実行計画に基づいて変換モデルMを生成する(S2)。なお、生成部122は、変換モデルMが既に生成されているか否かを判定してもよい。そして、生成部122は、変換モデルMが既に生成されていると判定すると、変換モデルMを生成しないようにしてもよい。
First, the specifying unit 121 specifies a plurality of execution plans by acquiring a plurality of execution plans having relatively high execution costs, and also specifies a partial execution plan included in the execution plan (S1).
Subsequently, the generation unit 122 generates the conversion model M based on the execution plan specified in S1 (S2). The generation unit 122 may determine whether or not the conversion model M has already been generated. Then, if the generation unit 122 determines that the conversion model M has already been generated, the conversion model M may not be generated.

続いて、第1変換部124は、実行計画及び部分実行計画を変換モデルMに入力して、変換モデルMから問合せ文を取得することにより、実行計画及び部分実行計画を問合せ文に変換する(S3)。 Subsequently, the first conversion unit 124 converts the execution plan and the partial execution plan into the query statement by inputting the execution plan and the partial execution plan into the conversion model M and acquiring the query statement from the conversion model M (the execution plan and the partial execution plan are converted into the query statements). S3).

続いて、出力部125は、S3において変換された複数の問合せ文のうち、他の問合せ文と類似度が高い問合せ文を出力する(S4)。 Subsequently, the output unit 125 outputs a query statement having a high degree of similarity to the other query statements among the plurality of query statements converted in S3 (S4).

[本実施形態における効果]
以上の通り、本実施形態に係る問合せ文出力装置1は、データベースシステム2において実行された、複数の実行計画をデータベースシステムにおける問合せ文に変換するとともに、当該実行計画の一部である部分実行計画を問合せ文に変換し、変換された問合せ文を出力する。このようにすることで、問合せ文出力装置1のユーザは、複数の実行計画のみを参照する場合に比べて、これらの実行計画において共通する処理を特定することができる。
[Effects in this embodiment]
As described above, the query statement output device 1 according to the present embodiment converts a plurality of execution plans executed in the database system 2 into query statements in the database system, and a partial execution plan that is a part of the execution plan. Is converted into a query statement, and the converted query statement is output. By doing so, the user of the query statement output device 1 can specify the processes common to these execution plans as compared with the case of referring only to a plurality of execution plans.

また、問合せ文出力装置1は、データベースシステムにおいて実行された、実行コストが相対的に高い複数の実行計画を特定し、当該実行計画に対応する問合せ文を出力する。このようにすることで、出力される問合せ文は、実行コストが相対的に高い問合せ文となる。したがって、問合せ文出力装置1のユーザは、当該問合せ文に基づいて、効果的なマテリアライズドビューに対応する処理を特定することができる。 Further, the query statement output device 1 identifies a plurality of execution plans executed in the database system and having a relatively high execution cost, and outputs a query statement corresponding to the execution plan. By doing so, the output query statement becomes a query statement with a relatively high execution cost. Therefore, the user of the inquiry statement output device 1 can specify the process corresponding to the effective materialized view based on the inquiry statement.

また、問合せ文出力装置1は、変換された複数の問合せ文のうち、他の問合せ文と類似度が高い問合せ文を出力する。このようにすることで、問合せ文出力装置1のユーザは、出力される問合せ文から、マテリアライズドビューの作成に適した処理に対応する副問合せ文を特定することができる。 Further, the inquiry statement output device 1 outputs an inquiry statement having a high degree of similarity to other inquiry statements among the plurality of converted inquiry statements. By doing so, the user of the query statement output device 1 can specify a subquery statement corresponding to the process suitable for creating the materialized view from the output query statement.

以上、本発明を実施の形態を用いて説明したが、本発明の技術的範囲は上記実施の形態に記載の範囲には限定されない。上記実施の形態に、多様な変更又は改良を加えることが可能であることが当業者に明らかである。例えば、上述の複数の実施形態を組み合わせてもよい。また、特に、装置の分散・統合の具体的な実施形態は以上に図示するものに限られず、その全部又は一部について、種々の付加等に応じて、又は、機能負荷に応じて、任意の単位で機能的又は物理的に分散・統合して構成することができる。 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. It will be apparent to those skilled in the art that various changes or improvements can be made to the above embodiments. For example, the plurality of embodiments described above may be combined. Further, in particular, the specific embodiment of the distribution / integration of the apparatus is not limited to those shown above, and all or a part thereof may be arbitrary according to various additions or the like, or according to the functional load. It can be functionally or physically distributed / integrated in units.

1・・・問合せ文出力装置、11・・・記憶部、12・・・制御部、121・・・特定部、122・・・生成部、123・・・第2変換部、124・・・第1変換部、125・・・出力部、2・・・データベースシステム

1 ... Inquiry text output device, 11 ... Storage unit, 12 ... Control unit, 121 ... Specific unit, 122 ... Generation unit, 123 ... Second conversion unit, 124 ... 1st conversion unit, 125 ... output unit, 2 ... database system

Claims (8)

データベースシステムにおいて実行された、複数の実行計画を特定する特定部と、
前記特定部により特定された複数の前記実行計画を、当該実行計画に含まれる文字列の並びと、当該実行計画に対応する前記データベースシステムにおける問合せ文に含まれる文字列の並びとの関連性に基づいて前記問合せ文に変換するとともに、当該実行計画の一部である部分実行計画を前記問合せ文に変換する第1変換部と、
前記第1変換部により変換された問合せ文を出力する出力部と、
を備える問合せ文出力装置。
A specific part that identifies multiple execution plans executed in the database system,
For the plurality of execution plans specified by the specific unit, the relationship between the sequence of character strings included in the execution plan and the sequence of character strings included in the query statement in the database system corresponding to the execution plan. Based on the first conversion unit that converts the partial execution plan that is a part of the execution plan into the query statement while converting it into the query statement.
An output unit that outputs a query statement converted by the first conversion unit, and an output unit.
Inquiry statement output device.
前記出力部は、前記第1変換部により変換された複数の問合せ文のうち、他の問合せ文と類似度が高い問合せ文を出力する、
請求項1に記載の問合せ文出力装置。
The output unit outputs a query statement having a high degree of similarity to other query statements among a plurality of query statements converted by the first conversion unit.
The inquiry text output device according to claim 1.
前記実行計画を問合せ文に変換する変換モデルを生成する生成部をさらに備え、
前記第1変換部は、複数の前記実行計画のそれぞれを前記変換モデルに入力し、前記変換モデルから出力される前記問合せ文を取得することにより、複数の実行計画のそれぞれを問合せ文に変換するとともに、複数の前記部分実行計画のそれぞれを前記変換モデルに入力し、前記変換モデルから出力される前記問合せ文を取得することにより、複数の前記部分実行計画のそれぞれを問合せ文に変換する、
請求項1又は2に記載の問合せ文出力装置。
It further includes a generator that generates a conversion model that converts the execution plan into a query statement.
The first conversion unit converts each of the plurality of execution plans into a query statement by inputting each of the plurality of execution plans into the conversion model and acquiring the query statement output from the transformation model. At the same time, each of the plurality of partial execution plans is input to the conversion model, and each of the plurality of partial execution plans is converted into a query statement by acquiring the query statement output from the transformation model.
The inquiry text output device according to claim 1 or 2.
問合せ文を実行計画に変換する第2変換部をさらに備え、
前記生成部は、前記変換モデルを生成し、当該変換モデルに対して前記特定部により特定された前記実行計画を入力することにより問合せ文を取得し、当該問合せ文を前記第2変換部に入力することにより、当該問合せ文に対応する実行計画を取得し、前記特定部により特定された前記実行計画と、当該変換モデルに対応する実行計画との類似度を算出し、前記変換モデルにおける設定情報を変更しながら、算出される類似度が相対的に高い変換モデルを選択する、
請求項3に記載の問合せ文出力装置。
It also has a second conversion unit that converts the query statement into an execution plan.
The generation unit generates the conversion model, acquires an inquiry statement by inputting the execution plan specified by the specific unit to the conversion model, and inputs the inquiry statement to the second conversion unit. By doing so, the execution plan corresponding to the query statement is acquired, the similarity between the execution plan specified by the specific unit and the execution plan corresponding to the conversion model is calculated, and the setting information in the conversion model is calculated. Select a transformation model with a relatively high degree of similarity calculated while changing
The inquiry text output device according to claim 3.
問合せ文を実行計画に変換する第2変換部をさらに備え、
前記生成部は、問合せ文を前記第2変換部に入力することにより、当該問合せ文に対応する実行計画を取得し、取得した当該実行計画を前記変換モデルに対して入力することにより問合せ文を取得し、前記第2変換部に入力された問合せ文と、前記変換モデルから取得した問合せ文との類似度を算出し、前記変換モデルにおける設定情報を変更しながら、算出される当該類似度が相対的に高い変換モデルを選択する、
請求項に記載の問合せ文出力装置。
It also has a second conversion unit that converts the query statement into an execution plan.
The generation unit acquires an execution plan corresponding to the inquiry statement by inputting the inquiry statement into the second conversion unit, and inputs the acquired execution plan to the conversion model to input the inquiry statement. The similarity between the query statement acquired and input to the second conversion unit and the query statement acquired from the conversion model is calculated, and the similarity is calculated while changing the setting information in the conversion model. Choose a relatively high transformation model,
The inquiry text output device according to claim 3.
前記第2変換部は、前記データベースシステムに、問合せ文に対応する実行計画を生成させることにより、当該問合せ文を実行計画に変換する、
請求項4又は5に記載の問合せ文出力装置。
The second conversion unit converts the query statement into an execution plan by causing the database system to generate an execution plan corresponding to the query statement.
The inquiry text output device according to claim 4 or 5.
前記特定部は、データベースシステムにおいて実行された、実行コストが相対的に高い複数の実行計画を特定する、
請求項1から6のいずれか1項に記載の問合せ文出力装置。
The identification unit identifies a plurality of execution plans executed in the database system, which have relatively high execution costs.
The inquiry text output device according to any one of claims 1 to 6.
コンピュータが実行する、
データベースシステムにおいて実行された、複数の実行計画を特定するステップと、
特定された複数の前記実行計画を、当該実行計画に含まれる文字列の並びと、当該実行計画に対応する前記データベースシステムにおける問合せ文に含まれる文字列の並びとの関連性に基づいて前記問合せ文に変換するとともに、当該実行計画の一部である部分実行計画を前記問合せ文に変換するステップと、
前記実行計画から変換された問合せ文を出力するステップと、
を備える問合せ文出力方法。
Computer runs,
Steps to identify multiple execution plans performed in the database system,
The query for the specified plurality of execution plans is based on the relationship between the sequence of character strings included in the execution plan and the sequence of character strings included in the query statement in the database system corresponding to the execution plan. A step of converting a partial execution plan that is a part of the execution plan into the query statement while converting it into a statement.
A step to output the query statement converted from the execution plan, and
Query statement output method.
JP2018136623A 2018-07-20 2018-07-20 Inquiry statement output device and inquiry statement output method Active JP6971929B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018136623A JP6971929B2 (en) 2018-07-20 2018-07-20 Inquiry statement output device and inquiry statement output method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018136623A JP6971929B2 (en) 2018-07-20 2018-07-20 Inquiry statement output device and inquiry statement output method

Publications (2)

Publication Number Publication Date
JP2020013448A JP2020013448A (en) 2020-01-23
JP6971929B2 true JP6971929B2 (en) 2021-11-24

Family

ID=69170177

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018136623A Active JP6971929B2 (en) 2018-07-20 2018-07-20 Inquiry statement output device and inquiry statement output method

Country Status (1)

Country Link
JP (1) JP6971929B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2022029863A (en) * 2020-08-05 2022-02-18 日本電信電話株式会社 Optimization device, optimization method and optimization program
JP7716243B2 (en) * 2021-06-18 2025-07-31 株式会社日立製作所 Reflection generation system, reflection generation method, and reflection generation program

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011191949A (en) * 2010-03-12 2011-09-29 Hitachi Information Systems Ltd System and program for analyzing performance
JP5800720B2 (en) * 2012-01-24 2015-10-28 三菱電機株式会社 Information processing apparatus, information processing method, and program
JP6376947B2 (en) * 2014-11-06 2018-08-22 Kddi株式会社 Virtual database system management apparatus, management method, and management program
JP6737734B2 (en) * 2017-04-11 2020-08-12 Kddi株式会社 Query sentence search device, query sentence search method, and query sentence search program
JP6898215B2 (en) * 2017-12-13 2021-07-07 Kddi株式会社 Database management device, database management method and database management program

Also Published As

Publication number Publication date
JP2020013448A (en) 2020-01-23

Similar Documents

Publication Publication Date Title
CN110543517B (en) Method, device and medium for realizing complex query of mass data based on elastic search
US6996567B2 (en) Automatic generation of join graphs for relational database queries
US5808615A (en) Process and system for mapping the relationship of the content of a collection of documents
US20040158567A1 (en) Constraint driven schema association
CN114328823B (en) Database natural language query method and device, electronic device, and storage medium
CN109240901A (en) Method for analyzing performance, performance evaluation device, storage medium and electronic equipment
KR20160124079A (en) Systems and methods for in-memory database search
JP2007534087A (en) Partial query caching
JP7081137B2 (en) Query generator, query generator and query generator
Koehler et al. Data context informed data wrangling
JP2002099561A (en) Data conversion method, data conversion system, and storage medium
CN116244333B (en) Database query performance prediction method and system based on cost factor calibration
JP6971929B2 (en) Inquiry statement output device and inquiry statement output method
Li et al. Schema-free SQL
JP5634374B2 (en) Specification creation support device and program
CN108733745A (en) A kind of enquiry expanding method based on medical knowledge
JPWO2013111287A1 (en) SPARQL query optimization method
CN116383247B (en) Large-scale graph data efficient query method
JP6737734B2 (en) Query sentence search device, query sentence search method, and query sentence search program
CN120523827B (en) Multi-iteration-based retrieval enhancement mode linking method and device
CN107992324A (en) A kind of code search method based on constraint solving
CN105069174A (en) Configurable A+B mode record navigation method
CN105930162B (en) A feature localization method based on subgraph search
CN119961290A (en) Data query method and device, storage medium, and electronic device
JP5600826B1 (en) Unstructured data processing system, unstructured data processing method and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20200626

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20210525

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210527

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20210528

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20211026

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20211102

R150 Certificate of patent or registration of utility model

Ref document number: 6971929

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150