JP2017016208A - Virtual database system management apparatus, management method, and management program - Google Patents

Virtual database system management apparatus, management method, and management program Download PDF

Info

Publication number
JP2017016208A
JP2017016208A JP2015129265A JP2015129265A JP2017016208A JP 2017016208 A JP2017016208 A JP 2017016208A JP 2015129265 A JP2015129265 A JP 2015129265A JP 2015129265 A JP2015129265 A JP 2015129265A JP 2017016208 A JP2017016208 A JP 2017016208A
Authority
JP
Japan
Prior art keywords
query
statement
subquery
database system
graph
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
JP2015129265A
Other languages
Japanese (ja)
Other versions
JP6523823B2 (en
Inventor
信之 米田
Nobuyuki Yoneda
信之 米田
泰之 渡邊
Yasuyuki Watanabe
泰之 渡邊
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 JP2015129265A priority Critical patent/JP6523823B2/en
Publication of JP2017016208A publication Critical patent/JP2017016208A/en
Application granted granted Critical
Publication of JP6523823B2 publication Critical patent/JP6523823B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

PROBLEM TO BE SOLVED: To improve processing efficiency in an environment of a virtual database system management apparatus.SOLUTION: A method of managing a virtual database system includes: managing physical table information for managing entry numbers associated with data of database systems, and logical table information to be accessed from a user system, so as to associate the entry numbers with the physical table information and the logical table information; holding definition information for tables managed by the database systems; generating a query graph from a query text; referring to a logical table, the physical table information, and the table definition information, to generate corresponding sub-query sentences by decomposing the query graph; estimating a resulting size of the sub-query sentence; determining the order of executing the sub-query sentences and data arrangement of a result of the execution, on the basis of the resulting size; and executing the sub-query sentences, on the basis of the order.SELECTED DRAWING: Figure 2

Description

本発明は、複数のデータベースシステムが存在する環境において、ユーザからの問合せ文に対して、各データベースシステムで実行される副問合せ文が生成され、各副問合せ文の結果を踏まえて問合せ文の残りの処理を実行する場合に、処理の効率化を図る仮想データベースシステム管理装置、管理方法及び管理プログラムに関する。   The present invention generates a subquery to be executed in each database system in response to a query from a user in an environment where a plurality of database systems exist, and the remaining query is based on the result of each subquery. The present invention relates to a virtual database system management apparatus, a management method, and a management program that improve the efficiency of processing when the above processing is executed.

データ仮想化システム(又はマルチデータベースシステム)は、例えば特許文献1〜4に示されるように、インタフェースやデータ管理方式が異なる複数のデータベースシステムを仮想的に一つのデータベースシステムに見せるために、各データベースシステムが持つデータを論理的に統合して管理し、与えられた問合せ文に対応するデータベースシステムに副問合せ文を出力し、各データベースシステムで実行された副問合せ文の処理結果を中央に収集し、仮想スキーマ(実際の物理テーブルをユーザに提供する論理テーブルに変換する処理を定義したもの)に従って一つに統合して結果を出力するシステムとなっている。   A data virtualization system (or a multi-database system), for example, as shown in Patent Documents 1 to 4, each database is used to virtually show a plurality of database systems with different interfaces and data management methods as one database system. Data that the system has is logically integrated and managed, subquery statements are output to the database system corresponding to the given query statement, and the processing results of the subquery statements executed in each database system are collected centrally. , A system that outputs the result by integrating them into one according to a virtual schema (defining a process for converting an actual physical table into a logical table provided to a user).

これらのデータ仮想化システムにおいては、基本的に複数のデータベースシステムと接続し、複数のデータベースを物理データベースモデルとして管理し、一方、論理データベースモデルを作成して物理データベースモデルと紐付けることによって、複数の物理データベースモデルを1つの論理データベースモデルとして扱い、論理データベースモデルに対する問合せ文の実行を可能としている。   These data virtualization systems basically connect to multiple database systems and manage multiple databases as physical database models, while creating logical database models and associating them with physical database models. The physical database model is handled as one logical database model, and a query statement can be executed on the logical database model.

上述した仮想データベースシステムにおいては、ユーザから与えられた問合せ文に対して、仮想データベースシステムに接続された各データベースシステムにおいて実行可能な副問合せ文が生成・発行され、副問合せ文の処理結果を仮想データベースシステムが受け取り、さらに問合せ文の残りの処理を実行してユーザへ結果を返す。
しかしながら、問合せ文の残りの処理を実行するに際し、各データベースシステムにて実行する副問合せ文の結果によっては、仮想データベースシステムで処理すべきデータ量が膨大となり処理時間が長くなる、又は、リソース不足により処理を完了できずに異常終了することが起こり得るという問題があった。
In the above-described virtual database system, a subquery sentence that can be executed in each database system connected to the virtual database system is generated and issued for a query sentence given by a user, and the processing result of the subquery sentence is virtualized. The database system receives and executes the remaining processing of the query statement and returns the result to the user.
However, when executing the remaining processing of the query statement, depending on the result of the sub-query statement executed in each database system, the amount of data to be processed in the virtual database system becomes enormous and the processing time becomes long, or the resource is insufficient There is a problem that the process may not be completed and may end abnormally.

そこで本発明者らは、特許文献5に示すように、複数のデータベースシステムが存在する仮想データベースシステム管理装置の環境下において、問合せ文から各データベースシステムに対する副問合せ文を生成する場合に、データ再配置とそれに伴う問合せ文変換により処理の効率化を実現する仮想データベースシステム管理装置を提案するに至った。   Therefore, as shown in Patent Document 5, the inventors reconstructed data when generating a subquery for each database system from a query in the environment of a virtual database system management apparatus having a plurality of database systems. We have come up with a virtual database system management device that can improve the processing efficiency by arranging the query and accompanying query transformation.

特開平09−091309号公報JP 09-091309 A 特開平10−307743号公報Japanese Patent Laid-Open No. 10-307743 特表2013−508857号公報Special table 2013-508857 gazette 特願2014−057080Japanese Patent Application No. 2014-057080 特願2014−226050Japanese Patent Application 2014-2226050

この仮想データベースシステム管理装置による場合、ユーザシステムが仮想データベースシステムに問合せ文を入力すると、仮想データベースシステムは、各データベースシステムに対応する副問合せ文を生成する。
そのため、仮想データベースシステムで生成される副問合せ文は、各データベースシステムと1対1に対応するため、直積を含む副問合せ文となる可能性があった。もし、直積を含む副問合せ文となった場合には、処理結果が膨大となり、処理時間が長くなることで、システムがリソース不足を引き起こし、異常終了を引き起こすという問題があった。
In the case of this virtual database system management apparatus, when the user system inputs a query statement to the virtual database system, the virtual database system generates a subquery statement corresponding to each database system.
For this reason, the subquery generated by the virtual database system has a one-to-one correspondence with each database system, and thus may be a subquery including a direct product. If it becomes a subquery including a direct product, the processing result becomes enormous and the processing time becomes long, causing the system to run out of resources and causing abnormal termination.

本発明は上記実情に鑑みて提案されたものであり、仮想データベースシステムにおいて副問合せ文を生成する場合に、分解処理を施したクエリグラフを用いることで、副問合せ文の生成単位を細分化し、直積の発生を防ぐことで処理の効率化を実現する仮想データベースシステム管理装置、仮想データベースシステム管理方法及び仮想データベースシステム管理プログラムを提供することを目的としている。   The present invention has been proposed in view of the above circumstances, and when generating a subquery in a virtual database system, by using a query graph subjected to a decomposition process, the generation unit of the subquery is subdivided, It is an object of the present invention to provide a virtual database system management apparatus, a virtual database system management method, and a virtual database system management program that can improve processing efficiency by preventing the occurrence of a direct product.

上記目的を達成するため本発明は、仮想データベースシステムにおいて、ユーザから入力された問合せ文からクエリグラフを生成し、非効率となる関係(複数存在する各データベースシステム間を跨ぐ関係や、多対多の関係)を基準にクエリグラフを分解し、分解されたクエリグラフに対応する副問合せ文を生成するように処理することにより、仮想データベースシステム管理装置の問合せ処理を効率化する。   In order to achieve the above object, the present invention generates a query graph from a query statement input by a user in a virtual database system, resulting in an inefficient relationship (a relationship between a plurality of existing database systems, a many-to-many relationship). The query graph of the virtual database system management apparatus is made efficient by decomposing the query graph on the basis of the relationship (1) and generating a subquery corresponding to the decomposed query graph.

すなわち、請求項1は、複数のデータベースシステムが接続され、ユーザシステムからの問合せ文に応じてデータが出力される仮想データベースシステム管理装置において、次の構成を備えたことを特徴としている。
前記各データベースシステムのデータに関連付けたエントリ番号を管理する物理テーブル情報と、前記ユーザシステムからのアクセス対象となる論理テーブル情報とから、前記物理テーブル情報と前記論理テーブル情報に対して各エントリ番号を紐付けて管理するとともに、前記データベースシステムで管理される各テーブルに対する定義情報を保有する。
問合せ文解析部。この問合せ文解析部は、前記ユーザシステムから入力される問合せ文からクエリグラフを生成し、前記論理テーブル、物理テーブル情報、テーブル定義情報を参照して、前記クエリグラフに対して分解処理を行って対応する副問合せ文とデータ再配置計画を決める。
結果サイズ推定部。この結果サイズ推定部は、前記問合せ文解析部から呼び出され、前記副問合せ文の結果サイズを推定する。
問合せ文生成部。この実行計画生成部は、前記問合せ文解析部から呼び出され、前記副問合せ文を生成する。
実行計画生成部。この実行計画生成部は、前記問合せ文解析部の出力結果を基に実行計画を生成する。
実行制御部。実行計画生成部は、前記実行計画生成部が出力する実行計画を基に前記データベースシステムへの問い合わせを実行する。
That is, claim 1 is characterized in that a virtual database system management apparatus to which a plurality of database systems are connected and data is output according to an inquiry from a user system has the following configuration.
Each entry number is assigned to the physical table information and the logical table information from the physical table information for managing the entry number associated with the data of each database system and the logical table information to be accessed from the user system. In addition to managing the association, definition information for each table managed by the database system is held.
Query sentence analysis department. The query statement analysis unit generates a query graph from a query statement input from the user system, performs decomposition processing on the query graph with reference to the logical table, physical table information, and table definition information. Decide the corresponding subquery and data relocation plan.
Result size estimation unit. The result size estimation unit is called from the query statement analysis unit and estimates the result size of the subquery statement.
Query statement generator. The execution plan generation unit is called from the query statement analysis unit and generates the subquery statement.
Execution plan generator. The execution plan generation unit generates an execution plan based on the output result of the query statement analysis unit.
Execution control unit. The execution plan generation unit executes an inquiry to the database system based on the execution plan output by the execution plan generation unit.

請求項2は、請求項1の仮想データベースシステム管理装置において、
前記クエリグラフに対する分解処理は、グラフノード間の関係について、
物理データベースが異なるエッジの削除、及び、前記テーブル定義情報を参照して多対多となるエッジの削除により前記クエリグラフを分解することを特徴としている。
Claim 2 is the virtual database system management apparatus according to claim 1,
The decomposition process for the query graph is related to the relationship between graph nodes.
The query graph is decomposed by deleting different edges in the physical database and deleting edges that are many-to-many with reference to the table definition information.

請求項3は、請求項2の仮想データベースシステム管理装置において、
前記多対多の関係は、分解されたクエリグラフを接続する各テーブルを紐づけるためのリレーションが、どちらも一意性制約のない項目の場合を指すことを特徴としている。
Claim 3 is the virtual database system management device of claim 2,
The many-to-many relationship is characterized in that the relation for associating the tables connecting the decomposed query graphs is an item with no uniqueness constraint.

請求項4は、請求項1の仮想データベースシステム管理装置において、
前記問合せ文解析部は、
前記ユーザシステムからの問合せ文に対して、前記クエリグラフの分解処理を行って各グラフに対応する副問合せ文を作成し、前記各副問合せ文から推定される結果サイズについて、予め決められた基準により「十分大きい」及び「ほぼ等しい」で区別される順序で整列させる機能を備え、
前記結果サイズの整列結果に「十分大きい」が1つ以上存在する場合に、もっとも大きい副問合せ文に対し、他の副問合せ文の結果との結合により、結果サイズを小さくできると推定された副問合せ文を1つ選択し、選択された分解グラフの副問合せ文の実行結果にリンクするテーブルを前記論理テーブル情報に追加する機能を備え、
前記問合せ実行部は、
前記問合せ入力解析部が決定した実行順序に基づいて前記単独データベース副問合せ文の実行結果となるテーブルを前記物理データベース管理情報に追加するデータ再配置を行う機能を備えることを特徴としている。
Claim 4 is the virtual database system management apparatus of claim 1,
The query statement analysis unit
For the query statement from the user system, the query graph is decomposed to create a subquery statement corresponding to each graph, and a predetermined criterion for a result size estimated from each subquery statement Has the function of aligning in an order distinguished by “sufficiently large” and “approximately equal”,
When one or more “sufficiently large” exists in the result size alignment result, it is estimated that the result size can be reduced by combining the largest subquery statement with the result of another subquery statement. A function of selecting one query statement and adding a table linked to the execution result of the subquery statement of the selected decomposition graph to the logical table information;
The inquiry execution unit
It has a function of performing data rearrangement for adding a table as an execution result of the single database subquery statement to the physical database management information based on the execution order determined by the query input analysis unit.

請求項5は、請求項4の仮想データベースシステム管理装置において、
前記「十分大きい」は、前記結果サイズの相違が二桁以上である場合であり、
前記「ほぼ等しい」は、前記結果サイズの相違が一桁以下である場合である
ことを特徴としている。
Claim 5 is the virtual database system management device of claim 4,
The “sufficiently large” is a case where the result size difference is two or more digits,
The “substantially equal” is characterized in that the result size difference is one digit or less.

請求項6は、複数のデータベースシステムが接続され、ユーザシステムからの問合せ文に応じてデータが出力される仮想データベースシステム管理方法において、
前記各データベースシステムのデータに関連付けたエントリ番号を管理する物理テーブル情報と、前記ユーザシステムからのアクセス対象となる論理テーブル情報とから、前記物理テーブル情報と前記論理テーブル情報に対して各エントリ番号を紐付けて管理するとともに、前記データベースシステムで管理される各テーブルに対する定義情報を保有する一方、
前記問合せ文からクエリグラフを生成し、前記論理テーブル、物理テーブル情報、テーブル定義情報を参照して、前記クエリグラフに対して分解処理を行って対応する副問合せ文を生成する手順と、
前記副問合せ文の結果サイズを推定する手順と、
前記副問合せ文に対して、前記推定された結果サイズに基づいて副問合せ文の実行順序及び実行結果のデータ配置を決定する手順と、
前記決定した実行順序に基づいて副問合せ文を実行する手順と
を含むことを特徴としている。
Claim 6 is a virtual database system management method in which a plurality of database systems are connected and data is output in response to a query statement from a user system.
Each entry number is assigned to the physical table information and the logical table information from the physical table information for managing the entry number associated with the data of each database system and the logical table information to be accessed from the user system. While linking and managing, while holding definition information for each table managed in the database system,
A procedure for generating a query graph from the query statement, referring to the logical table, physical table information, table definition information and performing a decomposition process on the query graph to generate a corresponding subquery statement;
A procedure for estimating a result size of the subquery statement;
A procedure for determining the execution order of the subquery statement and the data arrangement of the execution result based on the estimated result size for the subquery statement;
And a procedure for executing a subquery based on the determined execution order.

請求項7は、仮想データベースシステム管理方法において、
請求項6に記載の各手順は、前記クエリグラフに対して分解処理を行ったグラフ(要素)が一つになるまで繰り返して行うことを特徴としている。
Claim 7 is the virtual database system management method,
Each procedure according to claim 6 is repeatedly performed until the number of graphs (elements) subjected to the decomposition processing on the query graph becomes one.

請求項8は、請求項1に記載の各部をコンピュータ上に構築する仮想データベースシステム管理プログラムであり、
前記クエリグラフに対する分解処理は、グラフノード間の関係について、
物理データベースが異なるエッジの削除、及び、前記テーブル定義情報を参照して多対多となるエッジの削除により前記クエリグラフを分解し、分解されたクエリグラフに対応する副問合せ文を生成する処理を行うことを特徴としている。
Claim 8 is a virtual database system management program that builds each part of claim 1 on a computer,
The decomposition process for the query graph is related to the relationship between graph nodes.
Processing for generating a subquery statement corresponding to the decomposed query graph by deleting the edge in which the physical database is different and decomposing the query graph by deleting the edge that becomes many-to-many with reference to the table definition information It is characterized by doing.

本発明によれば、複数のデータベースシステムが存在する環境下の仮想データベースシステム管理装置において、問合せ文から各データベースシステムに対する副問合せ文を生成するに際し、問合せ文からから生成されるクエリグラフに対して、グラフノード間の関係について、物理データベースが異なるエッジや、多対多となるエッジを削除して分解処理を行って各副問合せ文を作成して実行計画を生成する。
そのため、問合せ文から副問合せ文を生成するに際し、直積による中間結果の肥大化を避けた副問合せ文を生成するため、仮想データベースシステムにおける問合せ文の処理効率を向上させることができる。
According to the present invention, in a virtual database system management apparatus in an environment where a plurality of database systems exist, when generating a subquery for each database system from a query statement, a query graph generated from the query statement is generated. As for the relationship between the graph nodes, an edge in which the physical database is different or an edge that is many-to-many is deleted and decomposed to create each subquery statement to generate an execution plan.
Therefore, when generating a subquery from a query, a subquery that avoids the enlargement of intermediate results due to a direct product is generated, so that the processing efficiency of the query in the virtual database system can be improved.

本発明の仮想データベースシステム管理装置の構成を示すブロック図である。It is a block diagram which shows the structure of the virtual database system management apparatus of this invention. 問合せ文解析部における処理手順を示すフローチャート図である。It is a flowchart figure which shows the process sequence in a query sentence analysis part. 問合せ文Qの例である。It is an example of the query sentence Q. 論理テーブル情報、物理テーブル情報、テーブル定義情報が表示された仮想データベースシステム構成図である。It is a virtual database system block diagram on which logical table information, physical table information, and table definition information are displayed. 問合せ文から生成したクエリグラフの例である。It is an example of the query graph produced | generated from the query sentence. 分解後のクエリグラフの例である。It is an example of the query graph after decomposition | disassembly. 副問合せ文の例である。It is an example of a subquery. 接続後のクエリグラフの例である。It is an example of the query graph after a connection. データ保持状況(TBL_Q3追加時)が表示された仮想データベースシステム構成図である。It is a virtual database system block diagram in which the data retention status (when TBL_Q3 is added) is displayed. 副問合せ文(ループ2回目)の例である。It is an example of a subquery sentence (loop 2nd time). 接続後(ループ2回目)のクエリグラフの例である。It is an example of the query graph after connection (loop 2nd time). データ保持状況(TBL_Q2追加時)が表示された仮想データベースシステム構成図である。It is a virtual database system block diagram in which the data retention status (when TBL_Q2 is added) is displayed. 最後に得られる副問合せ文の例である。It is an example of the subquery sentence obtained at the end. 書き換え後の副問合せ文の例である。It is an example of the subquery sentence after rewriting. データ保持状況(TBL_Q1追加時)が表示された仮想データベースシステム構成図である。It is a virtual database system block diagram in which the data retention status (when TBL_Q1 is added) is displayed.

本発明の仮想データベースシステム管理装置の実施形態の一例について、図面を参照して説明する。
仮想データベースシステムは、同一データを保有する複数のデータベースシステムが存在する環境において、ユーザの問合せ内容に応じてデータベースシステムを選択して問合せ内容を実行可能とするシステムであり、図1に示すように、ユーザが問合せ文の投稿を行うユーザシステム1と、仮想データシステム管理装置2と、仮想データシステム管理装置2が利用する1つ以上のデータベースシステム3から構成されている。ユーザシステム1、仮想データシステム管理装置2及びデータベースシステム3は、ネットワークを介して接続されている。仮想データシステム管理装置2は、仮想データベースシステム管理プログラムが格納された記録媒体やインターネットを介してソフトウエアのダウンロードによりインストールすることで、コンピュータ上に構築されている。
An example of an embodiment of a virtual database system management apparatus of the present invention will be described with reference to the drawings.
The virtual database system is a system that enables execution of query contents by selecting a database system according to the query contents of the user in an environment where a plurality of database systems having the same data exist, as shown in FIG. The system includes a user system 1 on which a user posts an inquiry, a virtual data system management device 2, and one or more database systems 3 used by the virtual data system management device 2. The user system 1, the virtual data system management device 2, and the database system 3 are connected via a network. The virtual data system management device 2 is constructed on a computer by installing it by downloading software via a recording medium storing a virtual database system management program or the Internet.

仮想データベースシステム管理装置が構築されるコンピュータは、オペレーティングシステム(OS)を含む基本プログラムや各種の基本デバイスが記憶されたROMと、各種のプログラムやデータが記憶されるハードディスクドライブ装置(HDD)と、CD−ROMやDVD等の記憶媒体からプログラムやデータを読み出すメディアドライブ装置と、プログラムを実行するCPUと、このCPUにワークエリアを提供するRAMと、入出力インターフェース(I/F)を介して接続されたディスプレイ、キーボードおよびマウス等のポインティングデバイスと、外部装置と通信するパラレル/シリアルI/Fとを主要部分とする一般的な構成を備えている。
本実施形態の仮想データベースシステム管理装置2では、仮想データベースシステム管理プログラムがシリアル/パラレルI/Fから入力、またはメディアドライブ装置で読み取られてHDDに予め記憶される。仮想データベースシステム管理プログラムは記憶媒体に記憶され、メディアドライブ装置で読み取られてHDDにインストールされる。
The computer in which the virtual database system management apparatus is constructed includes a ROM that stores a basic program including an operating system (OS) and various basic devices, a hard disk drive (HDD) that stores various programs and data, A media drive device that reads programs and data from a storage medium such as a CD-ROM or DVD, a CPU that executes the programs, a RAM that provides a work area for the CPU, and an input / output interface (I / F) A general configuration mainly includes a pointing device such as a display, a keyboard and a mouse, and a parallel / serial I / F communicating with an external device.
In the virtual database system management apparatus 2 of the present embodiment, a virtual database system management program is input from a serial / parallel I / F or read by a media drive device and stored in advance in an HDD. The virtual database system management program is stored in a storage medium, read by the media drive device, and installed in the HDD.

コンピュータ上に構築された仮想データベースシステム管理装置2は、複数のデータベースシステム3が存在する環境において、ユーザからのアクセス対象となる論理データベース情報(データベース、テーブル)を定義し、それらに対し、各データベースシステムにおける1つあるいは複数のデータベースマネジメントシステム、データベース、テーブルの組を割り当てる。   A virtual database system management device 2 constructed on a computer defines logical database information (database, table) to be accessed by a user in an environment where a plurality of database systems 3 exist, and each database Assign one or more database management systems, databases, and table sets in the system.

ユーザシステム1は、仮想データベースシステム管理装置2が提供する統合データモデルを利用した問合せ文を投稿することで、透過的に複数のデータベースシステム3に対する問合せ文の処理結果を取得する。   The user system 1 transparently acquires query statement processing results for a plurality of database systems 3 by posting a query statement using an integrated data model provided by the virtual database system management device 2.

データベースシステム3は、実際にデータを保管するデータベース31と、データに対する処理を提供するデータベースマネジメントシステム32からなり、データベースマネジメントシステム32が持つインタフェース経由でデータベース31上のデータに対する処理を提供する。   The database system 3 includes a database 31 that actually stores data and a database management system 32 that provides processing for the data. The database system 3 provides processing for data on the database 31 via an interface of the database management system 32.

仮想データベースシステム管理装置2は、複数のデータベースシステム3と接続されるデータベースインタフェース部21と、データベースインタフェース部21を介して各データベースシステム3の情報を取得し管理するデータベース管理部22と、ユーザシステム1との入出力を行うユーザインタフェース部23と、ユーザシステム1からの問合せ文の解析を行う問合せ入力解析部24と、問合せ文から各データベースシステム3への副問合せ文の生成を行う問合せ文生成部25と、副問合せ文の結果サイズを推定する結果サイズ推定部26と、一連の副問合せ文の実行計画を生成する実行計画生成部27と、副問合せ文を実行する実行制御部28と、を備えて構成されている。   The virtual database system management device 2 includes a database interface unit 21 connected to a plurality of database systems 3, a database management unit 22 that acquires and manages information of each database system 3 via the database interface unit 21, and a user system 1 A user interface unit 23 for inputting / outputting data, a query input analyzing unit 24 for analyzing a query statement from the user system 1, and a query statement generating unit for generating a subquery statement from the query statement to each database system 3 25, a result size estimation unit 26 that estimates a result size of a subquery statement, an execution plan generation unit 27 that generates an execution plan of a series of subquery statements, and an execution control unit 28 that executes a subquery statement It is prepared for.

ユーザインタフェース部23は、ユーザシステム1からの問合せ文を受け付け、問合せ文解析部24へ出力する。   The user interface unit 23 receives an inquiry sentence from the user system 1 and outputs it to the inquiry sentence analysis unit 24.

データベース管理部22は、データベース31に関連付けたエントリ番号を管理する物理テーブル情報と、ユーザシステム1からのアクセス対象となる論理データベースを定義し、物理テーブルのデータに対して、対応する各エントリ番号を紐付けて管理する論理テーブル情報とを格納するテーブル情報データベース221と、データベース31で管理されるテーブルに対する定義情報を格納するテーブル定義情報データベース222とを備えることで、各データベースシステム3の情報を管理している。   The database management unit 22 defines physical table information for managing entry numbers associated with the database 31 and a logical database to be accessed from the user system 1, and sets each entry number corresponding to the physical table data. The table information database 221 that stores logical table information that is managed in association with each other and the table definition information database 222 that stores definition information for the tables managed in the database 31 are provided to manage the information of each database system 3. doing.

問合せ文解析部24は、ユーザインタフェース部23を経由して入力される問合せ文の構文を解析し、解析結果を実行計画生成部27へ出力する。また、問合せ文分解析部24は、問合せ文の構文解析に際して、データベース管理部22に格納されたデータベースシステム3の論理テーブル情報、物理テーブル情報、テーブル定義情報を参照し、適切な副問合せ文とデータ再配置を決定する。適切な副問合せ文とは、問合せ文に対して分解処理を施したクエリグラフの要素(グラフ)単位の副問合せ文を意味する。クエリグラフの要素(グラフ)単位の副問合せ文とすることで、直積を含む副問合せ文となることを防止できる。
適切な副問合せ文の算出及びデータ再配置の決定に関する問合せ文解析部24における処理については後述する。
The query statement analysis unit 24 analyzes the syntax of the query statement input via the user interface unit 23 and outputs the analysis result to the execution plan generation unit 27. In addition, the query statement analysis unit 24 refers to the logical table information, physical table information, and table definition information of the database system 3 stored in the database management unit 22 in the syntax analysis of the query statement. Determine data relocation. An appropriate subquery sentence means a subquery sentence in an element (graph) unit of a query graph obtained by performing a decomposition process on the query sentence. By making a subquery sentence in units of elements (graphs) of the query graph, it is possible to prevent a subquery sentence including a direct product.
Processing in the query statement analysis unit 24 regarding calculation of an appropriate subquery statement and determination of data rearrangement will be described later.

問合せ文生成部25は、問合せ文解析部24から呼び出され、問合せ文に対して分解処理を施したクエリグラフの要素(グラフ)単位の副問合せ文の生成、及び、副問合せ文によるデータ再配置に伴う問合せ文の変換を行う。
結果サイズ推定部26は、問合せ文解析部24から呼び出され、与えられた副問合せ文を実行する場合の結果サイズを推定する。
実行計画生成部27は、問合せ文解析部24の出力結果を基に、決定された一連の問合せ文(副問合せ文と変換した問合せ文)の実行計画を生成する。
The query statement generation unit 25 is called from the query statement analysis unit 24, generates a subquery statement for each element (graph) of the query graph obtained by performing decomposition processing on the query statement, and rearranges data by the subquery statement Performs query statement conversion associated with.
The result size estimation unit 26 is called from the query statement analysis unit 24 and estimates the result size when executing a given subquery statement.
The execution plan generation unit 27 generates an execution plan for the determined series of query statements (subquery statement and converted query statement) based on the output result of the query statement analysis unit 24.

実行制御部28は、実行計画生成部27にて生成された実行計画を実行し、データベースインタフェース部21を介して副問合せ文を実行し、実行結果についてユーザインタフェース部23を介してユーザシステム1へ出力する。   The execution control unit 28 executes the execution plan generated by the execution plan generation unit 27, executes the subquery statement via the database interface unit 21, and sends the execution result to the user system 1 via the user interface unit 23. Output.

次に、仮想データベースシステム管理装置2において、ユーザインタフェース部23を介してユーザシステム1から入力された問合せ文に対する問合せ文解析部24での詳細処理(仮想データベースシステム管理方法)について、図2のフローチャートを参照して説明する。
ユーザシステム1は、仮想データベースシステム管理装置2のユーザインタフェース部23へ問合せ文Qを入力する。仮想データベースシステム管理装置2の問合せ文解析部24は、ユーザインタフェース部21から問合せ文が入力されると、図2に示す処理フローを実行する。
以下、図3に示したTPC−Hベンチマークの問合せ文Q5(TPC−Hベンチマーク22種のうちの一つ)を例として、問合せ文解析部24における処理手順について説明する。
Next, in the virtual database system management apparatus 2, detailed processing (virtual database system management method) in the query statement analysis unit 24 for the query statement input from the user system 1 via the user interface unit 23 is shown in the flowchart of FIG. Will be described with reference to FIG.
The user system 1 inputs an inquiry sentence Q to the user interface unit 23 of the virtual database system management apparatus 2. When the query statement is input from the user interface unit 21, the query statement analysis unit 24 of the virtual database system management apparatus 2 executes the processing flow shown in FIG.
Hereinafter, the processing procedure in the query statement analysis unit 24 will be described by taking the query statement Q5 (one of 22 types of TPC-H benchmarks) of the TPC-H benchmark shown in FIG. 3 as an example.

図1に対して、論理テーブル情報と物理テーブル情報とを紐づける対応関係、及び、テーブル定義情報が明示された仮想データベースシステムの構成図を図4に示す。
仮想データベースシステム管理装置2に対して2つのデータベース31(DB1及びDB2)が接続され、データベースDB1にはテーブルlineitemが配置され、データベースDB2にはテーブルcustomer,orders,supplier,nation,regionが配置されているものとする。
そして、テーブル情報データベース221には、紐付けを行うためのエントリ番号(P1〜P6)、データベース31の種別(DB1又はDB2)、データベース31におけるテーブルの種別(lineitem、customer,orders,supplier,nation,region)を対応づけた物理テーブル情報と、ユーザシステム1からアクセス対象となる論理テーブル情報とが管理されている。論理テーブル情報では、テーブル種別(lineitem、customer,orders,supplier,nation,region)に対して、対応する各エントリ番号を紐付けたリンク項目(P1〜P6)が設定されることで、保存先のデータベース31(データベースDB1又はデータベースDB2)を対応づけている。
FIG. 4 shows a configuration diagram of the virtual database system in which the correspondence relationship between the logical table information and the physical table information and the table definition information are clearly shown in FIG.
Two databases 31 (DB1 and DB2) are connected to the virtual database system management apparatus 2, a table lineitem is arranged in the database DB1, and tables customer, orders, suppliers, nations, and regions are arranged in the database DB2. It shall be.
The table information database 221 includes entry numbers (P1 to P6) for association, the type of the database 31 (DB1 or DB2), and the type of table in the database 31 (lineitem, customer, orders, supplier, nation, The physical table information associated with the region) and the logical table information to be accessed from the user system 1 are managed. In the logical table information, link items (P1 to P6) in which corresponding entry numbers are linked to the table type (lineitem, customer, orders, supplier, nation, region) are set, so that the storage destination is stored. The database 31 (database DB1 or database DB2) is associated.

テーブル定義情報データベース222としては、各テーブル種別(lineitem、customer,orders,supplier,nation,region)に対する定義情報が保存されている。例えば、テーブルcustomerに対して、「C_CUSTKEY INTEGER NOT NULL unique」、「C_NATIONKEY INTEGER NOT NULL」等の複数個の定義情報が保存されている。ここで、定義情報に「unique」又は「primary key」等が存在する場合、他のテーブルに対して一意性制約があることを意味し、「unique」及び「primary key」等のない場合は、一意性制約がなく複数のテーブルと接続可能なテーブルであることを意味している。   The table definition information database 222 stores definition information for each table type (lineitem, customer, orders, supplier, nation, region). For example, a plurality of pieces of definition information such as “C_CUSTKEY INTEGER NOT NULL unique” and “C_NATIONKEY INTEGER NOT NULL” are stored for the table customer. Here, if "unique" or "primary key" etc. exists in the definition information, it means that there is a uniqueness constraint for other tables, and if there is no "unique" and "primary key" etc., This means that there is no uniqueness constraint and the table can be connected to multiple tables.

先ず、問合せ文解析部24へ問合せ文が入力されると、問合わせ文のデータ入手元となるcustomer, orders, lineitem, supplier, nation, regionに対して、図5のようなクエリグラフが生成される(ステップ101)。グラフノードは、問合せ文のテーブルに対応し、グラフノード間のエッジは、問合せ文のテーブル同士を紐づけるリレーションで構成される。
すなわち、図3のfrom以下のデータ列から、customer, orders, lineitem, supplier, nation, regionがグラフノード(問合せ文のテーブルに対応)となり、where以下のデータから、customerとorders、lineitemとorders、、lineitemと supplier、customerとsupplier、supplierと nation、nationとregionが紐づけられる。また、図3のwhere以下のデータ列から、regionとordersのテーブルにおいては、データの範囲が指定される。
First, when a query statement is input to the query statement analysis unit 24, a query graph as shown in FIG. 5 is generated for customer, orders, lineitem, supplier, nation, and region from which the query statement data is obtained. (Step 101). A graph node corresponds to a table of query statements, and an edge between graph nodes is composed of a relation that links the tables of query statements.
That is, customer, orders, lineitem, supplier, nation, region are graph nodes (corresponding to the query statement table) from the data string below from in FIG. 3, and customer and orders, lineitem and orders, , Lineitem and supplier, customer and supplier, supplier and nation, nation and region. Further, the data range is specified in the region and orders table from the data string below where in FIG.

次に、生成したクエリグラフ(図5)に対して、分解処理をする(ステップ102)。分解処理に際しては、先ず、テーブル情報データベース221の論理テーブル情報及び物理テーブル情報を参照し、物理的なテーブル配置先を確認する。グラフノード間の関係について、物理データベースが異なるエッジを削除し、クエリグラフを分解する。図5のクエリグラフでは、lineitem がデータベースDB1に格納され、他のグラフノード(テーブル)がデータベースDB2に格納されているので、lineitemとorders間、lineitemとsupplier間が分解点となる。すなわち、lineitemとorders、lineitemとsupplierでは、物理データベースが異なるので、エッジを削除してエリグラフを分解する。   Next, decomposition processing is performed on the generated query graph (FIG. 5) (step 102). In the decomposition process, first, the logical table information and physical table information in the table information database 221 are referred to, and the physical table placement destination is confirmed. For relationships between graph nodes, the physical database deletes different edges and decomposes the query graph. In the query graph of FIG. 5, since lineitem is stored in the database DB1 and other graph nodes (tables) are stored in the database DB2, the lineitem and orders and the lineitem and supplier are the decomposition points. That is, since the physical database is different between lineitem and orders, and lineitem and supplier, the edges are deleted and the elligraph is decomposed.

また、テーブル定義情報データベース222のテーブル定義情報を参照し、多対多となるエッジを削除し、同様にクエリグラフを分解する。多対多の関係とは、テーブルを紐づけるためのリレーションが、どちらも一意性制約のない項目の場合を指す。
例えば、customer−orders のリレーションである c_custkey = o_custkey は、テーブル定義情報(図4)によると、c_custkey に unique が含まれいるので、一意性制約があるのでcustomer−orders間では分解しない。
一方、customer−supplier のリレーションである c_nationkey = s_nationkey は、どちらの項目も、unique などの一意性制約を確認できないため、多対多と判断する。この操作により、customerとsupplier 間を分解点としてエッジを削除してクエリグラフを分解する。
Further, the table definition information in the table definition information database 222 is referred to, edges that are many-to-many are deleted, and the query graph is similarly decomposed. The many-to-many relationship refers to the case where the relation for linking tables is an item that has no uniqueness constraint.
For example, according to the table definition information (FIG. 4), c_custkey = o_custkey, which is a customer-orders relationship, does not decompose between customer-orders because c_custkey includes unique, and there is a uniqueness constraint.
On the other hand, c_nationkey = s_nationkey, which is the customer-supplier relation, is judged as many-to-many because neither item can confirm a unique constraint such as unique. With this operation, the query graph is decomposed by deleting edges with the decomposition point between customer and supplier.

上記処理による分解後のクエリグラフG1〜G3を、図6に示す。この分解されたクエリグラフに対応する副問合せ文は、直積などの中間結果サイズが膨大になる副問合せ文が排除されるので、仮想データベースシステム管理装置において効率的な問合せ処理が可能となる。   FIG. 6 shows query graphs G1 to G3 after decomposition by the above processing. The sub-query sentence corresponding to the decomposed query graph eliminates a sub-query sentence having a large intermediate result size such as a direct product, so that efficient query processing can be performed in the virtual database system management apparatus.

続いて、分解されたクエリグラフを用いて、問合せ文Qに対する副問合せ文の結果再配置を考慮した実行順序が組み立てられる。
問合せ文Qに対して分解されたクエリグラフの分解グラフリストを{Gi}とし、問合せ文リストを{φ}とする(ステップ103)。分解グラフリスト{Gi}は、前処理のステップ102で得られた{G1、G2、G3}である。問合せ文リスト{φ}は、当初、空集合となっている。問合せ文Qは、ユーザシステム1から入力された問合せ文である。
Subsequently, using the decomposed query graph, an execution order that considers the result rearrangement of the subquery statement for the query statement Q is assembled.
The decomposition graph list of the query graph decomposed with respect to the query sentence Q is set as {Gi}, and the query sentence list is set as {φ} (step 103). The decomposition graph list {Gi} is {G1, G2, G3} obtained in step 102 of the preprocessing. The query statement list {φ} is initially an empty set. The query sentence Q is a query sentence input from the user system 1.

先ず、分解グラフリスト{Gi}の要素数iが1より大きいか否かを判断する(ステップ104)。
図3の問合せ文(TPCH−Q5)の場合、対応する分解グラフリスト{Gi}の要素数は「3」であり「2」つ以上となる(要素数iが1より大きい)ので、分解グラフリスト{Gi}の各要素Giに対応する副問合せ文Qiを生成する(ステップ105)。
要素(グラフ)に対応する副問合せ文とは、問合せ文Qを各グラフのノードに含まれるテーブルのみで問合せ文を書き表すことである。各要素Giに対応して生成される副問合せ文Qは、図7のようになる。図6における分解グラフリストG1、G2、G3は、それぞれ副問合せ文Q1、Q2、Q3に対応している。
First, it is determined whether or not the number i of elements in the decomposition graph list {Gi} is greater than 1 (step 104).
In the case of the query statement (TPCH-Q5) in FIG. 3, the number of elements in the corresponding decomposition graph list {Gi} is “3”, which is “2” or more (the number i of elements is greater than 1). A subquery sentence Qi corresponding to each element Gi of the list {Gi} is generated (step 105).
The sub-query sentence corresponding to the element (graph) is to write the query sentence with only the table included in the node of each graph. A subquery sentence Q generated corresponding to each element Gi is as shown in FIG. The decomposition graph lists G1, G2, and G3 in FIG. 6 correspond to the subquery statements Q1, Q2, and Q3, respectively.

次に、生成された各副問合せ文{Qi}について、結果サイズ推定部26より出力結果サイズ{Size(Qi)}を推定し、順序整列する(ステップ106)。出力結果サイズはオーダーが分かればよく、厳密である必要はない。サイズによる順序整列は、出力結果サイズ{Qi}の要素について、「≫(十分大きい)」、「≒(ほぼ等しい)」により行われる。したがって、A≫Bは、「AはBより十分大きい」を意味し、A≒Bは、「AはBとほぼ等しい(A≫BでもB≫Aでもない)」を意味する。
なお、「≫(十分大きい)」及び「≒(ほぼ等しい)」は、予め決められた基準により分類される。例えば、「≫(十分大きい)」は、結果サイズがいずれかが1MB以上で、2桁程度以上の違いを意味する。例えば、一方の結果サイズが1MBの時、他方の結果サイズが100MBである場合は、「十分大きい」と判断する。また、結果サイズがそれぞれ1MBより小さい、あるいは結果サイズの相違が1桁以下である場合は、「ほぼ等しい」に分類する。
また、結果サイズによっては、「≫(十分大きい)」が3桁程度の違いを意味し、「ほぼ等しい」が2桁以下の違いを意味する場合もある。
Next, for each generated subquery {Qi}, the result size estimation unit 26 estimates the output result size {Size (Qi)} and arranges them in order (step 106). The output result size need only be known and need not be exact. The order alignment by size is performed by “>> (sufficiently large)” and “≈ (approximately equal)” for the elements of the output result size {Qi}. Therefore, A >> B means “A is sufficiently larger than B”, and A≈B means “A is almost equal to B (A >> B or B >> A is not)”.
Note that “>> (sufficiently large)” and “≈ (approximately equal)” are classified according to a predetermined criterion. For example, “>> (sufficiently large)” means that the result size is 1 MB or more and a difference of about two digits or more. For example, when one result size is 1 MB and the other result size is 100 MB, it is determined to be “sufficiently large”. Further, when the result sizes are smaller than 1 MB or the difference in the result sizes is one digit or less, it is classified as “almost equal”.
Also, depending on the result size, “>> (sufficiently large)” may mean a difference of about 3 digits, and “substantially equal” may mean a difference of 2 digits or less.

生成された各副問合せ文{Qi}のサイズに関して、≫が1つ以上存在しているかを判断し(ステップ107)、1つ以上存在している場合は、もっとも大きい副問合せ文に対し、他の副問合せ文の結果との結合により、結果サイズを小さくできると推定された副問合せ文を一つ選択、選択された副問合せ文に対応するグラフを結合、分解グラフリストGiから対象グラフを削除、問合せ文リストに選択した副問合せ文を追加、論理テーブル情報/物理テーブル情報の更新、の各処理が順次行われる(ステップ108)。   With respect to the size of each generated subquery sentence {Qi}, it is determined whether one or more >> exists (step 107). Select one subquery statement that is estimated to be able to reduce the result size by combining with the result of the subquery statement, combine the graphs corresponding to the selected subquery statement, and delete the target graph from the decomposition graph list Gi Then, the selected subquery statement is added to the query statement list, and the logical table information / physical table information update processing is sequentially performed (step 108).

すなわち、この例では、生成された各副問合せ文{Qi}について、Size(Q1)≫Size(Q2)≫Size(Q3)であったと仮定すると、順序整列の結果、≫が1つ以上存在しており、Q1の結果サイズがもっとも大きいことが分かる。これは、Q1の実行結果が膨大であり、問合せ処理をする上で、Q1の処理や中間結果転送がボトルネックになり得ることを示している。   That is, in this example, assuming that each generated subquery {Qi} is Size (Q1) >> Size (Q2) >> Size (Q3), there is one or more >> as a result of ordering. It can be seen that the result size of Q1 is the largest. This indicates that the execution result of Q1 is enormous and Q1 processing and intermediate result transfer can be a bottleneck in performing query processing.

そして、同じく順序整列結果より、Size(Q1)より結果サイズが小さいと推定される副問合せ文を{Qj}として、Size(Join(Q1、{Qj})の結果サイズを推定し、もっとも小さくなるQjを選択する。この例では、Size(Q1) ≫ Size(Join(Q1,Q2)) ≫ Size(Join(Q1,Q3))の順序整列であるので、Q3が選択されることになる。これは、データベースDB2で実行されたQ3結果を、Q1が実行されるデータベースDB1へ配置し、Join操作をすることで、処理ボトルネックであったQ1の結果サイズを小さくし、処理効率の改善が期待できることを意味する。   Similarly, from the result of ordering, the subquery sentence whose size is estimated to be smaller than Size (Q1) is {Qj}, and the result size of Size (Join (Q1, {Qj}) is estimated to be the smallest. In this example, Q3 is selected because the order of Size (Q1) >> Size (Join (Q1, Q2)) >> Size (Join (Q1, Q3)) is selected in this example. Q3 results executed in database DB2 are placed in database DB1 where Q1 is executed, and a join operation is performed to reduce the result size of Q1, which was a processing bottleneck, and to improve processing efficiency. Means you can.

分解グラフリストGiに対して、「TBL Q3」を接続し、G3を除外処理する。「TBL Q3」は、Q3の結果を一時的に格納するテーブルである。その結果、処理後のグラフは、図8に示すようになる。   “TBL Q3” is connected to the decomposition graph list Gi, and G3 is excluded. “TBL Q3” is a table that temporarily stores the result of Q3. As a result, the graph after processing is as shown in FIG.

続いて、問合せ文リストへ{Q3→1}を追加する。これは、Q3結果をデータベースDB1に再配置することを意味する。   Subsequently, {Q3 → 1} is added to the query statement list. This means that the Q3 result is rearranged in the database DB1.

データベースDB1に対して、Q3結果を一時的に再配置するため、データベース管理部22における論理テーブル情報及び物理テーブル情報を更新し、図9に示すように、論理テ−ブル情報に「TBL Q3」をP7に紐づけ、物理テーブル情報にP7とデータベースDB1を関連づけし、「TBL Q3」がデータベースDB1に再配置された状態になる。   In order to temporarily relocate the Q3 result to the database DB1, the logical table information and the physical table information in the database management unit 22 are updated, and “TBL Q3” is added to the logical table information as shown in FIG. Is linked to P7, P7 and database DB1 are associated with the physical table information, and "TBL Q3" is rearranged in database DB1.

続いて、処理フローのループ開始(ステップ104)へ戻り、分解グラフリストGi要素数が2つ以上であるかを判断する。
分解グラフリストGi要素数は2つであるので、各グラフに対応する副問合せ文を生成する。生成された副問合せ文を、図10に示す。副問合せ文のサイズ推定と順序整列により、Size(Q1)≫ Size(Q2)であったと仮定する。順序整列の結果、≫が1つ以上存在する。結果サイズを小さくできる組み合わせを探し、結果がSize(Join(Q1、Q2))であり、Q2を選択する。分解グラフリストG1に対して、「TBL Q2」を接続し、G2を除外する。
処理後のグラフを図11に示す。問合せ文リストに{Q2→1}を追加する。データベースDB1に対して、Q2結果を一時的に再配置するため、論理テーブル情報および物理テーブル情報を更新し、論理テーブル情報、物理テーブル情報、テーブル定義情報が明示された仮想データベースシステムの構成図は、図12のような状態になる。
Subsequently, the process returns to the loop start of the processing flow (step 104), and it is determined whether or not the number of decomposition graph list Gi elements is two or more.
Since the number of decomposition graph list Gi elements is two, a subquery statement corresponding to each graph is generated. The generated subquery is shown in FIG. It is assumed that Size (Q1) >> Size (Q2) by size estimation and order alignment of the subquery. As a result of ordering, one or more >> exists. A combination that can reduce the result size is searched, the result is Size (Join (Q1, Q2)), and Q2 is selected. “TBL Q2” is connected to the decomposition graph list G1, and G2 is excluded.
The graph after processing is shown in FIG. Add {Q2 → 1} to the query statement list. In order to temporarily relocate the Q2 result to the database DB1, the logical table information and the physical table information are updated, and the configuration diagram of the virtual database system in which the logical table information, the physical table information, and the table definition information are clearly shown. As shown in FIG.

再び、処理フローのループ開始(ステップ104)へ戻り、分解グラフリストGi要素数が2つ以上であるかを判断する。
分解グラフリストが{G1}の1つのみとなるため、ループを終了する。残ったグラフから、対応する副問合せ文を生成して、問合せ文リストに、Q1→DVSを追加する(ステップ109)。これは、Q1の結果を、仮想データベースシステム上に取得することを意味する。生成される副問合せ文を図13に示す。
Again, returning to the loop start of the processing flow (step 104), it is determined whether or not the number of decomposition graph list Gi elements is two or more.
Since there is only one decomposition graph list {G1}, the loop is terminated. A corresponding subquery is generated from the remaining graph, and Q1 → DVS is added to the query list (step 109). This means that the result of Q1 is acquired on the virtual database system. The generated subquery is shown in FIG.

問合せ文を、仮想データベースシステムに配置する「TBL Q1」に対応して書き換える(ステップ109)。書き換え後の問合せ文を図14に示す。論理テーブル情報、物理テーブル情報を更新し(ステップ109)、最終的な状態として、Q1の情報がテーブル定義情報に反映された仮想データベースシステムの構成図は、図15のようになる。   The query statement is rewritten corresponding to “TBL Q1” placed in the virtual database system (step 109). FIG. 14 shows the query sentence after rewriting. The logical table information and physical table information are updated (step 109), and as a final state, the configuration diagram of the virtual database system in which the information of Q1 is reflected in the table definition information is as shown in FIG.

図2に示す一連の処理フローを実行することにより、副問合せ文および、副問合せ文の結果再配置と順序、書き換えられた問合せ文が得られる。   By executing a series of processing flows shown in FIG. 2, a subquery sentence, a result rearrangement and order of the subquery sentence, and a rewritten query sentence are obtained.

上述した仮想データベースシステム管理装置、管理方法及び管理プログラムによれば、複数のデータベースシステム3が存在しそれらを統合的に扱う場合に、従来の仮想データベースシステムではボトルネックとなっていた、仮想データベースシステム管理装置2及び各データベースシステム3間での大量データのやり取りを一部解消することが可能となる。
そして、仮想データベースシステムにおいて、問合せ文から副問合せ文を生成するに際し、物理データベースが異なるエッジの削除、及び、前記テーブル定義情報を参照して多対多となるエッジの削除によりクエリグラフを分解するので、直積による中間結果の肥大化を避けた副問合せ文が生成でき、仮想データベースシステムにおける問合せ処理効率を向上することができる。
その結果、仮想データベースシステム管理装置2における問合せ処理が効率化され、処理に長時間を要していた事態、又は、リソース不足により異常終了するような事態を回避して問合せ結果を取得することが可能となる。
According to the above-described virtual database system management device, management method, and management program, when there are a plurality of database systems 3 and they are handled in an integrated manner, the virtual database system has become a bottleneck in the conventional virtual database system Part of the exchange of large amounts of data between the management apparatus 2 and each database system 3 can be eliminated.
In the virtual database system, when generating a subquery from a query statement, the physical database decomposes the query graph by deleting different edges and deleting the many-to-many edges by referring to the table definition information. Therefore, it is possible to generate a subquery that avoids the enlargement of the intermediate result due to the direct product, and the query processing efficiency in the virtual database system can be improved.
As a result, the query processing in the virtual database system management apparatus 2 is made more efficient, and it is possible to avoid the situation where the process takes a long time or the situation where the process ends abnormally due to a lack of resources, and the query result can be obtained. It becomes possible.

1…ユーザシステム、 2…仮想データベースシステム管理装置、 3…データベースシステム、 21…データベースインタフェース部、 22…データベース管理部、 23…ユーザインタフェース部、 24…問合せ文解析部、 25…問合せ文生成部、 26…結果サイズ推定部、 27…実行計画生成部、 28…実行制御部、 31…データベースマネジメントシステム、 32…データベース、 221…テーブル情報データベース、 222…テーブル定義情報データベース。   DESCRIPTION OF SYMBOLS 1 ... User system, 2 ... Virtual database system management apparatus, 3 ... Database system, 21 ... Database interface part, 22 ... Database management part, 23 ... User interface part, 24 ... Query sentence analysis part, 25 ... Query sentence generation part, 26 ... Result size estimation unit, 27 ... Execution plan generation unit, 28 ... Execution control unit, 31 ... Database management system, 32 ... Database, 221 ... Table information database, 222 ... Table definition information database

Claims (8)

複数のデータベースシステムが接続され、ユーザシステムからの問合せ文に応じてデータが出力される仮想データベースシステム管理装置において、
前記各データベースシステムのデータに関連付けたエントリ番号を管理する物理テーブル情報と、前記ユーザシステムからのアクセス対象となる論理テーブル情報とから、前記物理テーブル情報と前記論理テーブル情報に対して各エントリ番号を紐付けて管理するとともに、前記データベースシステムで管理される各テーブルに対する定義情報を保有する一方、
前記ユーザシステムから入力される問合せ文からクエリグラフを生成し、前記論理テーブル、物理テーブル情報、テーブル定義情報を参照して、前記クエリグラフに対して分解処理を行って対応する副問合せ文とデータ再配置計画を決める問合せ文解析部と、
前記問合せ文解析部から呼び出され、前記副問合せ文の結果サイズを推定する結果サイズ推定部と、
前記問合せ文解析部から呼び出され、前記副問合せ文を生成する問合せ文生成部と、
前記問合せ文解析部の出力結果を基に実行計画を生成する実行計画生成部と、
前記実行計画生成部が出力する実行計画を基に前記データベースシステムへの問い合わせを実行する実行制御部と、
を備えたことを特徴とする仮想データベースシステム管理装置。
In a virtual database system management apparatus in which a plurality of database systems are connected and data is output according to an inquiry from a user system,
Each entry number is assigned to the physical table information and the logical table information from the physical table information for managing the entry number associated with the data of each database system and the logical table information to be accessed from the user system. While linking and managing, while holding definition information for each table managed in the database system,
A query graph is generated from a query statement input from the user system, and a corresponding subquery statement and data are generated by performing decomposition processing on the query graph with reference to the logical table, physical table information, and table definition information. A query statement analysis unit that determines a relocation plan;
A result size estimation unit that is called from the query statement analysis unit and estimates a result size of the subquery statement;
A query statement generation unit that is called from the query statement analysis unit and generates the subquery statement;
An execution plan generation unit that generates an execution plan based on the output result of the query statement analysis unit;
An execution control unit that executes an inquiry to the database system based on the execution plan output by the execution plan generation unit;
A virtual database system management apparatus comprising:
前記クエリグラフに対する分解処理は、グラフノード間の関係について、
物理データベースが異なるエッジの削除、及び、前記テーブル定義情報を参照して多対多となるエッジの削除により前記クエリグラフを分解する
請求項1に記載の仮想データベースシステム管理装置。
The decomposition process for the query graph is related to the relationship between graph nodes.
The virtual database system management apparatus according to claim 1, wherein the query graph is decomposed by deleting an edge having a different physical database and deleting an edge that is many-to-many with reference to the table definition information.
前記多対多の関係は、分解されたクエリグラフを接続する各テーブルを紐づけるためのリレーションが、どちらも一意性制約のない項目の場合を指す請求項2に記載の仮想データベースシステム管理装置。   The virtual database system management apparatus according to claim 2, wherein the many-to-many relationship indicates a case in which a relation for linking tables that connect decomposed query graphs is an item that has no uniqueness constraint. 前記問合せ文解析部は、
前記ユーザシステムからの問合せ文に対して、前記クエリグラフの分解処理を行って各グラフに対応する副問合せ文を作成し、前記各副問合せ文から推定される結果サイズについて、予め決められた基準により「十分大きい」及び「ほぼ等しい」で区別される順序で整列させる機能を備え、前記結果サイズの整列結果に「十分大きい」が1つ以上存在する場合に、もっとも大きい副問合せ文に対し、他の副問合せ文の結果との結合により、結果サイズを小さくできると推定された副問合せ文を1つ選択し、選択された分解グラフの副問合せ文の実行結果にリンクするテーブルを前記論理テーブル情報に追加する機能を備え、
前記問合せ実行部は、
前記問合せ入力解析部が決定した実行順序に基づいて前記単独データベース副問合せ文の実行結果となるテーブルを前記物理データベース管理情報に追加するデータ再配置を行う機能を備えた
請求項1に記載の仮想データベースシステム管理装置。
The query statement analysis unit
For the query statement from the user system, the query graph is decomposed to create a subquery statement corresponding to each graph, and a predetermined criterion for a result size estimated from each subquery statement For the largest subquery when there is one or more “sufficiently large” in the alignment result of the result size. The logical table is a table that selects one subquery statement estimated to be able to reduce the result size by combining with the results of other subquery statements, and links to the execution result of the subquery statement of the selected decomposition graph. With the ability to add to information,
The inquiry execution unit
2. The virtual device according to claim 1, further comprising: a data relocation function that adds a table that is an execution result of the single database subquery statement to the physical database management information based on an execution order determined by the query input analysis unit. Database system management device.
前記「十分大きい」は、前記結果サイズの相違が二桁以上である場合であり、
前記「ほぼ等しい」は、前記結果サイズの相違が一桁以下である場合である
請求項4に記載の仮想データベースシステム管理装置。
The “sufficiently large” is a case where the result size difference is two or more digits,
The virtual database system management apparatus according to claim 4, wherein the “substantially equal” is a case where the difference in the result size is one digit or less.
複数のデータベースシステムが接続され、ユーザシステムからの問合せ文に応じてデータが出力される仮想データベースシステム管理方法において、
前記各データベースシステムのデータに関連付けたエントリ番号を管理する物理テーブル情報と、前記ユーザシステムからのアクセス対象となる論理テーブル情報とから、前記物理テーブル情報と前記論理テーブル情報に対して各エントリ番号を紐付けて管理するとともに、前記データベースシステムで管理される各テーブルに対する定義情報を保有する一方、
前記問合せ文からクエリグラフを生成し、前記論理テーブル、物理テーブル情報、テーブル定義情報を参照して、前記クエリグラフに対して分解処理を行って対応する副問合せ文を生成する手順と、
前記副問合せ文の結果サイズを推定する手順と、
前記副問合せ文に対して、前記推定された結果サイズに基づいて副問合せ文の実行順序及び実行結果のデータ配置を決定する手順と、
前記決定した実行順序に基づいて副問合せ文を実行する手順と
を含むことを特徴とする仮想データベースシステム管理方法。
In a virtual database system management method in which a plurality of database systems are connected and data is output according to a query statement from a user system,
Each entry number is assigned to the physical table information and the logical table information from the physical table information for managing the entry number associated with the data of each database system and the logical table information to be accessed from the user system. While linking and managing, while holding definition information for each table managed in the database system,
A procedure for generating a query graph from the query statement, referring to the logical table, physical table information, table definition information and performing a decomposition process on the query graph to generate a corresponding subquery statement;
A procedure for estimating a result size of the subquery statement;
A procedure for determining the execution order of the subquery statement and the data arrangement of the execution result based on the estimated result size for the subquery statement;
A virtual database system management method comprising: executing a subquery based on the determined execution order.
請求項6に記載の各手順は、前記クエリグラフに対して分解処理を行ったグラフ(要素)が一つになるまで繰り返して行う仮想データベースシステム管理方法。   The virtual database system management method according to claim 6, wherein each procedure is repeatedly performed until there is one graph (element) obtained by performing a decomposition process on the query graph. 請求項1に記載の各部をコンピュータ上に構築し、
前記クエリグラフに対する分解処理は、グラフノード間の関係について、
物理データベースが異なるエッジの削除、及び、前記テーブル定義情報を参照して多対多となるエッジの削除により前記クエリグラフを分解し、分解されたクエリグラフに対応する副問合せ文を生成する処理を行う仮想データベースシステム管理プログラム。
Each part according to claim 1 is constructed on a computer,
The decomposition process for the query graph is related to the relationship between graph nodes.
Processing for generating a subquery statement corresponding to the decomposed query graph by deleting the edge in which the physical database is different and decomposing the query graph by deleting the edge that becomes many-to-many with reference to the table definition information Virtual database system management program to be performed.
JP2015129265A 2015-06-26 2015-06-26 Virtual database system management apparatus, management method and management program Active JP6523823B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015129265A JP6523823B2 (en) 2015-06-26 2015-06-26 Virtual database system management apparatus, management method and management program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015129265A JP6523823B2 (en) 2015-06-26 2015-06-26 Virtual database system management apparatus, management method and management program

Publications (2)

Publication Number Publication Date
JP2017016208A true JP2017016208A (en) 2017-01-19
JP6523823B2 JP6523823B2 (en) 2019-06-05

Family

ID=57829222

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015129265A Active JP6523823B2 (en) 2015-06-26 2015-06-26 Virtual database system management apparatus, management method and management program

Country Status (1)

Country Link
JP (1) JP6523823B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116610714A (en) * 2023-07-14 2023-08-18 北京数巅科技有限公司 Data query method, device, computer equipment and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7472078B2 (en) 2021-05-20 2024-04-22 株式会社東芝 Data virtualization apparatus and method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62211727A (en) * 1986-03-13 1987-09-17 Agency Of Ind Science & Technol Inquiry processing system for distributed data base
JP2000082080A (en) * 1993-08-05 2000-03-21 Hitachi Ltd Distributed data base management system
JP2003316811A (en) * 2002-04-22 2003-11-07 Ricoh Co Ltd Inquiry optimization processing device in different kind of database integration system, method and program making computer execute the method
JP2015045995A (en) * 2013-08-28 2015-03-12 Kddi株式会社 Virtual database system management device, management method and management program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62211727A (en) * 1986-03-13 1987-09-17 Agency Of Ind Science & Technol Inquiry processing system for distributed data base
JP2000082080A (en) * 1993-08-05 2000-03-21 Hitachi Ltd Distributed data base management system
JP2003316811A (en) * 2002-04-22 2003-11-07 Ricoh Co Ltd Inquiry optimization processing device in different kind of database integration system, method and program making computer execute the method
JP2015045995A (en) * 2013-08-28 2015-03-12 Kddi株式会社 Virtual database system management device, management method and management program

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
齋藤 和広、川島 英之、米田 信之、村松 茂樹、渡辺 泰之、小林 亜令: "データ仮想化システムにおけるクエリ分割実行方式の提案", 第7回データ工学と情報マネジメントに関するフォーラム (第13回日本データベース学会年次大会) [O, JPN6019002973, 4 March 2015 (2015-03-04), JP *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116610714A (en) * 2023-07-14 2023-08-18 北京数巅科技有限公司 Data query method, device, computer equipment and storage medium
CN116610714B (en) * 2023-07-14 2023-10-31 北京数巅科技有限公司 Data query method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
JP6523823B2 (en) 2019-06-05

Similar Documents

Publication Publication Date Title
JP6578333B2 (en) Managing data queries
US10521427B2 (en) Managing data queries
US10191943B2 (en) Decorrelation of user-defined function invocations in queries
JP6618461B2 (en) Metadata management system
KR102041168B1 (en) Processing queries containing a union-type operation
US20160098446A1 (en) Limiting scans of loosely ordered and/or grouped relations in a database
US9740713B1 (en) Dynamic modeling of data in relational databases
US11243958B2 (en) Implementing contract-based polymorphic and parallelizable SQL user-defined scalar and aggregate functions
JP6376947B2 (en) Virtual database system management apparatus, management method, and management program
Sharma et al. Stochastic Analysis of DSS Queries for a Distributed Database Design
US11599540B2 (en) Query execution apparatus, method, and system for processing data, query containing a composite primitive
JP6523823B2 (en) Virtual database system management apparatus, management method and management program
Reniers et al. Schema design support for semi-structured data: Finding the sweet spot between NF and De-NF
EP3086244A1 (en) Database system and method of operation thereof
JP2015045995A (en) Virtual database system management device, management method and management program
Schram Software architectures and patterns for persistence in heterogeneous data-intensive systems
WO2015177056A1 (en) Method and device fir allocating computing resources in the distributed processing of database queries
JP2015176276A (en) Data processing device and data processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180213

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190131

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190206

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190329

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190426

R150 Certificate of patent or registration of utility model

Ref document number: 6523823

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150