JP6737734B2 - Query sentence search device, query sentence search method, and query sentence search program - Google Patents

Query sentence search device, query sentence search method, and query sentence search program Download PDF

Info

Publication number
JP6737734B2
JP6737734B2 JP2017078215A JP2017078215A JP6737734B2 JP 6737734 B2 JP6737734 B2 JP 6737734B2 JP 2017078215 A JP2017078215 A JP 2017078215A JP 2017078215 A JP2017078215 A JP 2017078215A JP 6737734 B2 JP6737734 B2 JP 6737734B2
Authority
JP
Japan
Prior art keywords
search
character string
query
execution plan
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.)
Expired - Fee Related
Application number
JP2017078215A
Other languages
Japanese (ja)
Other versions
JP2018180847A (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 JP2017078215A priority Critical patent/JP6737734B2/en
Publication of JP2018180847A publication Critical patent/JP2018180847A/en
Application granted granted Critical
Publication of JP6737734B2 publication Critical patent/JP6737734B2/en
Expired - Fee Related 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 sentence search device, a query sentence search method, and a query sentence search program that search for a query sentence that can be executed in a database system.

従来、データベースシステムにおいて実行可能なSQL(Structured Query Language)等の問合せ文の履歴の中から、特定の問合せ文と問合せの内容が一致又は類似する問合せ文を検索することが行われている。特定の問合せ文に一致又は類似する問合せ文を検索する方法としては、問合せ文を文字列として扱い、文字列の類似度を測る方法がある。そして、文字列の類似度を測定する方法として、レーベンシュタイン距離を用いる方法が従来から提案されている(例えば、特許文献1参照)。レーベンシュタイン距離は、文字列を比較対象の文字列に変換する場合に要する編集の回数を示しており、0回であれば、文字列と、比較対象の文字列とが一致していることを示している。また、レーベンシュタイン距離の値が小さければ小さいほど、文字列と、比較対象の文字列との類似度が高いことを示している。 2. Description of the Related Art Conventionally, a query statement such as SQL (Structured Query Language) that can be executed in a database system is searched for a query statement in which the content of the query matches or is similar to a specific query statement. As a method for retrieving a query text that matches or is similar to a specific query text, there is a method of treating the query text as a character string and measuring the similarity of the character string. A method using the Levenshtein distance has been conventionally proposed as a method for measuring the similarity between character strings (see, for example, Patent Document 1). The Levenshtein distance indicates the number of edits required to convert a character string into a character string to be compared, and if it is 0, it means that the character string and the character string to be compared match. Showing. Also, the smaller the value of the Levenshtein distance, the higher the similarity between the character string and the character string to be compared.

特開2015−76064号公報JP, 2005-76064, A

しかしながら、データベースシステムにおいて実行可能な問合せ文であるSQLは、書式の自由度が高いことから、同じ内容の問合せ文であっても複数の表現方法がある。このため、文字列の類似度によって、特定の問合せ文と、問合せの内容が一致又は類似する問合せ文を正確に検索することができないという問題がある。 However, since SQL, which is a query statement that can be executed in a database system, has a high degree of freedom in format, there are multiple expression methods even for query statements having the same content. For this reason, there is a problem in that it is not possible to accurately search for a query text in which the content of the query matches or is similar to the specific query text, depending on the similarity of the character strings.

また、問合せ文では、データベースシステムにおける複数のテーブルの結合を指定する構文が含まれることがある。しかしながら、問合せ文の全体を1つの文字列として扱う場合には、問合せ文の構造を考慮した検索を行うことができない。このため、問合せ文を示す文字列の類似度を測ることによって検索を行う方法では、所定のテーブルの結合処理を含む問合せ文といった、問合せ文の一部に着目した検索を行うことができないという問題がある。 Further, the query statement may include a syntax that specifies a join of a plurality of tables in the database system. However, when the entire query text is treated as one character string, it is not possible to perform a search considering the structure of the query text. Therefore, in the method of performing a search by measuring the degree of similarity of a character string indicating a query sentence, it is not possible to perform a search focusing on a part of the query sentence, such as a query sentence including a join process of predetermined tables. There is.

そこで、本発明はこれらの点に鑑みてなされたものであり、データベースシステムにおいて実行可能な問合せ文と類似する問合せ文を精度良く検索することができる問合せ文検索装置、問合せ文検索方法及び問合せ文検索プログラムを提供することを目的とする。 Therefore, the present invention has been made in view of these points, and a query statement search device, a query statement search method, and a query statement that can accurately search a query statement similar to a query statement that can be executed in a database system. The purpose is to provide a search program.

本発明の第1の態様に係る問合せ文検索装置は、データベースシステムにおいて実行可能な問合せ文を示す検索文の入力を受け付ける入力受付部と、前記データベースシステムにおいて実行された複数の問合せ文と、当該複数の問合せ文のそれぞれに対応する前記問合せ文の実行計画とを関連付けて記憶する記憶部を参照し、前記検索文に対応する実行計画と少なくとも一部が一致する実行計画を特定する特定部と、特定された実行計画に関連付けて前記記憶部に記憶されている問合せ文を検索結果として出力する出力部と、を備える。 An inquiry statement search device according to a first aspect of the present invention includes an input acceptance unit that accepts an input of a search statement indicating an inquiry statement that can be executed in a database system, a plurality of inquiry statements executed in the database system, A specifying unit that refers to a storage unit that stores an execution plan of the query statement that corresponds to each of a plurality of query statements in association with each other, and specifies an execution plan that at least partially matches the execution plan that corresponds to the search statement. And an output unit that outputs the query statement stored in the storage unit in association with the specified execution plan as a search result.

前記問合せ文検索装置は、前記記憶部に記憶されている前記実行計画に基づいて、当該実行計画に対応する問合せ文の構造を抽出し、抽出された当該構造と、当該問合せ文において参照するテーブルとを示す検索用文字列を生成する文字列生成部と、前記検索用文字列と、当該検索用文字列に対応する問合せ文とを関連付けて前記記憶部に記憶させる記憶制御部をさらに備え、前記入力受付部は、前記検索文として前記検索用文字列を受け付け、前記特定部は、前記記憶部を参照し、受け付けた前記検索文と少なくとも一部が一致する前記検索用文字列を特定し、前記出力部は、特定された検索用文字列に関連付けて前記記憶部に記憶されている問合せ文を検索結果として出力してもよい。 The inquiry statement search device extracts a structure of an inquiry statement corresponding to the execution plan based on the execution plan stored in the storage unit, and the extracted structure and a table referred to in the inquiry statement. And a storage control unit that stores the search character string in the storage unit in association with the search character string and a query sentence corresponding to the search character string. The input receiving unit receives the search character string as the search sentence, and the identifying unit refers to the storage unit and identifies the search character string that at least partially matches the received search sentence. The output unit may output the inquiry sentence stored in the storage unit in association with the specified search character string as a search result.

前記文字列生成部は、前記記憶部に記憶されている前記実行計画に基づいて、当該実行計画に対応する問合せ文の木構造を抽出し、抽出された当該木構造を、ルートとなるノードから行きがけ順及び帰りがけ順に走査することにより木構造を示す前記検索用文字列を生成してもよい。 The character string generation unit extracts a tree structure of a query statement corresponding to the execution plan based on the execution plan stored in the storage unit, and extracts the extracted tree structure from a root node. The search character string indicating the tree structure may be generated by scanning the order of travel and the order of return.

前記入力受付部は、前記検索文として前記問合せ文の入力を受け付け、前記問合せ文検索装置は、入力された前記問合せ文を前記検索用文字列に変換する変換部をさらに備え、前記特定部は、前記記憶部を参照し、変換された検索用文字列と少なくとも一部が一致する前記検索用文字列を特定してもよい。 The input receiving unit receives an input of the inquiry sentence as the search sentence, the inquiry sentence search device further comprises a conversion unit for converting the input inquiry sentence into the search character string, the specifying unit, The storage character string may be referenced to identify the search character string that at least partially matches the converted search character string.

本発明の第2の態様に係る問合せ文検索方法は、コンピュータが実行する、データベースシステムにおいて実行可能な問合せ文を示す検索文の入力を受け付けるステップと、前記データベースシステムにおいて実行された複数の問合せ文と、当該複数の問合せ文のそれぞれに対応する前記問合せ文の実行計画とを関連付けて記憶する記憶部を参照し、前記検索文に対応する実行計画と少なくとも一部が一致する実行計画を特定するステップと、特定された実行計画に関連付けて前記記憶部に記憶されている問合せ文を検索結果として出力するステップと、を備える。 A query statement search method according to a second aspect of the present invention includes a step of accepting an input of a search statement that is executed by a computer and that indicates a query statement that can be executed in a database system, and a plurality of query statements executed in the database system. And an execution plan of the query statement corresponding to each of the plurality of query statements are stored in association with each other, and an execution plan at least partially matching the execution plan corresponding to the search statement is specified. And a step of outputting the inquiry statement stored in the storage unit in association with the specified execution plan as a search result.

本発明の第3の態様に係る問合せ文検索プログラムは、コンピュータを、データベースシステムにおいて実行可能な問合せ文を示す検索文の入力を受け付ける入力受付部、前記データベースシステムにおいて実行された複数の問合せ文と、当該複数の問合せ文のそれぞれに対応する前記問合せ文の実行計画とを関連付けて記憶する記憶部を参照し、前記検索文に対応する実行計画と少なくとも一部が一致する実行計画を特定する特定部、及び、特定された実行計画に関連付けて前記記憶部に記憶されている問合せ文を検索結果として出力する出力部、として機能させる。 A query statement search program according to a third aspect of the present invention includes a computer, an input accepting unit that accepts an input of a search statement indicating a query statement that can be executed in a database system, and a plurality of query statements executed in the database system. Specifying a execution plan that at least partially matches the execution plan corresponding to the search statement by referring to a storage unit that associates and stores the execution plan of the query statement corresponding to each of the plurality of query statements And an output unit that outputs the query statement stored in the storage unit in association with the specified execution plan as a search result.

本発明によれば、データベースシステムにおいて実行可能な問合せ文と類似する問合せ文を精度良く検索することができるという効果を奏する。 According to the present invention, there is an effect that a query sentence similar to a query sentence that can be executed in a database system can be accurately searched.

第1実施形態に係る問合せ文検索システムの概要を示す図である。It is a figure which shows the outline of the inquiry sentence search system which concerns on 1st Embodiment. 第1実施形態に係る問合せ文検索装置の構成を示す図である。It is a figure which shows the structure of the inquiry sentence search device which concerns on 1st Embodiment. 第1実施形態に係る問合せ履歴情報の一例を示す図である。It is a figure which shows an example of the inquiry history information which concerns on 1st Embodiment. 問合せ文の一例(その1)を示す図である。It is a figure which shows an example (the 1) of an inquiry sentence. 問合せ文の一例(その2)を示す図である。It is a figure which shows an example (the 2) of an inquiry sentence. 問合せ文の一例(その3)を示す図である。It is a figure which shows an example (the 3) of an inquiry sentence. 問合せ文の一例(その4)を示す図である。It is a figure which shows an example (the 4) of an inquiry sentence. 図4Aに示す問合せ文に対応する実行計画を示す図である。It is a figure which shows the execution plan corresponding to the inquiry sentence shown to FIG. 4A. 図4Bに示す問合せ文に対応する実行計画を示す図である。It is a figure which shows the execution plan corresponding to the inquiry sentence shown in FIG. 4B. 図4Cに示す問合せ文に対応する実行計画を示す図である。It is a figure which shows the execution plan corresponding to the inquiry sentence shown in FIG. 4C. 図4Dに示す問合せ文に対応する実行計画を示す図である。It is a figure which shows the execution plan corresponding to the inquiry sentence shown in FIG. 4D. 図5Aに示す実行計画に対応する実行計画ツリーを示す図である。5B is a diagram showing an execution plan tree corresponding to the execution plan shown in FIG. 5A. FIG. 図5Bに示す実行計画に対応する実行計画ツリーを示す図である。FIG. 6 is a diagram showing an execution plan tree corresponding to the execution plan shown in FIG. 5B. 図5Cに示す実行計画に対応する実行計画ツリーを示す図である。FIG. 6 is a diagram showing an execution plan tree corresponding to the execution plan shown in FIG. 5C. 図5Dに示す実行計画に対応する実行計画ツリーを示す図である。It is a figure which shows the execution plan tree corresponding to the execution plan shown in FIG. 5D. 図6Aに示す実行計画ツリーに対応する検索用文字列を示す図である。FIG. 6B is a diagram showing a search character string corresponding to the execution plan tree shown in FIG. 6A. 図6Bに示す実行計画ツリーに対応する検索用文字列を示す図である。FIG. 7 is a diagram showing a search character string corresponding to the execution plan tree shown in FIG. 6B. 図6Cに示す実行計画ツリーに対応する検索用文字列を示す図である。It is a figure which shows the character string for a search corresponding to the execution plan tree shown in FIG. 6C. 図6Dに示す実行計画ツリーに対応する検索用文字列を示す図である。It is a figure which shows the character string for a search corresponding to the execution plan tree shown in FIG. 6D. 第1実施形態に係る検索用情報の一例を示す図である。It is a figure which shows an example of the information for a search which concerns on 1st Embodiment. 図4A〜図4Dに示す問合せ文の相互のレーベンシュタイン距離を示す図である。FIG. 5 is a diagram showing mutual Levenshtein distances of the inquiry sentences shown in FIGS. 4A to 4D. 第1実施形態に係る検索用情報の生成に係る問合せ文検索装置の処理の流れを示すフローチャートである。3 is a flowchart showing a processing flow of the inquiry sentence search device relating to generation of search information according to the first embodiment. 第1実施形態に係る問合せ文の検索に係る問合せ文検索装置の処理の流れを示すフローチャートである。It is a flow chart which shows a flow of processing of an inquiry sentence search device concerning search of an inquiry sentence concerning a 1st embodiment. 第2実施形態に係る問合せ文検索装置の構成を示す図である。It is a figure which shows the structure of the inquiry sentence search device which concerns on 2nd Embodiment.

<第1実施形態>
[問合せ文検索システムSの概要]
図1は、第1実施形態に係る問合せ文検索システムSの概要を示す図である。問合せ文検索システムSは、問合せ文検索装置1と、データベースシステム2と、端末3とを備え、検索文が示す処理に対応する問合せ文を検索するためのシステムである。
<First Embodiment>
[Outline of inquiry text search system S]
FIG. 1 is a diagram showing an outline of an inquiry sentence search system S according to the first embodiment. The inquiry text search system S includes the inquiry text search device 1, the database system 2, and the terminal 3, and is a system for searching an inquiry text corresponding to the processing indicated by the search text.

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

問合せ文検索装置1は、データベースシステム2から取得した実行計画に基づいて、当該実行計画に対応する問合せ文の構造を解析する(図1の(2))。問合せ文検索装置1は、解析した構造に対応する検索用文字列を生成し、当該検索用文字列と、問合せ文とを関連付けて記憶部に記憶する(図1の(3))。 Based on the execution plan acquired from the database system 2, the query statement search device 1 analyzes the structure of the query statement corresponding to the execution plan ((2) in FIG. 1). The query text search device 1 generates a search character string corresponding to the analyzed structure, and stores the search character string and the query text in the storage unit in association with each other ((3) in FIG. 1).

問合せ文検索装置1は、端末3から、検索文として、検索用文字列を取得する(図1の(4))。問合せ文検索装置1は、記憶部に記憶されている検索用文字列のうち、取得した検索用文字列と類似する検索用文字列を特定する(図1の(5))。問合せ文検索装置1は、特定した検索用文字列に対応する問合せ文を特定する(図1の(6))。問合せ文検索装置1は、特定した問合せ文を、検索文に対応する検索結果として端末3に出力する(図1の(7))。 The inquiry text search device 1 acquires a search character string as a search text from the terminal 3 ((4) in FIG. 1). The query text search device 1 identifies a search character string similar to the acquired search character string from the search character strings stored in the storage unit ((5) in FIG. 1). The inquiry sentence search device 1 identifies the inquiry sentence corresponding to the identified search character string ((6) in FIG. 1). The inquiry statement search device 1 outputs the specified inquiry statement to the terminal 3 as a search result corresponding to the search statement ((7) in FIG. 1).

このように、問合せ文検索装置1は、実行計画を解析することで生成した検索用文字列に基づいて、検索文に類似する検索用文字列を特定するので、検索文が示す問合せ文と構造が類似する問合せ文を精度良く検索することができる。
以下、問合せ文検索装置1の構成について説明する。
In this way, the query text search device 1 identifies a search text string similar to the search text based on the search text string generated by analyzing the execution plan. It is possible to accurately search for a query sentence similar to.
The configuration of the inquiry sentence search device 1 will be described below.

[問合せ文検索装置1の構成例]
図2は、第1実施形態に係る問合せ文検索装置1の構成を示す図である。
問合せ文検索装置1は、記憶部11と、制御部12とを備える。
[Configuration Example of Query Text Retrieval Device 1]
FIG. 2 is a diagram showing the configuration of the inquiry sentence search device 1 according to the first embodiment.
The inquiry sentence search 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、記憶制御部123、入力受付部124、特定部125、及び出力部126として機能させる問合せ文検索プログラムを記憶する。 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 operating the query sentence search device 1. The storage unit 11 makes the control unit 12 of the query sentence search device 1 function as an acquisition unit 121, a character string generation unit 122, a storage control unit 123, an input reception unit 124, a specification unit 125, and an output unit 126, which will be described later. Store the sentence search program.

制御部12は、例えばCPU(Central Processing Unit)である。制御部12は、記憶部11に記憶されている各種プログラムを実行することにより、問合せ文検索装置1に係る機能を制御する。制御部12は、問合せ文検索プログラムを実行することにより、取得部121、文字列生成部122、記憶制御部123、入力受付部124、特定部125、及び出力部126として機能する。 The control unit 12 is, for example, a CPU (Central Processing Unit). The control unit 12 controls various functions of the query sentence search device 1 by executing various programs stored in the storage unit 11. The control unit 12 functions as the acquisition unit 121, the character string generation unit 122, the storage control unit 123, the input reception unit 124, the identification unit 125, and the output unit 126 by executing the inquiry sentence search program.

取得部121は、データベースシステム2から、問合せ文と、実行計画とを取得する。問合せ文は、データベースシステム2において実行されたSQL等の問合せ文である。実行計画は、データベースシステム2が、問合せ文に対応する処理を実行する際に生成する情報である。取得部121は、取得した問合せ文と、当該問合せ文に対応する実行計画とを関連付けて問合せ履歴情報として記憶部11に記憶させる。図3は、問合せ履歴情報の一例を示す図である。図3に示すように、問合せ文と、実行計画とが関連付けられて記憶されていることが確認できる。 The acquisition unit 121 acquires a query statement and an execution plan from the database system 2. The inquiry sentence is an inquiry sentence such as SQL executed in the database system 2. The execution plan is information generated when the database system 2 executes the process corresponding to the inquiry sentence. The acquisition unit 121 associates the acquired inquiry sentence with the execution plan corresponding to the inquiry sentence and causes the storage unit 11 to store them as inquiry history information. FIG. 3 is a diagram showing an example of inquiry history information. As shown in FIG. 3, it can be confirmed that the inquiry statement and the execution plan are stored in association with each other.

図4A〜図4Dは、問合せ文の一例を示す図である。ここで、図4Bに示す問合せ文は、図4Aに示す問合せ文と同じデータを出力するための問合せ文であり、図4Aに示す問合せ文と異なる表現である問合せ文である。 4A to 4D are diagrams illustrating examples of inquiry sentences. Here, the inquiry statement shown in FIG. 4B is an inquiry statement for outputting the same data as the inquiry statement shown in FIG. 4A, and is an expression different from the inquiry statement shown in FIG. 4A.

図5A〜図5Dは、図4A〜図4Dに示す問合せ文に対応する実行計画を示す図である。図5において最初に示される文字列「Sort」と、「−>」の後に示される文字列とは、問合せ文によって実行される処理としてのノードを示している。また、文字列「Scan」を含むノード(以下、Scanノードともいう。)に続く文字列は、参照されるテーブルのテーブル名を示している。ここで、図4Aに示す問合せ文と異なる表現である問合せ文であるものの、図5Aに示す実行計画と、図5Bに示す実行計画とが同じ実行計画であることが確認できる。 5A to 5D are diagrams showing execution plans corresponding to the inquiry statements shown in FIGS. 4A to 4D. In FIG. 5, the first character string “Sort” and the character string after “−>” indicate a node as a process executed by the 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. Here, it can be confirmed that the execution plan shown in FIG. 5A and the execution plan shown in FIG. 5B are the same execution plan, although the query statement is an expression different from the query statement shown in FIG. 4A.

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

図6A〜図6Dは、図5A〜図5Dに示す実行計画に対応する実行計画ツリーを示す図である。実行計画ツリーでは、各ノードにおける処理の略称を、括弧内に示している。例えば、ルートノードに対応する処理「Sort」の略称は「S」であり、処理「Group Aggregate」の略称は「GA」である。また、実行計画ツリーでは、Scanノードの下部にテーブル名を示している。ここで、図6Aに示す実行計画ツリーと、図6Bに示す実行計画ツリーとが同じ構造であることが確認できる。 6A to 6D are diagrams showing execution plan trees corresponding to the execution plans shown in FIGS. 5A to 5D. In the execution plan tree, the abbreviations of the processes in each node 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”. Further, in the execution plan tree, the table name is shown below the Scan node. Here, it can be confirmed that the execution plan tree shown in FIG. 6A and the execution plan tree shown in FIG. 6B have the same structure.

文字列生成部122は、抽出された当該木構造を示す実行計画ツリーを、ルートとなるノードから行きがけ順及び帰りがけ順に走査することにより木構造を示す検索用文字列を生成する。すなわち、文字列生成部122は、実行計画ツリーを、ルートとなるノードから行きがけ順及び帰りがけ順に走査したときに検出されたノードの略称を、検出された順番で並べた文字列を検索用文字列として生成する。 The character string generation unit 122 generates a search character string indicating a tree structure by scanning the extracted execution plan tree indicating the tree structure from the root node in the order of going and returning. That is, the character string generation unit 122 searches for 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 travel and the order of return are arranged in the order of detection. Generate as.

ここで、文字列生成部122は、処理が重複するノードには通し番号を付与する。例えば、図6Aに示されるノードN1と、ノードN2とは、いずれも「Sort(S)」である。そこで、文字列生成部122は、ノードN1の略称を「S1」とし、ノードN2の略称を「S2」とする。また、文字列生成部122は、Scanノードに対応する略称に、当該Scanノードにおいて参照されるテーブルのテーブル名称を関連付ける。 Here, the character string generation unit 122 assigns serial numbers to nodes for which processing is duplicated. For example, both the node N1 and the node N2 shown in FIG. 6A are “Sort(S)”. Therefore, the character string generation unit 122 sets the abbreviation of the node N1 as “S1” and the abbreviation of the node N2 as “S2”. Further, the character string generation unit 122 associates the abbreviation corresponding to the Scan node with the table name of the table referred to in the Scan node.

図7A〜図7Dは、図6A〜図6Dに示す実行計画ツリーに対応する検索用文字列を示す図である。図7に示すように、検索用文字列では、ノードが検出された順番に、当該ノードの略称が羅列されていることが確認できる。また、図7Aに示す検索用文字列と、図7Bに示す検索用文字列とが同じ内容であることが確認できる。 7A to 7D are diagrams showing search character strings corresponding to the execution plan trees shown in FIGS. 6A to 6D. As shown in FIG. 7, in the search character string, it can be confirmed that the abbreviations of the nodes are listed in the order in which the nodes are detected. Further, it can be confirmed that the search character string shown in FIG. 7A and the search character string shown in FIG. 7B have the same content.

文字列生成部122は、記憶部11に記憶されている問合せ履歴情報に含まれる全ての問合せ文について検索用文字列を生成する。
記憶制御部123は、文字列生成部122が生成した検索用文字列と、当該検索用文字列に対応する問合せ文とを関連付けて検索用情報として記憶部11に記憶させる。図8は、第1実施形態に係る検索用情報の一例を示す図である。図8に示すように、問合せ文と、検索用変換文字列とが関連付けられて記憶されていることが確認できる。
The character string generation unit 122 generates a search character string for all the inquiry sentences included in the inquiry history information stored in the storage unit 11.
The storage control unit 123 associates the search character string generated by the character string generation unit 122 with the inquiry sentence corresponding to the search character string, and causes the storage unit 11 to store the search information as search information. FIG. 8 is a diagram showing an example of search information according to the first embodiment. As shown in FIG. 8, it can be confirmed that the query text and the search conversion character string are stored in association with each other.

入力受付部124は、データベースシステム2において実行可能な問合せ文を示す検索文の入力を受け付ける。本実施形態において、入力受付部124は、端末3から、検索文として、検索用文字列を受け付ける。 The input receiving unit 124 receives an input of a search sentence indicating a query sentence that can be executed in the database system 2. In the present embodiment, the input reception unit 124 receives a search character string as a search sentence from the terminal 3.

特定部125は、データベースシステム2において実行された複数の問合せ文と、当該複数の問合せ文のそれぞれに対応する問合せ文の実行計画とを関連付けて記憶する記憶部11を参照し、入力受付部124が受け付けた検索文に対応する実行計画と少なくとも一部が一致する実行計画を特定する。 The identifying unit 125 refers to the storage unit 11 that stores the plurality of query statements executed in the database system 2 and the execution plans of the query statements corresponding to the plurality of query statements in association with each other, and the input receiving unit 124. The execution plan corresponding to at least a part of the execution plan corresponding to the search statement received by is specified.

本実施形態において、特定部125は、記憶部11に記憶されている検索用情報を構成する検索用文字列を参照し、入力受付部124が受け付けた検索文と少なくとも一部が一致する検索用文字列を特定する。具体的には、特定部125は、入力受付部124が受け付けた検索文と少なくとも一部が一致するとともに、入力受付部124が受け付けた検索文に含まれるテーブルと同じテーブルのみを含んでいる検索用文字列を特定する。ここで、特定部125は、検索用文字列の比較を行う場合には、各略称に付されている通し番号を除去した状態で、検索用文字列の比較を行うものとする。 In the present embodiment, the identifying unit 125 refers to the search character string that constitutes the search information stored in the storage unit 11 and uses the search text that is at least partially matched with the search text accepted by the input accepting unit 124. Specify the character string. Specifically, the specifying unit 125 has at least a part of the search sentence received by the input receiving unit 124, and includes only the same table as the table included in the search sentence received by the input receiving unit 124. Specify the character string for use. Here, when comparing the search character strings, the identifying unit 125 compares the search character strings with the serial numbers attached to the respective abbreviations removed.

例えば、入力受付部124が、図4Aに示す問合せ文に対応する検索用文字列、すなわち、図7Aに示す検索用文字列を検索文として受け付けた場合、特定部125は、当該検索用文字列と一致する検索用文字列として、図7Aに示す検索用文字列と、図7Bに示す検索用文字列とを特定する。したがって、特定部125は、問合せ文としての表現が異なっていても実行計画が同一であれば、同じ問合せ文とみなして検索することができる。 For example, when the input receiving unit 124 receives the search character string corresponding to the inquiry sentence illustrated in FIG. 4A, that is, the search character string illustrated in FIG. 7A as the search sentence, the specifying unit 125 determines that the search character string. The search character string shown in FIG. 7A and the search character string shown in FIG. 7B are specified as the search character strings matching with. Therefore, if the execution plans are the same, the identifying unit 125 can search for the same query statement even if the expressions are different.

別の例として、図4Cに示す問合せ文に対応する検索用文字列、すなわち、図7Cに示す検索用文字列の一部を検索文として利用することを考える。regionテーブルとnationテーブルとを結合する処理、及び、当該結合の結果とcustomerテーブルとの結合を行う処理に注目した場合、図6Cに示す実行計画ツリーにおいて、ルートノードから2番目のノード「Nested Loop」以下の部分木が該当する。検索文は、以下のように表現される。 As another example, consider using a search character string corresponding to the query text shown in FIG. 4C, that is, a part of the search text string shown in FIG. 7C as a search text. When attention is focused on the process of joining the region table and the state table and the process of joining the result of the join and the customer table, in the execution plan tree shown in FIG. 6C, the second node “Nested Loop” from the root node is displayed. The following subtrees are applicable. The search sentence is expressed as follows.

NL BS BS HJ H SS1 SS1 H SS2 SS2 HJ NL
BS→customer,SS1→region,SS2→nation
NL BS BS HJ H SS1 SS1 H SS2 SS2 HJ NL
BS→customer, SS1→region, SS2→nation

特定部125は、上記の検索文と少なくとも一部が一致する検索用文字列として、図7Cに示す検索用文字列と、図7Dに示す検索用文字列を特定する。これは、問合せ文全体が一致するわけではないが、実行計画ツリーで問合せ文を表した場合に一部の構造を共有する類似した問合せ文を検索可能であることを示している。 The specifying unit 125 specifies the search character string shown in FIG. 7C and the search character string shown in FIG. 7D as the search character string that at least partially matches the above-mentioned search sentence. This indicates that although the entire query statement does not match, it is possible to search for similar query statements that share a part of the structure when the query statement is represented in the execution plan tree.

なお、従来技術である文字列の類似度を測る手法と比較するため、図4Aに示す問合せ文と、図4B〜図4Dに示す問合せ文とのレーベンシュタイン距離を示す。図9は、図4A〜図4Dに示す問合せ文の相互のレーベンシュタイン距離を示す図である。 In order to compare with the technique of measuring the similarity between character strings, which is a conventional technique, the Levenshtein distance between the inquiry sentence shown in FIG. 4A and the inquiry sentences shown in FIGS. 4B to 4D is shown. FIG. 9 is a diagram showing mutual Levenshtein distances of the inquiry sentences shown in FIGS. 4A to 4D.

レーベンシュタイン距離は、値が小さいほど文字列の類似度が高いことを表している。同じ問合せ文の場合に、レーベンシュタイン距離は0となる。図9では、図4Aに示す問合せ文と、図4Cに示す問合せ文とのレーベンシュタイン距離が小さく、これらの問合せ文の類似度が高いとされている。しかしながら、図4Aに示す問合せ文と、図4Bに示す問合せ文とは、同じ処理内容を示しているため、実際には、図4Aに示す問合せ文と、図4Bに示す問合せ文とが類似している。 The smaller the Levenshtein distance, the higher the similarity of the character string. In the case of the same inquiry sentence, the Levenshtein distance is 0. In FIG. 9, the Levenshtein distance between the inquiry sentence shown in FIG. 4A and the inquiry sentence shown in FIG. 4C is small, and the similarity between these inquiry sentences is high. However, since the inquiry text shown in FIG. 4A and the inquiry text shown in FIG. 4B show the same processing content, the inquiry text shown in FIG. 4A and the inquiry text shown in FIG. 4B are actually similar to each other. ing.

また、図4Cに示す問合せ文と、図4Dに示す問合せ文のレーベンシュタイン距離は、図4Bに示す問合せ文と、図4Cに示す問合せ文とのレーベンシュタイン距離及び図4Bに示す問合せ文と、図4Dに示す問合せ文とのレーベンシュタイン距離に比べて大きく、類似度が低いとされている。しかしながら、図4Cに示す問合せ文と、図4Dに示す問合せ文とは、共通の処理を含むため、問合せ文の全体では一致しないものの、類似度が高いといえる。したがって、レーベンシュタイン距離による類似度の検索結果の精度が、本実施形態に係る問合せ文検索装置1における検索結果の精度よりも低いことが確認できる。 In addition, the Levenshtein distances of the inquiry sentence shown in FIG. 4C and the inquiry sentence shown in FIG. 4D are the Levenshtein distance between the inquiry sentence shown in FIG. 4B and the inquiry sentence shown in FIG. 4C, and the inquiry sentence shown in FIG. 4B. The Levenshtein distance is larger than the inquiry sentence shown in FIG. 4D, and the similarity is low. However, since the query text shown in FIG. 4C and the query text shown in FIG. 4D include common processing, the query text as a whole does not match, but it can be said that the similarity is high. Therefore, it can be confirmed that the accuracy of the search result of the degree of similarity based on the Levenshtein distance is lower than the accuracy of the search result in the query sentence search device 1 according to the present embodiment.

出力部126は、特定された実行計画に関連付けて記憶部11に記憶されている問合せ文を検索結果として出力する。本実施形態において、出力部126は、記憶部11に記憶されている検索用情報において、特定部125が特定した検索用文字列に関連付けられている問合せ文を検索結果として端末3に出力する。 The output unit 126 outputs the query statement stored in the storage unit 11 in association with the specified execution plan as a search result. In the present embodiment, the output unit 126 outputs the inquiry sentence associated with the search character string specified by the specifying unit 125 in the search information stored in the storage unit 11 to the terminal 3 as a search result.

[検索用情報の生成に係る処理の流れ]
続いて、問合せ文検索装置1における処理の流れについて説明する。まず、検索用情報の生成に係る問合せ文検索装置1の処理の流れについて説明する。図10は、第1実施形態に係る検索用情報の生成に係る問合せ文検索装置1の処理の流れを示すフローチャートである。
[Processing flow for generating search information]
Next, the flow of processing in the inquiry text search device 1 will be described. First, a flow of processing of the inquiry sentence search device 1 related to generation of search information will be described. FIG. 10 is a flowchart showing a processing flow of the inquiry sentence search device 1 related to generation of search information according to the first embodiment.

まず、取得部121は、データベースシステム2から、問合せ文と、実行計画とを取得し(S10)、問合せ文と、実行計画とを記憶部11に記憶させる。
続いて、文字列生成部122は、記憶部11に記憶されている実行計画に基づいて、実行計画に含まれる処理を示すノードと、実行計画に対応する処理において参照されるテーブルのテーブル名を抽出する(S20)。
First, the acquisition unit 121 acquires a query statement and an execution plan from the database system 2 (S10), and stores the query statement and the execution plan in the storage unit 11.
Next, the character string generation unit 122, based on the execution plan stored in the storage unit 11, 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. Extract (S20).

続いて、文字列生成部122は、抽出したノード及びテーブル名とに基づいて実行計画ツリーを生成する(S30)。
続いて、文字列生成部122は、生成した実行計画ツリーに基づいて、検索用文字列を生成し(S40)、当該検索用文字列と、当該検索用文字列に対応する問合せ文とを関連付けて検索用情報として記憶させる(S50)。
Next, the character string generation unit 122 generates an execution plan tree based on the extracted node and table name (S30).
Subsequently, the character string generation unit 122 generates a search character string based on the generated execution plan tree (S40), and associates the search character string with the query statement corresponding to the search character string. It is stored as search information (S50).

文字列生成部122は、記憶部11に記憶されている全ての問合せ文で検索用文字列を生成したか否かを判定する(S60)。文字列生成部122は、全ての問合せ文で検索用文字列を生成したと判定すると、本フローチャートに係る処理を終了し、全ての問合せ文で検索用文字列を生成していないと判定すると、S20に処理を移す。 The character string generation unit 122 determines whether or not the search character string has been generated for all the inquiry sentences stored in the storage unit 11 (S60). If the character string generation unit 122 determines that the search character strings have been generated for all the query sentences, it ends the processing according to this flowchart, and if it determines that the search character strings have not been generated for all the query sentences, The processing moves to S20.

[問合せ文の検索に係る処理の流れ]
続いて、問合せ文の検索に係る問合せ文検索装置1の処理の流れについて説明する。図11は、第1実施形態に係る問合せ文の検索に係る問合せ文検索装置1の処理の流れを示すフローチャートである。
[Process flow related to query text search]
Next, a processing flow of the inquiry sentence search device 1 related to the inquiry sentence search will be described. FIG. 11 is a flowchart showing the flow of processing of the inquiry sentence search device 1 relating to the inquiry sentence search according to the first embodiment.

まず、入力受付部124は検索文として、検索用文字列を受け付ける(S110)。
続いて、特定部125は、記憶部11に記憶されている検索用情報を構成する検索用文字列を参照し、入力受付部124が受け付けた検索文と少なくとも一部が一致する検索用文字列を特定する(S120)。
First, the input receiving unit 124 receives a search character string as a search sentence (S110).
Subsequently, the identifying unit 125 refers to the search character string that constitutes the search information stored in the storage unit 11, and the search character string that at least partially matches the search sentence received by the input reception unit 124. Is specified (S120).

続いて、出力部126は、記憶部11に記憶されている検索用情報において、特定部125が特定した検索用文字列に関連付けられている問合せ文を特定する(S130)。そして、出力部126は、特定した問合せ文を端末3に検索結果として出力する(S140)。 Subsequently, the output unit 126 identifies the inquiry sentence associated with the search character string identified by the identifying unit 125 in the search information stored in the storage unit 11 (S130). Then, the output unit 126 outputs the specified inquiry sentence to the terminal 3 as a search result (S140).

[第1実施形態における効果]
以上の通り、第1実施形態に係る問合せ文検索装置1は、データベースシステム2において実行可能な問合せ文を示す検索文の入力を受け付け、データベースシステム2において実行された複数の問合せ文と、当該複数の問合せ文のそれぞれに対応する問合せ文の実行計画とを関連付けて記憶する記憶部11を参照し、当該検索文に対応する実行計画と少なくとも一部が一致する実行計画を特定し、特定された実行計画に関連付けて記憶部11に記憶されている問合せ文を検索結果として出力する。
[Effects of First Embodiment]
As described above, the query statement search device 1 according to the first embodiment accepts an input of a search statement indicating a query statement that can be executed in the database system 2, receives a plurality of query statements executed in the database system 2, and Of the query statement, the execution plan of the query statement is stored in association with each other, and the execution plan at least partially matching the execution plan corresponding to the search statement is identified and identified. The query statement stored in the storage unit 11 in association with the execution plan is output as a search result.

このようにすることで、問合せ文検索装置1は、問合せ文の表現形式が異なる同じ処理内容を示す問合せ文を、実行計画に基づいて同じ処理内容を示す問合せ文として扱うことができる。これにより、問合せ文検索装置1は、検索文が示す問合せ文と構造が類似する問合せ文を精度良く検索することができる。 By doing so, the query statement search device 1 can handle the query statements showing the same processing content with different expression forms of the query statement as the query statement showing the same processing content based on the execution plan. As a result, the query text search device 1 can accurately search for a query text that is similar in structure to the query text indicated by the search text.

<第2実施形態>
[検索文として問合せ文の入力を受け付ける。]
続いて、第2実施形態について説明する。第1実施形態では、検索文として検索用文字列の入力を受け付けた。これに対し、第2実施形態に係る問合せ文検索装置1は、検索文として問合せ文の入力を受け付ける点で第1実施形態に係る問合せ文検索装置1と異なる。以下に、第2実施形態に係る問合せ文検索装置1について説明する。なお、第1実施形態と同じ部分については適宜説明を省略する。
<Second Embodiment>
[Accept input of inquiry text as search text. ]
Next, the second embodiment will be described. In the first embodiment, the input of the search character string is accepted as the search text. On the other hand, the inquiry sentence search device 1 according to the second embodiment is different from the inquiry sentence search device 1 according to the first embodiment in that an inquiry sentence input as a search sentence is accepted. The inquiry sentence search device 1 according to the second embodiment will be described below. The description of the same parts as those in the first embodiment will be appropriately omitted.

図12は、第2実施形態に係る問合せ文検索装置1の構成を示す図である。図12に示すように、第2実施形態に係る問合せ文検索装置1は、変換部127をさらに備える。
第2実施形態において、入力受付部124は、端末3から、検索文として問合せ文の入力を受け付ける。
FIG. 12 is a diagram showing the configuration of the inquiry sentence search device 1 according to the second embodiment. As shown in FIG. 12, the inquiry sentence search device 1 according to the second embodiment further includes a conversion unit 127.
In the second embodiment, the input receiving unit 124 receives input of an inquiry sentence as a search sentence from the terminal 3.

変換部127は、入力された問合せ文を検索用文字列に変換する。例えば、変換部127は、入力された問合せ文をデータベースシステム2に送信し、当該問合せ文の実行計画の取得を要求する。データベースシステム2は、問合せ文が入力されると、当該問合せ文の実行計画を生成し、当該実行計画を問合せ文検索装置1に送信する。 The conversion unit 127 converts the input inquiry sentence into a search character string. For example, the conversion unit 127 transmits the input inquiry sentence to the database system 2 and requests acquisition of the execution plan of the inquiry sentence. When the query text is input, the database system 2 creates an execution plan for the query text and sends the execution plan to the query text search device 1.

変換部127は、データベースシステム2から実行計画を受信すると、当該実行計画に基づいて、実行計画に含まれる処理を示すノードと、実行計画に対応する処理において参照されるテーブルのテーブル名を抽出する。変換部127は、受信した実行計画を示すコードの記載順序と、抽出したノード及びテーブル名とに基づいて、実行計画に対応する問合せ文の実行計画ツリーを生成する。変換部127は、実行計画ツリーに基づいて検索用文字列を生成することにより、入力された問合せ文を検索用文字列に変換する。 Upon receiving the execution plan from the database system 2, the conversion unit 127 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 execution plan. .. The conversion unit 127 generates the execution plan tree of the query statement corresponding to the execution plan, based on the description order of the received code indicating the execution plan and the extracted node and table name. The conversion unit 127 converts the input query sentence into a search character string by generating a search character string based on the execution plan tree.

特定部125は、記憶部11に記憶されている検索用情報を構成する検索用文字列を参照し、変換部127によって変換された検索用文字列と少なくとも一部が一致する検索用文字列を特定する。
出力部126は、記憶部11に記憶されている検索用情報において、特定部125が特定した検索用文字列に関連付けられている問合せ文を検索結果として端末3に出力する。
The identifying unit 125 refers to the search character string that constitutes the search information stored in the storage unit 11, and determines a search character string that at least partially matches the search character string converted by the conversion unit 127. Identify.
The output unit 126 outputs the inquiry sentence associated with the search character string specified by the specifying unit 125 in the search information stored in the storage unit 11 to the terminal 3 as a search result.

[第2実施形態における効果]
以上の通り、第2実施形態に係る問合せ文検索装置1は、検索文として問合せ文の入力を受け付け、入力された問合せ文を検索用文字列に変換し、記憶部11に記憶されている検索用情報を参照し、変換された検索用文字列と少なくとも一部が一致する検索用文字列を特定する。
[Effects of Second Embodiment]
As described above, the inquiry statement search device 1 according to the second embodiment accepts an input of an inquiry statement as a search statement, converts the entered inquiry statement into a search character string, and stores the search in the storage unit 11. The search information is referenced to identify a search character string that at least partially matches the converted search character string.

このようにすることで、端末3のユーザは、問合せ文に対応する検索用文字列を生成できなくても、問合せ文検索装置1に問合せ文を入力することにより、当該問合せ文と処理内容が類似する問合せ文を検索することができる。 By doing so, even if the user of the terminal 3 cannot generate the search character string corresponding to the inquiry sentence, by inputting the inquiry sentence to the inquiry sentence search device 1, the inquiry sentence and the processing content are You can search for similar query sentences.

以上、本発明を実施の形態を用いて説明したが、本発明の技術的範囲は上記実施の形態に記載の範囲には限定されない。上記実施の形態に、多様な変更又は改良を加えることが可能であることが当業者に明らかである。例えば、上述の複数の実施形態を組み合わせてもよい。 Although the present invention has been described using the embodiments, 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 modifications and improvements can be added to the above-described embodiment. For example, the plurality of embodiments described above may be combined.

また、上述の実施形態において、問合せ文検索装置1は、端末3から受け付けた検索用文字列と、検索用情報に含まれる検索用文字列とを比較することによって、端末3から受け付けた検索用文字列に類似する検索用文字列を特定したが、これに限らない。例えば、問合せ文検索装置1は、記憶部11に、問合せ文と、実行計画とを関連付けて記憶させておき、端末3から、実行計画の少なくとも一部を示す文字列を受け付けてもよい。そして、問合せ文検索装置1は、受け付けた文字列と少なくとも一部が一致する実行計画を特定し、特定した実行計画に対応する問合せ文を検索結果として出力してもよい。 Further, in the above-described embodiment, the inquiry text search device 1 compares the search character string received from the terminal 3 with the search character string included in the search information to thereby obtain the search character string received from the terminal 3. A search character string similar to the character string is specified, but the present invention is not limited to this. For example, the inquiry statement search device 1 may store the inquiry statement and the execution plan in the storage unit 11 in association with each other, and receive a character string indicating at least a part of the execution plan from the terminal 3. Then, the inquiry statement search device 1 may specify an execution plan that at least partially matches the received character string, and output the inquiry statement corresponding to the specified execution plan as the search result.

この場合において、問合せ文検索装置1は、問合せ文を受け付け、当該問合せ文を実行計画に変換してもよい。そして、問合せ文検索装置1は、変換された実行計画と少なくとも一部が一致する実行計画を特定し、特定した実行計画に対応する問合せ文を検索結果として出力してもよい。 In this case, the inquiry statement search device 1 may accept the inquiry statement and convert the inquiry statement into an execution plan. Then, the query statement search device 1 may specify an execution plan that at least partially matches the converted execution plan, and output a query statement corresponding to the specified execution plan as a search result.

また、特に、装置の分散・統合の具体的な実施形態は以上に図示するものに限られず、その全部又は一部について、種々の付加等に応じて、又は、機能負荷に応じて、任意の単位で機能的又は物理的に分散・統合して構成することができる。 Further, in particular, the specific embodiment of the dispersion/integration of the devices is not limited to the one shown in the above, and any or all of them may be arbitrarily added depending on various additions or functional loads. It can be functionally or physically distributed/integrated in units.

1・・・問合せ文検索装置、11・・・記憶部、12・・・制御部、121・・・取得部、122・・・文字列生成部、123・・・記憶制御部、124・・・入力受付部、125・・・特定部、126・・・出力部、127・・・変換部、2・・・データベースシステム、3・・・端末、S・・・問合せ文検索システム DESCRIPTION OF SYMBOLS 1... Query sentence retrieval device, 11... Storage unit, 12... Control unit, 121... Acquisition unit, 122... Character string generation unit, 123... Storage control unit, 124...・Input receiving unit, 125...Specification unit, 126...Output unit, 127...Conversion unit, 2...Database system, 3...Terminal, S...Inquiry sentence search system

Claims (6)

データベースシステムにおいて実行可能な問合せ文を示す検索文の入力を受け付ける入力受付部と、
前記データベースシステムにおいて実行された複数の問合せ文と、当該複数の問合せ文のそれぞれに対応する前記問合せ文の実行計画とを関連付けて記憶する記憶部を参照し、前記検索文に対応する実行計画と少なくとも一部が一致する実行計画を特定する特定部と、
特定された実行計画に関連付けて前記記憶部に記憶されている問合せ文を検索結果として出力する出力部と、
を備える問合せ文検索装置。
An input receiving unit that receives an input of a search statement indicating a query statement that can be executed in the database system,
With reference to a storage unit that stores a plurality of query statements executed in the database system and an execution plan of the query statement corresponding to each of the plurality of query statements in association with each other, an execution plan corresponding to the search statement and An identification unit that identifies execution plans that at least partially match,
An output unit that outputs the query statement stored in the storage unit in association with the identified execution plan as a search result,
An inquiry sentence search device comprising:
前記記憶部に記憶されている前記実行計画に基づいて、当該実行計画に対応する問合せ文の構造を抽出し、抽出された当該構造と、当該問合せ文において参照するテーブルとを示す検索用文字列を生成する文字列生成部と、
前記検索用文字列と、当該検索用文字列に対応する問合せ文とを関連付けて前記記憶部に記憶させる記憶制御部をさらに備え、
前記入力受付部は、前記検索文として前記検索用文字列を受け付け、
前記特定部は、前記記憶部を参照し、受け付けた前記検索文と少なくとも一部が一致する前記検索用文字列を特定し、
前記出力部は、特定された検索用文字列に関連付けて前記記憶部に記憶されている問合せ文を検索結果として出力する、
請求項1に記載の問合せ文検索装置。
Based on the execution plan stored in the storage unit, a structure of a query statement corresponding to the execution plan is extracted, and a search character string indicating the extracted structure and a table referred to in the query statement A character string generation unit that generates
The storage control unit further stores the search character string and an inquiry sentence corresponding to the search character string in the storage unit in association with each other,
The input receiving unit receives the search character string as the search sentence,
The identifying unit refers to the storage unit and identifies the search character string that at least partially matches the received search sentence,
The output unit outputs the query statement stored in the storage unit in association with the specified search character string, as a search result,
The inquiry sentence search device according to claim 1.
前記文字列生成部は、前記記憶部に記憶されている前記実行計画に基づいて、当該実行計画に対応する問合せ文の木構造を抽出し、抽出された当該木構造を、ルートとなるノードから行きがけ順及び帰りがけ順に走査することにより木構造を示す前記検索用文字列を生成する、
請求項2に記載の問合せ文検索装置。
The character string generation unit extracts a tree structure of a query statement corresponding to the execution plan based on the execution plan stored in the storage unit, and extracts the extracted tree structure from a root node. Generating the search character string indicating a tree structure by scanning the order of going and the order of returning,
The inquiry sentence search device according to claim 2.
前記入力受付部は、前記検索文として前記問合せ文の入力を受け付け、
入力された前記問合せ文を前記検索用文字列に変換する変換部をさらに備え、
前記特定部は、前記記憶部を参照し、変換された検索用文字列と少なくとも一部が一致する前記検索用文字列を特定する、
請求項2又は3に記載の問合せ文検索装置。
The input receiving unit receives an input of the inquiry sentence as the search sentence,
Further comprising a conversion unit for converting the input query text into the search character string,
The specifying unit refers to the storage unit and specifies the search character string that at least partially matches the converted search character string,
The inquiry sentence search device according to claim 2.
コンピュータが実行する、
データベースシステムにおいて実行可能な問合せ文を示す検索文の入力を受け付けるステップと、
前記データベースシステムにおいて実行された複数の問合せ文と、当該複数の問合せ文のそれぞれに対応する前記問合せ文の実行計画とを関連付けて記憶する記憶部を参照し、前記検索文に対応する実行計画と少なくとも一部が一致する実行計画を特定するステップと、
特定された実行計画に関連付けて前記記憶部に記憶されている問合せ文を検索結果として出力するステップと、
を備える問合せ文検索方法。
Computer running,
A step of receiving an input of a search statement indicating a query statement that can be executed in the database system,
With reference to a storage unit that stores a plurality of query statements executed in the database system and an execution plan of the query statement corresponding to each of the plurality of query statements in association with each other, an execution plan corresponding to the search statement and Identifying execution plans that at least partly match,
Outputting a query statement stored in the storage unit in association with the specified execution plan as a search result,
A query text search method comprising:
コンピュータを、
データベースシステムにおいて実行可能な問合せ文を示す検索文の入力を受け付ける入力受付部、
前記データベースシステムにおいて実行された複数の問合せ文と、当該複数の問合せ文のそれぞれに対応する前記問合せ文の実行計画とを関連付けて記憶する記憶部を参照し、前記検索文に対応する実行計画と少なくとも一部が一致する実行計画を特定する特定部、及び、
特定された実行計画に関連付けて前記記憶部に記憶されている問合せ文を検索結果として出力する出力部、
として機能させる問合せ文検索プログラム。
Computer,
An input receiving unit that receives an input of a search statement indicating a query statement that can be executed in the database system,
With reference to a storage unit that stores a plurality of query statements executed in the database system and an execution plan of the query statement corresponding to each of the plurality of query statements in association with each other, an execution plan corresponding to the search statement and An identification unit that identifies execution plans that at least partially match, and
An output unit that outputs the query statement stored in the storage unit in association with the specified execution plan as a search result,
Query search program to function as.
JP2017078215A 2017-04-11 2017-04-11 Query sentence search device, query sentence search method, and query sentence search program Expired - Fee Related JP6737734B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017078215A JP6737734B2 (en) 2017-04-11 2017-04-11 Query sentence search device, query sentence search method, and query sentence search program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017078215A JP6737734B2 (en) 2017-04-11 2017-04-11 Query sentence search device, query sentence search method, and query sentence search program

Publications (2)

Publication Number Publication Date
JP2018180847A JP2018180847A (en) 2018-11-15
JP6737734B2 true JP6737734B2 (en) 2020-08-12

Family

ID=64276690

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017078215A Expired - Fee Related JP6737734B2 (en) 2017-04-11 2017-04-11 Query sentence search device, query sentence search method, and query sentence search program

Country Status (1)

Country Link
JP (1) JP6737734B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6971929B2 (en) * 2018-07-20 2021-11-24 Kddi株式会社 Inquiry statement output device and inquiry statement output method
CN109582828A (en) * 2018-11-30 2019-04-05 阳煤忻州通用机械有限责任公司 The automated inquiry system of forging blank size, tolerance and weight based on VBA
CN111460241B (en) * 2020-04-26 2024-01-23 甬矽电子(宁波)股份有限公司 Data query method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
JP2018180847A (en) 2018-11-15

Similar Documents

Publication Publication Date Title
JP5661813B2 (en) Characterization and retrieval of semantic objects
JP5505234B2 (en) Character string comparison program, character string comparison device, and character string comparison method
Papadakis et al. Stavies: A system for information extraction from unknown web data sources through automatic web wrapper generation using clustering techniques
JP5040925B2 (en) Information extraction rule creation support system, information extraction rule creation support method, and information extraction rule creation support program
JP6737734B2 (en) Query sentence search device, query sentence search method, and query sentence search program
KR20160124079A (en) Systems and methods for in-memory database search
US7822788B2 (en) Method, apparatus, and computer program product for searching structured document
KR101499441B1 (en) Method and device for compressing, decompressing and querying document
JP2022073981A (en) Source code retrieval
JP2002099561A (en) Method and system for data conversion, and storage medium
CN103226601B (en) A kind of method and apparatus of picture searching
US20140067853A1 (en) Data search method, information system, and recording medium storing data search program
JP2011076364A (en) Device and method of adjusting search result
JP2013084023A (en) Specification creation support device and program
CN110188432B (en) System architecture verification method, electronic device and computer-readable storage medium
JP6971929B2 (en) Inquiry statement output device and inquiry statement output method
CN113744885B (en) Data transmission method and equipment among multiple systems in hospital intelligent system
JPWO2014170965A1 (en) Document processing method, document processing apparatus, and document processing program
KR102130779B1 (en) System of providing documents for machine reading comprehension and question answering system including the same
JP5628365B2 (en) Search device
JP5374456B2 (en) Method of operating document search apparatus and computer program for causing computer to execute the same
CN117851443B (en) SQL rule tag generation method based on artificial intelligence and readable storage medium
JP7111972B2 (en) Compliance determination device and method
JP5060361B2 (en) Structured document retrieval apparatus, method and program
Byrne Putting hybrid cultural data on the semantic web

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190605

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200619

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: 20200707

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200716

R150 Certificate of patent or registration of utility model

Ref document number: 6737734

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees