JP2020013448A - Inquiry sentence output apparatus and inquiry sentence output method - Google Patents

Inquiry sentence output apparatus and inquiry sentence output method Download PDF

Info

Publication number
JP2020013448A
JP2020013448A JP2018136623A JP2018136623A JP2020013448A JP 2020013448 A JP2020013448 A JP 2020013448A JP 2018136623 A JP2018136623 A JP 2018136623A JP 2018136623 A JP2018136623 A JP 2018136623A JP 2020013448 A JP2020013448 A JP 2020013448A
Authority
JP
Japan
Prior art keywords
query
execution plan
unit
execution
conversion
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.)
Granted
Application number
JP2018136623A
Other languages
Japanese (ja)
Other versions
JP6971929B2 (en
Inventor
茂莉 黒川
Mori Kurokawa
茂莉 黒川
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)

Abstract

To enable identifying a common process in a plurality of execution plans.SOLUTION: An inquiry sentence output apparatus 1 comprises: an identification unit 121 that identifies a plurality of execution plans executed in a database system 2; a first conversion unit 124 that converts the plurality of execution plans identified by the identification unit 121 on the basis of a relationship between a sequence of character strings included in the execution plans and a sequence of character strings included in an inquiry sentence in a database system 2 corresponding to the execution plan, and that converts a partial execution plan being a part of the execution plan to the inquiry sentence; and an output unit 125 that outputs the inquiry sentence converted by the first conversion unit 124.SELECTED DRAWING: Figure 2

Description

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

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

特開2006−343798号公報JP 2006-343798 A

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

そこで、本発明はこれらの点に鑑みてなされたものであり、複数の実行計画において共通する処理を特定することを可能にする問合せ文出力装置及び問合せ文出力方法を提供することを目的とする。   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 can specify a process common to a plurality of execution plans. .

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

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

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

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

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

前記第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 identification unit may identify a plurality of execution plans executed in the database system, the execution plans of which are relatively high.

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

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

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

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

問合せ文出力装置1は、データベースシステム2と、LAN(Local Area Network)やインターネット等の通信ネットワークを介して通信可能に接続されている。問合せ文出力装置1は、データベースシステム2において実行された問合せ文に対応する実行計画をデータベースシステム2から取得する(図1の(1))。   The query 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 sentence output device 1 acquires an execution plan corresponding to the query sentence 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 a conversion model that converts the execution plan into a query statement ((2) in FIG. 1). The query statement output device 1 regards a query statement having a high degree of similarity to another query statement among the 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 for the same query statement, the query statement output device 1 can convert a plurality of execution plans including the different descriptions into the same query statement and output the same. . Thereby, the user of the query output device 1 can specify a process common to these execution plans as compared with a case where only a plurality of execution plans are referred to.
Hereinafter, the configuration of the query output device 1 will be described.

[問合せ文出力装置1の構成例]
図2は、第1実施形態に係る問合せ文出力装置1の構成を示す図である。
問合せ文出力装置1は、記憶部11と、制御部12とを備える。
[Configuration Example of Query Statement Output Device 1]
FIG. 2 is a diagram illustrating a configuration of the inquiry sentence output device 1 according to the first embodiment.
The query 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) and a RAM (Random Access Memory). The storage unit 11 stores various programs for causing the query output device 1 to function. The storage unit 11 stores a query output program that causes the control unit 12 of the query output device 1 to function as a specification 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. The storage unit 11 stores a conversion model M generated by the generation unit 122, which is a program for converting an execution plan into a query sentence.

制御部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 functions related to the query output device 1 by executing various programs stored in the storage unit 11. The control unit 12 functions as the specifying unit 121, the generation unit 122, the second conversion unit 123, the first conversion unit 124, and the output unit 125 by executing the query output program. The control unit 12 converts the execution plan into a query by executing the conversion model M.

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

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

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

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

特定部121は、抽出された実行計画ツリーを、ルートとなるノードから行きがけ順及び帰りがけ順に走査することにより実行計画文字列を生成する。すなわち、特定部121は、実行計画ツリーを、ルートとなるノードから行きがけ順及び帰りがけ順に走査したときに検出されたノードの略称を、検出された順番で並べた文字列を実行計画文字列として生成する。   The identifying unit 121 generates an execution plan character string by scanning the extracted execution plan tree from the root node in the preorder and return order. In other words, the identification 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 preorder order and the return order are arranged in the detected order as an execution plan character string. I do.

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

特定部121は、実行計画ツリーを行きがけ順に走査する際、各ノードで検出されたカラム名称と対応するテーブル名称を記憶することによりカラム名称のリストを作成する。そして、特定部121は、当該テーブル名称に関するScanノードが検出された際、当該テーブルに対応付けられたカラム名称のリストを関連付ける。
また、特定部121は、当該Scanノードにおいて参照されるテーブルのフィルタ条件を関連付ける。
When scanning the execution plan tree in the destination order, the identification unit 121 creates a list of column names by storing the table names corresponding to the column names detected at each node. Then, when a Scan node related to the table name is detected, the specifying unit 121 associates a list of column names associated with the table.
Further, the specifying unit 121 associates a filter condition of a 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 specifying unit 121 generates an execution plan character string for each of the specified plurality of execution plans. In addition, the specification 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.

具体的には、特定部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 specifying unit 121 extracts, from the execution plan tree, a node group below “Nested Loop” or “Hash Join” indicating a join of a plurality of tables as a partial execution plan. Then, the specifying unit 121 generates an execution plan character string for the extracted partial execution plan. When creating the execution plan character string, the identification unit 121 inserts or replaces the table name or the like of the reference destination with respect to the abbreviation of the Scan node, thereby converting the character string of the reference table name or the like into the execution plan character string. You may take in. For example, the specification unit 121 may replace parentheses, commas, and the like with blanks (spaces) when incorporating a character string such as a table name of a reference destination into an execution plan character string. For example, in the case of the 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 to 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 sentence. Specifically, when an execution plan character string indicating an execution plan is input, the generation unit 122 generates a conversion model M that outputs a query sentence corresponding to the execution plan character string. For example, the generation unit 122 generates the 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 trains the model.

教師データは、入力される記号列と、出力される記号列との組み合わせである。入力される記号列は、特定部121が特定した実行計画から生成した実行計画文字列であり、出力される記号列は、当該実行計画に関連付けられている問合せ文である。   The teacher data is a combination of an input symbol string and an output symbol string. The input symbol string is an execution plan character string generated from the execution plan specified by the specifying unit 121, and the output symbol string is a query sentence 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 sentence by inputting the execution plan specified by the specification unit 121 to the conversion model M. Then, the generation unit 122 acquires the execution plan corresponding to the query sentence by inputting the query sentence to 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 sentence into an execution plan. The second conversion unit 123 inputs a query sentence to the database system 2 and causes the database system 2 to generate an execution plan corresponding to the query sentence. 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 a similarity between the one or more execution plans identified by the identification unit 121 and the one or more execution plans converted from the query sentence output from the conversion model M. For example, the generation unit 122 calculates the Levenshtein distance between the execution plan specified by the specification unit 121 and the execution plan converted from the query sentence output from the conversion model M. Here, the Levenshtein distance indicates the number of edits required to convert a character string into a character string to be compared. If the number of edits is 0, the character string matches the character string to be compared. It indicates that In addition, the smaller the value of the Levenshtein distance, the higher the similarity between the character string and the character string to be compared. The generation unit 122 calculates the similarity so that the smaller the calculated Levenshtein distance is, the larger the similarity becomes.

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

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

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

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

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

図8は、変換モデルMの他の選択例を示す図である。図8に示す例では、図7に示す例と同様に、生成部122が、異なる設定情報により設定された複数の変換モデルを生成する。図8に示す例では、設定情報Aにより設定された変換モデルM1と、設定情報Bにより設定された変換モデルM2とが生成されている。   FIG. 8 is a diagram illustrating another example of selection of the conversion model M. In the example illustrated in FIG. 8, similarly to the example illustrated in FIG. 7, the generation unit 122 generates a plurality of conversion models set based on different setting information. In the example shown in FIG. 8, a conversion model M1 set by the setting information A and a 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 causes the second conversion unit 123 to convert the query sentence from which one or more execution plans identified by the identification unit 121 have been generated into an execution plan. Then, the generation unit 122 inputs the converted execution plan to each of the generated plurality of conversion models, and converts the execution plan into a query sentence. Then, as illustrated in FIG. 8, the generation unit 122 includes at least one query sentence 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, which is the average of the similarity with the sentence, is calculated, and the conversion model having the highest average similarity is selected. By doing so, the query sentence output device 1 can generate the conversion model M with high conversion accuracy as in the example shown in FIG.

[問合せ文の出力]
第1変換部124は、特定部121により特定された複数の実行計画を、当該実行計画に含まれる文字列の並びと、当該実行計画に対応するデータベースシステム2における問合せ文に含まれる文字列の並びとの関連性に基づいて、データベースシステム2における問合せ文に変換するとともに、特定部121により特定された、当該実行計画の一部である部分実行計画を問合せ文に変換する。なお、第1変換部124は、問合せ文に含まれるテーブル名称に対して、部分実行計画に含まれるテーブル名称に関連付けられたカラム名称やフィルタ条件のうち問合せ文に含まれないものを、不足した情報として問合せ文に追加しても構わない。
[Output of query statement]
The first conversion unit 124 converts the plurality of execution plans identified by the identification unit 121 into a list 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 relevance to the arrangement, it is converted into a query sentence in the database system 2 and the partial execution plan specified by the specifying unit 121 and being a part of the execution plan is converted into a query sentence. For the table names included in the query statement, the first conversion unit 124 ran out of column names and filter conditions associated with the table names included in the partial execution plan that were not included in the query statement. It may be added to the inquiry sentence 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 to the conversion model M, and acquires a query sentence output from the conversion model M, thereby Each execution plan is converted into a query statement. Similarly, the first conversion unit 124 inputs an execution plan character string corresponding to each of the plurality of partial execution plans to the conversion model M, and acquires a query sentence output from the conversion model M, thereby obtaining a plurality of query statements. Transform each of the partial execution plans into query statements.

なお、第1変換部124が変換モデルMに入力する実行計画及び部分実行計画は、変換モデルMの生成に用いられた実行計画及び部分実行計画と異なっていてもよい。この場合、特定部121は、生成部122が変換モデルMを生成した後に、新たに実行計画及び部分実行計画を特定してもよい。そして、第1変換部124は、新たに特定された実行計画及び部分実行計画に対応する実行計画文字列を変換モデルMに入力し、これらの実行計画を問合せ文に変換してもよい。   Note that the execution plan and the partial execution plan input to the conversion model M by the first conversion unit 124 may be different from the execution plan and the partial execution plan used for generating 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 an execution plan character string corresponding to the newly specified execution plan and partial execution plan to the conversion model M, and convert these execution plans into a query sentence.

出力部125は、第1変換部124により変換された問合せ文を出力する。具体的には、出力部125は、第1変換部124により変換された複数の問合せ文のうち、他の問合せ文と類似度が高い問合せ文を、問合せ文出力装置1に設けられた表示部(非表示)に出力したり、テキストファイルに出力して当該テキストファイルを記憶部11に記憶させたりする。また、出力部125は、問合せ文出力装置1と通信可能に接続されている管理端末(不図示)に出力してもよい。   The output unit 125 outputs the query sentence converted by the first conversion unit 124. Specifically, the output unit 125 outputs a query sentence having a high similarity to another query sentence among the plurality of query sentences converted by the first conversion unit 124 to a display unit provided in the query sentence output device 1. (Non-display) or output to a text file and store the text file in the storage unit 11. Further, the output unit 125 may output to a management terminal (not shown) communicably connected to the inquiry sentence 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 another query statement that has been similarly converted, and if there is a query statement with the same character string, performs name matching. The appearance frequency is calculated based on the number of the query sentence that has been identified. Then, the output unit 125 outputs the query sentence having a high appearance frequency as a query sentence for which a process highly likely to be suitable for creating the materialized view is executed.

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

[問合せ文出力装置1における処理の流れ]
続いて、問合せ文出力装置1における処理の流れについて説明する。図9は、本実施形態に係る問合せ文出力装置1における処理の流れを示すフローチャートである。
[Processing flow in query output device 1]
Next, the flow of processing in the query output device 1 will be described. FIG. 9 is a flowchart illustrating a flow of processing in the inquiry sentence 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 specifies a partial execution plan included in the execution plan (S1).
Subsequently, the generation unit 122 generates a conversion model M based on the execution plan specified in S1 (S2). Note that the generation unit 122 may determine whether the conversion model M has already been generated. Then, when determining that the conversion model M has already been generated, the generation unit 122 may not generate the conversion model M.

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

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

[本実施形態における効果]
以上の通り、本実施形態に係る問合せ文出力装置1は、データベースシステム2において実行された、複数の実行計画をデータベースシステムにおける問合せ文に変換するとともに、当該実行計画の一部である部分実行計画を問合せ文に変換し、変換された問合せ文を出力する。このようにすることで、問合せ文出力装置1のユーザは、複数の実行計画のみを参照する場合に比べて、これらの実行計画において共通する処理を特定することができる。
[Effects in the present 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 also executes a partial execution plan which is a part of the execution plan. Is converted to a query sentence, and the converted query sentence is output. In this way, the user of the query output device 1 can specify a process common to these execution plans as compared to a case where only a plurality of execution plans are referred to.

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

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

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

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

DESCRIPTION OF SYMBOLS 1 ... Inquiry sentence output device, 11 ... Storage part, 12 ... Control part, 121 ... Identification part, 122 ... Generation part, 123 ... Second conversion part, 124 ... 1st conversion unit, 125 ... output unit, 2 ... database system

Claims (8)

データベースシステムにおいて実行された、複数の実行計画を特定する特定部と、
前記特定部により特定された複数の前記実行計画を、当該実行計画に含まれる文字列の並びと、当該実行計画に対応する前記データベースシステムにおける問合せ文に含まれる文字列の並びとの関連性に基づいて前記問合せ文に変換するとともに、当該実行計画の一部である部分実行計画を前記問合せ文に変換する第1変換部と、
前記第1変換部により変換された問合せ文を出力する出力部と、
を備える問合せ文出力装置。
A specifying unit that specifies a plurality of execution plans executed in the database system;
The plurality of execution plans identified by the identification unit are associated with a sequence of character strings included in the execution plan and a relationship between the sequence of character strings included in a query sentence in the database system corresponding to the execution plan. A first conversion unit that converts the partial execution plan that is a part of the execution plan into the query statement,
An output unit that outputs the query sentence converted by the first conversion unit;
A query output device comprising:
前記出力部は、前記第1変換部により変換された複数の問合せ文のうち、他の問合せ文と類似度が高い問合せ文を出力する、
請求項1に記載の問合せ文出力装置。
The output unit outputs a query sentence having a high degree of similarity to another query sentence among a plurality of query sentences converted by the first conversion unit.
The query sentence output device according to claim 1.
前記実行計画を問合せ文に変換する変換モデルを生成する生成部をさらに備え、
前記第1変換部は、複数の前記実行計画のそれぞれを前記変換モデルに入力し、前記変換モデルから出力される前記問合せ文を取得することにより、複数の実行計画のそれぞれを問合せ文に変換するとともに、複数の前記部分実行計画のそれぞれを前記変換モデルに入力し、前記変換モデルから出力される前記問合せ文を取得することにより、複数の前記部分実行計画のそれぞれを問合せ文に変換する、
請求項1又は2に記載の問合せ文出力装置。
A generating unit that generates a conversion model that converts the execution plan into a query sentence,
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 to the conversion model and acquiring the query statement output from the conversion model. With, each of the plurality of partial execution plans is input to the conversion model, and by acquiring the query sentence output from the conversion model, each of the plurality of partial execution plans is converted into a query sentence,
The query sentence output device according to claim 1.
問合せ文を実行計画に変換する第2変換部をさらに備え、
前記生成部は、前記変換モデルを生成し、当該変換モデルに対して前記特定部により特定された前記実行計画を入力することにより問合せ文を取得し、当該問合せ文を前記第2変換部に入力することにより、当該問合せ文に対応する実行計画を取得し、前記特定部により特定された前記実行計画と、当該変換モデルに対応する実行計画との類似度を算出し、前記変換モデルにおける設定情報を変更しながら、算出される類似度が相対的に高い変換モデルを選択する、
請求項3に記載の問合せ文出力装置。
A second conversion unit that converts the query statement into an execution plan;
The generating unit generates the conversion model, obtains a query by inputting the execution plan specified by the specifying unit for the conversion model, and inputs the query to the second conversion unit. Thereby obtaining an execution plan corresponding to the query sentence, calculating a similarity between the execution plan specified by the specifying unit and an execution plan corresponding to the conversion model, and setting information in the conversion model. While selecting a conversion model having a relatively high calculated similarity,
The query output device according to claim 3.
問合せ文を実行計画に変換する第2変換部をさらに備え、
前記生成部は、問合せ文を前記第2変換部に入力することにより、当該問合せ文に対応する実行計画を取得し、取得した当該実行計画を前記変換モデルに対して入力することにより問合せ文を取得し、前記第2変換部に入力された問合せ文と、前記変換モデルから取得した問合せ文との類似度を算出し、前記変換モデルにおける設定情報を変更しながら、算出される当該類似度が相対的に高い変換モデルを選択する、
請求項3又は4に記載の問合せ文出力装置。
A second conversion unit that converts the query statement into an execution plan;
The generation unit obtains an execution plan corresponding to the query sentence by inputting the query sentence to the second conversion unit, and inputs the obtained execution plan to the conversion model to generate the query sentence. Calculating the similarity between the query sentence obtained and input to the second conversion unit and the query sentence obtained from the conversion model, and calculating the similarity while changing the setting information in the conversion model. Select a relatively high conversion model,
The query 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 query output device according to claim 4.
前記特定部は、データベースシステムにおいて実行された、実行コストが相対的に高い複数の実行計画を特定する、
請求項1から6のいずれか1項に記載の問合せ文出力装置。
The identification unit, executed in the database system, to specify a plurality of execution plans having relatively high execution costs,
The query output device according to any one of claims 1 to 6.
コンピュータが実行する、
データベースシステムにおいて実行された、複数の実行計画を特定するステップと、
特定された複数の前記実行計画を、当該実行計画に含まれる文字列の並びと、当該実行計画に対応する前記データベースシステムにおける問合せ文に含まれる文字列の並びとの関連性に基づいて前記問合せ文に変換するとともに、当該実行計画の一部である部分実行計画を前記問合せ文に変換するステップと、
前記実行計画から変換された問合せ文を出力するステップと、
を備える問合せ文出力方法。

Computer runs,
Identifying a plurality of execution plans executed in the database system;
The plurality of identified execution plans are queried based on a relevance between a sequence of character strings included in the execution plan and a sequence of character strings included in a query statement in the database system corresponding to the execution plan. And converting the partial execution plan that is a part of the execution plan into the query statement.
Outputting a query sentence converted from the execution plan;
A query sentence output method comprising:

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 true JP2020013448A (en) 2020-01-23
JP6971929B2 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)

Cited By (1)

* 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

Citations (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
JP2013152512A (en) * 2012-01-24 2013-08-08 Mitsubishi Electric Corp Information processing device, information processing method and program
JP2016091356A (en) * 2014-11-06 2016-05-23 Kddi株式会社 Virtual database system management device, management method and management program
JP2018180847A (en) * 2017-04-11 2018-11-15 Kddi株式会社 Inquiry text search device, inquiry text search method, and inquiry text search program
JP2019106039A (en) * 2017-12-13 2019-06-27 Kddi株式会社 Database management device, database management method, and database management program

Patent Citations (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
JP2013152512A (en) * 2012-01-24 2013-08-08 Mitsubishi Electric Corp Information processing device, information processing method and program
JP2016091356A (en) * 2014-11-06 2016-05-23 Kddi株式会社 Virtual database system management device, management method and management program
JP2018180847A (en) * 2017-04-11 2018-11-15 Kddi株式会社 Inquiry text search device, inquiry text search method, and inquiry text search program
JP2019106039A (en) * 2017-12-13 2019-06-27 Kddi株式会社 Database management device, database management method, and database management program

Cited By (1)

* 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

Also Published As

Publication number Publication date
JP6971929B2 (en) 2021-11-24

Similar Documents

Publication Publication Date Title
CN110543517B (en) Method, device and medium for realizing complex query of mass data based on elastic search
KR101525529B1 (en) data processing apparatus and data mapping method thereof
CN109240901B (en) Performance analysis method, performance analysis device, storage medium, and electronic apparatus
US20040158567A1 (en) Constraint driven schema association
CN106874426B (en) RDF (resource description framework) streaming data keyword real-time searching method based on Storm
JP2005521954A (en) Method and apparatus for querying a relational database
CN104965735A (en) Apparatus for generating upgrade SQL script
CN105630881A (en) Data storage method and query method for RDF (Resource Description Framework)
US20110302187A1 (en) Schema definition generating device and schema definition generating method
CN104573039A (en) Keyword search method of relational database
US11269880B2 (en) Retroreflective clustered join graph generation for relational database queries
CN104699698A (en) Graph query processing method based on massive data
JP2002099561A (en) Method and system for data conversion, and storage medium
Wang et al. Cleanix: A parallel big data cleaning system
CN110019384A (en) A kind of acquisition methods of blood relationship data provide the method and device of blood relationship data
WO2018059430A1 (en) Database searching
WO2013111287A1 (en) Sparql query optimization method
JP6737734B2 (en) Query sentence search device, query sentence search method, and query sentence search program
JP5634374B2 (en) Specification creation support device and program
JP6971929B2 (en) Inquiry statement output device and inquiry statement output method
JP3630062B2 (en) Semi-structured document search method and apparatus, and storage medium storing semi-structured document search program
Matuszka et al. Geodint: towards semantic web-based geographic data integration
CN116383247A (en) Large-scale graph data efficient query method
Rossel et al. A Big Data Modeling Methodology for NoSQL Document Databases.
JP7022712B2 (en) Query recommendation device and query recommendation method

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 Request for written amendment filed

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