JPH10240753A - Database management system and storage medium used therein - Google Patents
Database management system and storage medium used thereinInfo
- Publication number
- JPH10240753A JPH10240753A JP9041856A JP4185697A JPH10240753A JP H10240753 A JPH10240753 A JP H10240753A JP 9041856 A JP9041856 A JP 9041856A JP 4185697 A JP4185697 A JP 4185697A JP H10240753 A JPH10240753 A JP H10240753A
- Authority
- JP
- Japan
- Prior art keywords
- data
- relation
- destination
- node
- storage
- 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.)
- Pending
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
(57)【要約】
【課題】 データ間の関連を用いた問い合わせ処理を高
速処理できるデータベース管理システムを提供するこ
と。
【解決手段】 関連先のデータを識別することができる
値を関連元のデータと関連先のデータに付加する関連の
あるデータの格納手段と、関連元のデータと関連先のデ
ータを結合する手段と、関連先のデータを識別する値か
ら関連先のデータをデータベースから取り出す手段と、
関連先データと関連元データを適切なノードに格納する
記憶手段と、データ間の関連を含む問い合わせを解析し
関連をもつデータの格納状態によって、最適な処理手順
を作成する解析手段と、関連先のデータと関連元のデー
タの格納状態を検知する手段と、検知した格納状態か
ら、与えられたデータ間の関連を用いた問い合わせに対
する最適な処理手順を決定するための情報を解析・格納
する情報解析手段からなる。
(57) [Summary] [PROBLEMS] To provide a database management system capable of high-speed processing of an inquiry using a relation between data. SOLUTION: Storage means for storing related data for adding a value capable of identifying related data to related data and related data, and means for combining related data and related data. Means for retrieving associated data from a database from a value identifying the associated data;
Storage means for storing related destination data and related source data in an appropriate node; analyzing means for analyzing an inquiry including a relationship between data and creating an optimum processing procedure according to a storage state of related data; Means for detecting the storage state of the original data and related data, and information for analyzing and storing information for determining an optimal processing procedure for an inquiry using a relation between given data based on the detected storage state It consists of analysis means.
Description
【0001】[0001]
【発明の属する技術分野】本発明は、データベース処理
装置に係り、特に、リレーショナルデータベース管理シ
ステムをオブジェクト指向拡張する場合における関連す
るデータを管理するのに適するデータベース管理システ
ムおよびそれに用いられる記憶媒体に関する。The present invention relates to a database processing apparatus, and more particularly to a database management system suitable for managing related data when an object-oriented extension of a relational database management system, and a storage medium used for the database management system.
【0002】[0002]
【従来の技術】関連をもつデータをデータベースで管理
する場合、関連をデータベース管理システムで管理する
ことができるオブジェクトデータベースが適している。
例えば、オブジェクトデータベースの標準のひとつであ
るオブジェクトデータベース標準:ODMG−93(R.
G.G.Cattel,et al.“THE OBJECT DATABASE STANDARD:OD
MG-93 Release 1.1”,Morgan Kaufmann Publishers, In
c.,1994)の仕様では、関連を扱うためのREF型をシ
ステムが提供することになっている。REF型はオブジ
ェクト(データ)を指すポインタである。関連をたどっ
てオブジェクトを参照するナビゲーションに適してい
る。また、関連の操作を高速化するために、関連をもつ
オブジェクト同士を一回のディスクアクセスで取得でき
るような位置(例えば、同じページ)に格納するクラス
タリングを格納操作時に指定することができる。個々の
オブジェクトのナビゲーションに対し高速化を図ること
が可能である。2. Description of the Related Art When managing related data in a database, an object database capable of managing the relationship in a database management system is suitable.
For example, one of the object database standards is an object database standard: ODMG-93 (R.
GGCattel, et al. “THE OBJECT DATABASE STANDARD: OD
MG-93 Release 1.1 ”, Morgan Kaufmann Publishers, In
c., 1994), the system is to provide a REF type for handling associations. The REF type is a pointer that points to an object (data). Suitable for navigation that follows an association and references an object. In addition, in order to speed up the related operation, it is possible to specify a clustering for storing related objects at a position (for example, the same page) where the related objects can be acquired by one disk access, at the time of the storing operation. It is possible to speed up the navigation of individual objects.
【0003】一方、リレーショナルデータベースでは、
膨大なデータに対しても対応できるように処理の並列化
の技術がある。問い合せの内容やデータの状態に応じて
最適な並列処理を選択する機能をもつシステム(特開平
6-214843)がある。現在、リレーショナルデータベース
をオブジェクト指向拡張する動きがある。その標準とし
て検討されているSQL3(Database Language SQL, ISO W
orking Draft, July 1996)などには、データ間の関連
を表現するREFが提案されている。On the other hand, in a relational database,
There is a technique for parallelizing processing so that it can handle a huge amount of data. A system having a function of selecting the optimal parallel processing according to the contents of an inquiry and the state of data
6-214843). Currently, there is a move to extend relational databases in an object-oriented manner. SQL3 (Database Language SQL, ISO W
orking Draft, July 1996) has proposed a REF that expresses the relationship between data.
【0004】[0004]
【発明が解決しようとする課題】従来技術には次のよう
な問題点がある。 (1)オブジェクトデータベースの関連は、オブジェク
トを指すポインタである。深く関連をたどるような処理
には有効であるが、膨大なデータを処理する場合には、
オブジェクト一つ一つについてナビゲーションを行なう
ために高速化が困難である。 (2)オブジェクトデータベースにおけるクラスタリン
グも、膨大なデータを処理する場合には、クラスタリン
グが成功する可能性が低くなるため有効ではない。さら
に、リレーショナルデータベースの拡張を考えた場合、
型の異なる(異なる表の)データを同一のページに格納
するのは困難である。The prior art has the following problems. (1) An object database association is a pointer to an object. This is useful for processing that is closely related, but when processing large amounts of data,
Speeding up is difficult because navigation is performed for each object. (2) Clustering in an object database is also ineffective when processing a large amount of data because the possibility of successful clustering is reduced. Furthermore, considering the expansion of a relational database,
It is difficult to store different types of data (from different tables) on the same page.
【0005】(3)リレーショナルデータベースでは、
データ間の関連をシステム側で直接管理することはでき
ない。一般にはデータベース設計者が関連するデータそ
れぞれにキーを定義し、その値を共有することでデータ
間の関連を実装している。 (4)リレーショナルデータベースのオブジェクト指向
拡張のデータ間の関連操作の高速化するための仕様が検
討されていない。問い合せの内容や格納されている関連
の状態によって最適な並列処理を選択する技術が確立し
ていない。本発明は、上記(1)から(4)の問題点を
解決し、関連操作を含む問い合せを問い合せ対象のデー
タ数に依存せずに高速に処理することを目的とする。(3) In a relational database,
The relationship between data cannot be managed directly by the system. In general, a database designer defines a key for each related data and implements a relation between the data by sharing the value. (4) The specification for speeding up the related operation between data of the object-oriented extension of the relational database has not been studied. The technology for selecting the optimal parallel processing according to the contents of the inquiry and the stored related state has not been established. An object of the present invention is to solve the above problems (1) to (4) and to process a query including a related operation at high speed without depending on the number of data to be queried.
【0006】[0006]
【課題を解決するための手段】本発明は、上記目的を達
成するために、データベース処理をする複数のノードを
備え、それぞれのノードは他のノードと接続されるデー
タベース管理システムにおいて、データとデータに関連
がある場合に、関連先のデータを識別することができる
値を関連元のデータと関連先のデータに付加する関連の
あるデータの格納手段と、関連元のデータと関連先のデ
ータに付加した関連先のデータを識別する値を突き合わ
せることで、関連元のデータと関連先のデータを結合す
る手段と、関連先のデータを識別する値から関連先のデ
ータをデータベースから取り出す手段と、問い合わせの
対象となる関連をもつデータを関連の種別にしたがっ
て、関連先データと関連元データを適切なノードに格納
する記憶手段と、データ間の関連を含む問い合わせを受
け付け、問い合わせを解析し、関連をもつデータの格納
状態によって、最適な処理手順を作成する解析手段と、
関連先のデータと関連元のデータの格納状態を検知する
手段と、検知した格納状態から、与えられたデータ間の
関連を用いた問い合わせに対する最適な処理手順を決定
するための情報を解析・格納する情報解析手段からな
る。In order to achieve the above object, the present invention comprises a plurality of nodes for performing database processing, and each of the nodes comprises a database management system connected to another node. When there is a relationship between the related data and the related data, a value that can identify the related data is added to the related data and the related data. Means for combining the data of the relation source and the data of the relation destination by matching the value for identifying the data of the relation added; means for extracting the data of the relation destination from the database from the value for identifying the data of the relation destination; Storage means for storing related destination data and related source data in an appropriate node in accordance with the type of the related data to be queried; Receiving a query that contains an association between data, analyzes the query, the storage state of data with associated, and analyzing means for creating an optimum procedure,
Means for detecting the storage state of the data of the relation destination and the data of the relation source, and analyzing and storing information for determining an optimal processing procedure for an inquiry using a relation between given data based on the detected storage state. Information analysis means.
【0007】[0007]
【発明の実施の形態】以下、本発明の実施例を図面に基
づいて詳細に説明する。図1は、関連操作を含む問い合
せの並列処理概要図である。問い合せを解析するまた
は、問い合せの結果を出力するノード(101)と関連
するデータの分配・結合を行なうノード(102)と関
連するデータの格納情報解析・管理するノード(10
5)と処理結果データのソート・マージを行なうノード
(106)は、ネットワーク(100)によって相互結
合している。関連するデータの分配・結合を行なうノー
ド(102)は、問い合せの対象となるデータ(11
0)を管理する。データは表という単位で管理される。
一つの表は150、170のように複数のノードに分割
して格納することができる。本例では表A(150)も
表B(170)も3つのノードに分割されている。デー
タ間の関連は、システムが管理する参照値を共有するこ
とによって実現する。Embodiments of the present invention will be described below in detail with reference to the drawings. FIG. 1 is a schematic diagram of a parallel processing of an inquiry including a related operation. A node (10) that analyzes a query or distributes and combines data related to a node (101) that outputs a query result and a node (10) that analyzes and manages storage information of related data
The node (106) for performing the sort / merge of the processing result data with the node (5) are interconnected by a network (100). The node (102) that distributes and combines related data sets the data (11
0) is managed. Data is managed in units called tables.
One table can be divided into a plurality of nodes such as 150 and 170 and stored. In this example, both Table A (150) and Table B (170) are divided into three nodes. The association between data is realized by sharing a reference value managed by the system.
【0008】表Aのデータ(160〜168)が表Bの
データ(180〜185)に対して関連をもつとする
と、151は関連先の参照値を保持するカラムである。
171は自分自身の参照値を保持するシステムが管理す
るからむである。この2つの参照値が等しいものを関連
があるデータと呼ぶ。この場合、表Aのデータは関連元
であり、表Bのデータは関連先である。この参照値をキ
ーとして結合を行なうことで関連操作を行なう。この関
連操作を行なうためには、関連するデータの格納状態に
よって最適な処理手段を選択する必要がある。Assuming that the data (160 to 168) in Table A is related to the data (180 to 185) in Table B, reference numeral 151 denotes a column for holding a reference value of a related destination.
This is because the system 171 manages its own reference value. Data in which these two reference values are equal is referred to as related data. In this case, the data in Table A is an association source, and the data in Table B is an association destination. A related operation is performed by performing a combination using the reference value as a key. In order to perform the related operation, it is necessary to select an optimal processing means depending on the storage state of the related data.
【0009】例えば、図7は、データがそれぞれのノー
ドに分散して格納されており、かつ、関連元と関連先の
データが同一のノードに格納された場合、関連操作を含
む問い合せ実行700の処理概略である。関連元と関連
先が同一のノードに格納されているため、関連操作はノ
ードをまたぐことがない。このため、関連操作処理71
0、711、712はノード毎に非同期な処理となり、
並列に実行することが可能である。ノード毎に処理され
た結果は、処理結果のソート・マージ713によってま
とめられる。関連の情報と格納状態は105のノードの
格納情報(111)に格納し、最適化時にアクセス可能で
ある。[0009] For example, FIG. 7 shows a case where data is distributed and stored in each node, and when the data of the relation source and the relation destination are stored in the same node, an inquiry execution 700 including a relation operation is performed. It is a processing outline. Since the relation source and the relation destination are stored in the same node, the relation operation does not straddle the node. Therefore, the related operation processing 71
0, 711, and 712 are asynchronous processes for each node,
It is possible to execute in parallel. The results processed for each node are collected by a sort / merge 713 of the processing results. The related information and the storage state are stored in the storage information (111) of the node 105 and can be accessed at the time of optimization.
【0010】図2は本発明の実施例のハードウエアの構
成を表している。中央演算装置や主記憶装置などからな
るデータ処理装置(211)とハードディスクなどのデ
ータ記憶装置(210)からなる処理装置の単位である
ノード(200)またはキーボードやディスプレイなど
のデータ入出力装置を加えたノード(201)を複数個
LANなどのネットワーク(100)で接続している。
それぞれのノードは、独立にデータベースシステムとし
て機能し、さらにネットワークを通してデータのやり取
りを行うことができる。この構成は複数のデータベース
システムがネットワークを介して相互に結合し、データ
処理を並列に行うシステムである。FIG. 2 shows a hardware configuration according to an embodiment of the present invention. A data processing device (211) including a central processing unit and a main storage device and a node (200) as a processing device unit including a data storage device (210) such as a hard disk, or a data input / output device such as a keyboard and a display are added. Nodes (201) are connected by a network (100) such as a LAN.
Each node independently functions as a database system and can exchange data through a network. This configuration is a system in which a plurality of database systems are mutually connected via a network to perform data processing in parallel.
【0011】図3は、各ノードが機能することが可能な
データベースシステムの概要図である。データベースシ
ステムは、ユーザが作成した複数のアプリケーションプ
ログラム303及び304と、アプリケーションプログ
ラムからのデータ操作や問い合せなどの処理やリソース
管理などデータベースシステム全体の管理を行なうデー
タベース管理システム300と、データが格納されるデ
ータベース301と、データベースの定義情報を格納す
るディクショナリ302から構成する。FIG. 3 is a schematic diagram of a database system in which each node can function. The database system stores a plurality of application programs 303 and 304 created by a user, a database management system 300 that manages the entire database system such as processing of data operations and inquiries from the application programs and resource management, and data. It comprises a database 301 and a dictionary 302 for storing database definition information.
【0012】データベース管理システム300は、論理
処理部310と物理処理部320とシステム制御部に分
割することができる。論理処理部310はアプリケーシ
ョンプログラムからの問い合せなどを解析・実行する。
アプリケーションプログラムから渡される問い合せはS
QLなどのデータベース問い合せ言語によって記述され
ている。問い合せ解析部311は、問い合せ文に対して
構文解析及び意味解析を行う。解析結果は静的最適化処
理312によって、問い合せに最適な処理手順を選択す
る。The database management system 300 can be divided into a logical processing unit 310, a physical processing unit 320, and a system control unit. The logic processing unit 310 analyzes and executes an inquiry from the application program.
The inquiry passed from the application program is S
It is described in a database query language such as QL. The query analysis unit 311 performs syntax analysis and semantic analysis on the query sentence. The analysis result selects the optimal processing procedure for the inquiry by the static optimization processing 312.
【0013】コード生成313は、選択された処理手順
に従い、実行可能な中間コードを生成する。動的最適化
処理314は、静的最適化処理によって選ばれた処理候
補の中から実行時の状態に応じた最適な処理を選択す
る。コード解析実行315は生成した中間コードを動的
最適化処理の選択に従い実行する。物理処理部320
は、システムで共用するリソースの排他制御を行う排他
制御321と、データの編集や条件判定などを行うデー
タアクセス処理322と、データの読み書きを行うデー
タベースバッファ制御323から成る。システム制御部
330は入出力の管理などを行う。The code generator 313 generates an executable intermediate code according to the selected processing procedure. The dynamic optimization process 314 selects an optimal process according to the state at the time of execution from the process candidates selected by the static optimization process. The code analysis execution 315 executes the generated intermediate code according to the selection of the dynamic optimization processing. Physical processing unit 320
Is composed of an exclusive control 321 for exclusive control of resources shared by the system, a data access process 322 for editing data and determining conditions, and a database buffer control 323 for reading and writing data. The system control unit 330 performs input / output management and the like.
【0014】次に例題を用い詳細に解説する。解説する
内容は、 (1)データ間の関連の表現手段 (2)例題のデータ (3)関連をもつデータの定義方法と定義情報の管理 (4)関連をもつデータの格納方法 (5)関連をもつデータの格納状態検知 (6)関連操作を含む問い合せの処理方法 (7)例題の格納例 である。Next, a detailed explanation will be given using an example. The contents to be explained are (1) Means of expressing the relation between data (2) Example data (3) Definition method of related data and management of definition information (4) Storage method of related data (5) Relation (6) Processing method of inquiry including related operation (7) Example of storage of example.
【0015】(1)データ間の関連の表現手段 データ型A(401)のデータがデータ型B(402)
のデータへの参照(400)をもつとき、型Aのデータ
と型Bのデータは関連をもつという。このとき型Aのデ
ータは関連元であり、型Bのデータは関連先となる。図
4は型Aのデータと型Bのデータが関連をもつことを表
したモデル図である。矢印が関連を表し、矢印の先が関
連先、元が関連元である。(1) Means for expressing the relationship between data The data of data type A (401) is data type B (402)
Has a reference (400) to the data of type A, the data of type A and the data of type B are said to be related. At this time, the data of type A is an association source, and the data of type B is an association destination. FIG. 4 is a model diagram showing that type A data and type B data are related. The arrow indicates the relation, the tip of the arrow is the relation destination, and the source is the relation source.
【0016】図4の関連をもつデータをデータベースで
管理する方法を示したのが図5である。表500は型A
のデータを管理する表であり、表510は型Bのデータ
を管理する表である。型Aは型Bへの参照をもつ。これ
を型Bへの参照というカラム502に保持する。型Aの
データの関連先である表512は、自分自身の参照値と
いうカラムをもつ。関連するデータはこれのカラムの値
が等しい。例えば、型Aのデータ501の型Bへの参照
値B_REF値(503)と型Bのデータ511の自分
自身の参照値B_REF値(503)が等しいため、デ
ータ501とデータ511は関連をもつ。この場合、デ
ータ501が関連元であり、データ511が関連先とな
る。関連名称は型Bへの参照である。図6は関連を表す
参照値の構造を示す。データまたは行を識別する値60
1とノードを識別する値600から成る。FIG. 5 shows a method for managing the related data of FIG. 4 in a database. Table 500 shows type A
Table 510 is a table for managing type B data. Type A has a reference to type B. This is stored in a column 502 for reference to type B. Table 512, which is the destination of type A data, has a column called its own reference value. Related data has the same value in this column. For example, since the reference value B_REF value (503) of the type A data 501 to the type B is equal to the own reference value B_REF value (503) of the type B data 511, the data 501 and the data 511 are related. In this case, the data 501 is an association source, and the data 511 is an association destination. The associated name is a reference to type B. FIG. 6 shows the structure of a reference value representing the association. A value that identifies the data or row 60
1 and a value 600 for identifying the node.
【0017】(2)例題のデータ 例題のデータについて説明する。図8は関連をもつデー
タの例である。Employee型のデータはある会社の従業員
を、Project型のデータはある会社のプロジェクトを表
現する。関連820は、関連名称myProjectであり、関
連元はEmployee型、関連先はProject型である。ある従
業員が担当するプロジェクトを指す。関連830は、関
連名称managerであり、関連元Project型は、関連先はEm
ployee型である。あるプロジェクトの管理者を指す。関
連840は、関連名称bossであり、関連元はEmployee
型、関連先もEmployee型である。ある従業員の上司を指
す。(2) Example Data The example data will be described. FIG. 8 shows an example of related data. Employee type data represents a company employee, and Project type data represents a company project. The relation 820 is a relation name myProject, the relation source is an Employee type, and the relation destination is a Project type. Refers to the project for which an employee is responsible. The relation 830 is a relation name “manager”, the relation source Project type is, and the relation destination is Em.
It is a ployee type. Refers to the manager of a project. The relation 840 is the relation name boss and the relation source is Employee
The type and related destination are also Employee type. Refers to the boss of an employee.
【0018】データ801は、名前(name)がEmp1の従
業員(Employee型のデータ)である。担当するプロジェ
クトはデータ820、上司はいない。データ802は、
名前(name)がEmp2の従業員(Employee型のデータ)で
ある。担当するプロジェクトはデータ812、上司はデ
ータ806である。データ803は、名前(name)がEm
p3の従業員(Employee型のデータ)である。担当するプ
ロジェクトはデータ813、上司はいない。データ80
4は、名前(name)がEmp4の従業員(Employee型のデー
タ)である。担当するプロジェクトはデータ813、上
司はデータ803である。The data 801 is an employee whose name is Emp1 (Employee type data). My project is Data 820 and I have no boss. Data 802 is
The name (name) is an employee with Emp2 (Employee type data). The project in charge is data 812, and the supervisor is data 806. The data 803 has the name Em
Employee of p3 (Employee type data). My project is Data 813, and I have no boss. Data 80
Reference numeral 4 denotes an employee whose name (name) is Emp4 (Employee-type data). The project in charge is data 813, and the supervisor is data 803.
【0019】データ805は、名前(name)がEmp5の従
業員(Employee型のデータ)である。担当するプロジェ
クトはデータ811、上司はデータ801である。デー
タ806は、名前(name)がEmp6の従業員(Employee型
のデータ)である。担当するプロジェクトはデータ81
2、上司はデータ807である。データ807は、名前
(name)がEmp7の従業員(Employee型のデータ)であ
る。担当するプロジェクトはデータ812、上司はデー
タ803である。データ808は、名前(name)がEmp8
の従業員(Employee型のデータ)である。担当するプロ
ジェクトはデータ813、上司はデータ803である。The data 805 is an employee whose name (name) is Emp5 (Employee-type data). The project in charge is data 811, and the supervisor is data 801. Data 806 is an employee whose name (name) is Emp6 (Employee-type data). My project is data 81
2. The boss is the data 807. Data 807 is an employee (Employee type data) whose name (name) is Emp7. The project in charge is data 812, and the supervisor is data 803. The data 808 has the name (Emp8)
(Employee type data). The project in charge is data 813, and the supervisor is data 803.
【0020】データ811は、名前(name)がPJ1、番
号(projectNo)が1945のプロジェクト(Project型のデ
ータ)である。管理者はデータ801である。データ8
12は、名前(name)がPJ2、番号(projectNo)が645
のプロジェクト(Project型のデータ)である。管理者
はデータ807である。データ813は、名前(name)
がPJ3、番号(projectNo)が1192のプロジェクト(Proj
ect型のデータ)である。管理者はデータ803であ
る。The data 811 is a project (Project type data) whose name (name) is PJ1 and number (projectNo) is 1945. The administrator is the data 801. Data 8
12, the name (name) is PJ2 and the number (projectNo) is 645
(Project type data). The administrator is data 807. Data 813 is a name
Is PJ3 and the project number (projectNo) is 1192 (Proj
ect type data). The administrator is the data 803.
【0021】(3)関連をもつデータの定義方法と定義
情報の管理 図9は図8のデータのデータ型モデル図である。Employ
ee型900はchar(30)型のnameとProject型への関連myP
roject820とEmployee型への関連bossをもつ。また、
Project型910はchar(30)型のnameとinteger型のproj
ectNoとEmployee型への関連managerをもつ。(3) Definition method of related data and management of definition information FIG. 9 is a data type model diagram of the data of FIG. Employ
ee type 900 is related to char (30) type name and Project type myP
It has a roject 820 and an associated boss to the Employee type. Also,
Project type 910 is char (30) type name and integer type proj
Has related manager to ectNo and Employee type.
【0022】Employee型とProject型を図10のように
データベースに定義することができる。これは、SQL
3の名前付きの行型の定義である。図10(a)では、
型Employeeを定義している。各行の意味を示す。 1000:行型の名称がEmployee 1001:CHAR(30)型のnameというフィールドをもつ 1002:Employee型への関連bossというフィールドを
もつ 1003:Project型への関連myProjectというフィール
ドをもつThe Employee type and the Project type can be defined in the database as shown in FIG. This is SQL
3 is the definition of the named row type. In FIG. 10A,
Type Employee is defined. Indicates the meaning of each line. 1000: The row type name is Employee 1001: There is a field called name of CHAR (30) type 1002: There is a field called boss related to Employee type 1003: There is a field called myProject related to Project type
【0023】図10(b)では、型Projectを定義して
いる。各行の意味を示す。 1010:行型の名称がProject 1011:CHAR(30)型のnameというフィールドをもつ 1012:INTEGER型のprojectNoというフィールドをも
つ 1013:Employee型への関連mangerというフィールド
をもつIn FIG. 10B, a type Project is defined. Indicates the meaning of each line. 1010: The row type name is Project 1011: It has a field of name of CHAR (30) type 1012: It has a field of projectNo of INTEGER type 1013: It has a field of manager related to Employee type
【0024】型の定義はデータの性質についての記述で
あり、データの実体を管理するわけではない。リレーシ
ョナルデータベースシステムでは表によってデータを管
理する。本実施例では、表によって関連するデータを管
理する方法を示す。Employee型のデータは表employees
で管理する。また、Project型のデータは表projectsで
管理する。本発明においては、表定義時にデータ実体の
格納方法指定ができるように表定義の方法を拡張する。
拡張した格納方法指定は、関連先に対して関連元と同一
のノードに格納するように指定する方法の指定と、関連
元に対して関連先と同一のノードに格納するように指定
する方法の指定を選択することができる。ただし、この
指定の通りすべてのデータが格納されるわけではない。
データが複数のデータと関連をもつと、指定された格納
方法を実施できない場合がある。実際には一つの関連に
着目し、後から格納するデータが、すでに格納されてい
るデータのノードに格納することになる。The type definition is a description of the nature of the data, and does not manage the substance of the data. In a relational database system, data is managed by tables. In the present embodiment, a method of managing related data using a table will be described. Employee type data is table employees
Manage with. Project type data is managed in the table projects. In the present invention, the table definition method is extended so that the data entity storage method can be specified at the time of table definition.
The extended storage method specification consists of two methods: one is to specify the related destination to be stored in the same node as the related source, and the other is to specify the related source to be stored in the same node as the related destination. You can choose the specification. However, not all data is stored as specified.
If the data is related to multiple data, the specified storage method may not be implemented. Actually, focusing on one association, data to be stored later is stored in the node of the already stored data.
【0025】図11は、関連先に対して関連元と同一の
ノードに格納するように指定する方法である。1101
〜1106において、関連先のSCOPE FOR句に同一のノ
ードに格納することを示すCLUSTERDと関連先の表のデー
タが存在するノードを指定している。図11(a)は表
employeesの定義である。各行の意味を示す。 1100:行型Employeeを行とする表employeesを定義
する。 1101〜1103:関連bossの関連先は表employees
のデータに限定され、同一ノードに格納する。同一ノー
ドに格納すべき表employeesの格納先はNode1またはNode
2またはNode3である。ここでNode1とNode2とNode3はそ
れぞれノード1、ノード2、ノード3を識別するための
名前である。 1104〜1106:関連myProjectの関連先は表proje
ctsのデータに限定され、同一ノードに格納する。同一
ノードに格納すべき表projectsの格納先はNode1またはN
ode2またはNode3である。FIG. 11 shows a method of designating a relation destination to be stored in the same node as the relation source. 1101
In 1106, CLUSTERD indicating that the data is to be stored in the same node is specified in the SCOPE FOR clause of the association destination, and the node in which the data of the association destination table exists. FIG. 11A is a table.
This is the definition of employees. Indicates the meaning of each line. 1100: Define a table employees with the row type Employee as a row. 1101 to 1103: Related employees are related to table employees
And stored in the same node. The storage destination of the table employees to be stored in the same node is Node1 or Node
2 or Node3. Here, Node1, Node2, and Node3 are names for identifying node 1, node 2, and node 3, respectively. 1104-1106: Related myProject is related to table proje
Limited to cts data and stored in the same node. The storage destination of the table projects to be stored in the same node is Node1 or N
ode2 or Node3.
【0026】図11(b)は表projectsの定義である。
ここでは、関連に関する格納方法の指定は行なっていな
い。各行の意味を示す。 1110:行型Projectを行とする表projectsを定義す
る。 1111:関連managerの関連先は表employeesのデータ
に限定する。 1112〜1113:表projectsの格納先は、フィール
ドprojectNoの値をキーとするHASH1というハッシュ関数
でNode1またはNode2またはNode3に振り分ける。FIG. 11B is a definition of the table projects.
Here, the storage method relating to the association is not specified. Indicates the meaning of each line. 1110: A table projects having a row of the row type Project is defined. 1111: The relation destination of the relation manager is limited to the data of the table employees. 1112 to 1113: The storage destination of the table projects is distributed to Node1, Node2, or Node3 by a hash function called HASH1 using the value of the field projectNo as a key.
【0027】(4)関連をもつデータの格納方法 図12は、関連元に対して関連先と同一のノードに格納
するように指定する方法である。1212において、表
employeesの関連myProjectの関連元と同一のノードに格
納することを示すCLUSTERD BYを指定している。図12
(a)は表employeesの定義である。各行の意味を示
す。 1200:行型Employeeを行とする表employeesを定義
する。 1201〜1203:関連bossの関連先は表employees
のデータに限定され、同一ノードに格納する。同一ノー
ドに格納すべき表employeesの格納先はNode1またはNode
2またはNode3である。 1204〜1206:関連myProjectの関連先は表proje
ctsのデータに限定する。 関連に関する格納方法の指定はない。(4) Method of Storing Related Data FIG. 12 shows a method of designating a relation source to be stored in the same node as a relation destination. At 1212, the table
CLUSTERD BY is specified to indicate that the data is stored in the same node as the related source of employees related myProject. FIG.
(A) is a definition of the table employees. Indicates the meaning of each line. 1200: Define a table employees having a row of row type Employee. 1201 to 1203: Related boss is related to table employees
And stored in the same node. The storage destination of the table employees to be stored in the same node is Node1 or Node
2 or Node3. 1204 to 1206: Related project of related myProject is table proje
Limited to cts data. No storage method is specified for associations.
【0028】図11(b)は表projectsの定義である。
各行の意味を示す。 1210:行型Projectを行とする表projectsを定義す
る。 1211:関連managerの関連先は表employeesのデータ
に限定する。 1212〜1114:表employeesの関連myProjectの関
連元と同一のノードに格納する。格納すべきノードはNo
de1またはNode2またはNode3である。ただし、格納でき
ない場合は、表projectsの格納先は、フィールドprojec
tNoの値をキーとするHASH1というハッシュ関数でNode1
またはNode2またはNode3に振り分ける。FIG. 11B is a definition of the table projects.
Indicates the meaning of each line. 1210: Define a table projects having rows of the row type Project. 1211: The relation destination of the relation manager is limited to the data of the table employees. 1212 to 1114: Stored in the same node as the related source of related myProject of table employees. No to store node
de1 or Node2 or Node3. However, if it cannot be stored, the storage destination of the table projects is the field projecte
Node1 with a hash function called HASH1 that uses the value of tNo as a key
Or assign to Node2 or Node3.
【0029】図13は、関連をもつデータの定義登録の
フローチャート1300である。定義情報の構文解析
(1301)、意味解析(1302)を行なう。解析さ
れた定義情報はディクショナリに登録(1303)され
る。もし、定義情報の中に関連するデータの格納方法の
指定がないのならば(1304)、処理は終了(130
6)する。関連するデータの格納方法の指定がある場合
は(1304)、関連元と関連先の格納方法指定の整合
性をチェックして、ディクショナリへ関連情報として登
録する。格納方法指定の整合性チェックとは、関連元の
格納ノードと関連先の格納ノードが同一ノードに格納で
きるようになっているかの検査である。FIG. 13 is a flowchart 1300 of the definition registration of related data. The syntax analysis (1301) and the semantic analysis (1302) of the definition information are performed. The analyzed definition information is registered in the dictionary (1303). If there is no designation of the storage method of the related data in the definition information (1304), the process ends (130).
6) Yes. If the storage method of the related data is specified (1304), the consistency of the storage method specification of the related source and the related destination is checked and registered as related information in the dictionary. The consistency check for specifying the storage method is a check as to whether the storage node of the relation source and the storage node of the relation destination can be stored in the same node.
【0030】図14は、図13の関連をもつデータの定
義を登録する表の1例である。この表は関連の参照値を
格納するカラム(行型においてフィールド)情報を格納
した表(1400)である。表の識別子(1410)、
カラムの識別子(1411)、カラムのデータ型識別子
(関連は関連型として管理する)、関連先のデータ型識
別子、スコープ指定先表の識別子、格納方法指定、その
他のカラムに関する情報(1412)から構成する。FIG. 14 is an example of a table for registering the definitions of the related data shown in FIG. This table is a table (1400) storing column (field in the row type) information for storing related reference values. Table identifier (1410),
It is composed of column identifier (1411), column data type identifier (association is managed as association type), association data type identifier, scope designation destination table identifier, storage method designation, and other information about columns (1412). I do.
【0031】図11の表定義では、関連manager(14
20)は格納方法指定(1416)がないが、関連boss
と関連myProjectの格納方法指定は「同一ノード」とな
っている。この表からは、表employeesの関連bossは関
連先の表employeesのデータと同一ノードに格納するこ
とと、表employeesの関連myProjectは関連先の表projec
tsのデータと同一ノードに格納することがわかる。In the table definition of FIG. 11, the related manager (14
20) has no storage method specification (1416), but the related boss
And the storage method specification of the related myProject is "same node". From this table, it is understood that the related boss of the table employees is stored in the same node as the data of the related table employees, and that the related myProject of the table employees is the related table project
It can be seen that the data is stored in the same node as the data of ts.
【0032】図15は、図13において格納方法指定が
ある場合に関連情報を登録する表(1500)である。
関連元の表識別子(1510)、関連識別子(151
1)、関連先の表識別子(1512)、関連先のデータ
型識別子(1513)、格納ノード(1514)、格納
状態(1515)のカラムからなる。1520〜152
2は、表employeesの関連bossの関連情報であり、格納
すべきノード(Node1とNode2とNode3)に展開している。
また、1523〜1525は表employeesの関連myProje
ctの関連情報であり、同じく格納すべきノード(Node1と
Node2とNode3)に展開している。FIG. 15 is a table (1500) for registering related information when the storage method is designated in FIG.
Origin table identifier (1510), association identifier (151)
1), an associated destination table identifier (1512), an associated destination data type identifier (1513), a storage node (1514), and a storage state (1515). 1520-152
2 is related information of the related boss of the table employees, which is expanded to the nodes (Node1, Node2, and Node3) to be stored.
Also, 1523 to 1525 are related myProje of the table employees.
Related information of ct, also the node to be stored (Node1 and
Node2 and Node3).
【0033】表を定義した時点では、データは存在しな
いため格納状態は0に初期化されている。なお、本実施
例では、格納状態はあるノードの全関連元データ数に対
する同一ノードに格納されている関連先データ数の割合
(百分率)で表している。At the time when the table is defined, since the data does not exist, the storage state is initialized to 0. In the present embodiment, the storage state is represented by the ratio (percentage) of the number of related destination data stored in the same node to the total number of related source data of a certain node.
【0034】図16は、関連するデータを同一ノードへ
格納するための格納操作例である。図16(a)は、格
納方法指定がない表projectsの関連managerの関連先の
格納操作例である。格納方法指定がないため、表employ
eesのデータを関連managerの関連元のデータと同一のノ
ードに格納するためには、明示的に格納ノードを指定す
る必要がある。先に表employeesのデータを格納した上
で、関連元の関連managerの参照値を更新する。各行の
意味を示す。 1600〜1601:Node1の表employeesへEmployee型
のデータ("Emp3",NULL,NULL)を格納する。 1610〜1613:表employeesのデータの中で、カ
ラムnameが"Emp3"であるデータを取得し、表projectsの
データpの関連managerに関連先として設定する。pはす
でに取得してあるデータとする。FIG. 16 shows an example of a storage operation for storing related data in the same node. FIG. 16A shows an example of a storage operation of the relation destination of the relation manager of the table projects without specifying the storage method. Because there is no storage method specification, the table employee
In order to store the ees data in the same node as the related source data of the related manager, it is necessary to explicitly specify the storage node. Update the reference value of the related manager of the related source after storing the data of the table employees first. Indicates the meaning of each line. 1600 to 1601: Employee type data ("Emp3", NULL, NULL) is stored in the table employees of Node1. 1610-1613: Obtain data in which the column name is "Emp3" in the data of the table employees, and set it as the related destination in the related manager of the data p in the table projects. p is the data already acquired.
【0035】図16(b)は、関連先のデータがすでに
格納されており、その関連先のデータと同一ノードに関
連元を格納する操作である。各行の意味を示す。 1620〜1621:表projectsのデータpを関連先と
して、関連myProjectに設定したnameが"Emp3"であるEmp
loyee型のデータを表employeesへ格納する。pはすでに
取得してあるデータである。&pはデータの参照値を表
す。格納ノードはpの格納ノードに依存する。FIG. 16 (b) shows an operation of storing the relation source in the same node as the relation destination data in which the relation destination data has already been stored. Indicates the meaning of each line. 1620 to 1621: Emp whose name set in the related myProject is "Emp3" with the data p of the table projects as the related destination
Store loyee type data in the table employees. p is the data already acquired. & p represents the reference value of the data. The storage node depends on the storage node of p.
【0036】図16(c)は、関連元のデータがすでに
格納されており、その関連元のデータと同一ノードに関
連先を格納する操作である。各行の意味を示す。 1620〜1621:表projectsへProject型のデータ
("PJ2",645,NULL)を格納する。格納ノードは表employ
eesのデータeの格納ノードに依存する。eはすでに取得
してある。格納したデータは、表employeesのデータeの
関連myProjectの関連先として設定する。FIG. 16 (c) shows an operation of storing the relation destination in the same node as the relation source data in which the relation source data has already been stored. Indicates the meaning of each line. 1620 to 1621: Project type data ("PJ2", 645, NULL) is stored in the table projects. Storage node is table employee
Depends on the storage node of ees data e. e has already been obtained. The stored data is set as the related destination of the related myProject of the data e in the table employees.
【0037】図17は、図16(b)(c)の格納操作
の処理のフローチャートである。図17(a)は、デー
タ格納処理のうちコード生成までの処理フローチャート
(1700)である。格納命令の構文解析(1701)
と意味解析(1702)を行なう。解析の結果、どの表
のどの関連について処理するのかが判明するため、当該
関連の存在するカラム情報から関連するデータの格納方
法指定があるかをチェックする(1703)。格納方法
指定がなければ、関連情報とは別の情報から格納ノード
が決定し中間コードを生成する(1705)。格納方法
指定がある場合は、関連情報より格納ノードの指定方法
を決定し(1704)、中間コードを生成する(170
5)。FIG. 17 is a flowchart of the storage operation process of FIGS. 16 (b) and 16 (c). FIG. 17A is a processing flowchart (1700) of the data storage processing up to code generation. Syntax analysis of storage instruction (1701)
And a semantic analysis (1702). As a result of the analysis, it becomes clear which table and which relation is to be processed, so it is checked whether or not there is a storage method designation of related data based on the column information on the relation (step 1703). If the storage method is not specified, the storage node is determined from information other than the related information, and an intermediate code is generated (1705). If the storage method is specified, the storage node specification method is determined from the related information (1704), and an intermediate code is generated (170).
5).
【0038】図17(b)は、データ格納処理のうちコ
ードの実行の処理のフローチャートである。(a)で指
定した中間コードを解析し(1721)、関連するデー
タの格納方法指定がなければ、格納するデータを生成
(1724)する。格納方法指定があれば、関連するデ
ータ(すでに格納されている関連先または関連元デー
タ)からノード情報を取得し、格納位置を決定し(17
23)、データを生成する(1724)。指定(決定し
た)格納位置に生成したデータを格納する(172
5)。格納したデータが関連先のデータであれば(17
26)、関連元の関連の参照値を更新する(172
7)。FIG. 17B is a flowchart of a code execution process in the data storage process. The intermediate code designated in (a) is analyzed (1721), and if there is no designation of a storage method of related data, data to be stored is generated (1724). If the storage method is specified, node information is acquired from the related data (related destination or related source data already stored), and the storage position is determined (17).
23), and generate data (1724). The generated data is stored in the designated (determined) storage location (172).
5). If the stored data is related data (17)
26), the related reference value of the related source is updated (172).
7).
【0039】(5)関連をもつデータの格納状態検知 図18は、関連したデータのデータ格納状態、例えば、
関連したデータが同一のノードに格納されているかを解
析する処理の概要図である。ネットワーク100から切
り離されたデータベース状態解析ユーティリティ(18
00)は、各ノードのデータをスキャンして格納状態を
調べる。その結果をディクショナリの中にある格納情報
に設定する。(5) Storage state detection of related data FIG. 18 shows the data storage state of related data, for example,
FIG. 14 is a schematic diagram of a process of analyzing whether related data is stored in the same node. A database state analysis utility (18) disconnected from the network 100
00) scans the data of each node and checks the storage state. The result is set in the storage information in the dictionary.
【0040】図19は、データベース状態解析ユーティ
リティが各ノード毎の格納状態を検知する方法(190
0)のフローチャートである。該当ノードの格納方法指
定のある関連情報を取得し(1901)、その取得した
すべての関連情報について(1902)(1912)、
すべての関連元のデータを取得し、それぞれの関連元の
データについて(1903)(1905)(191
0)、関連の参照値を取得し(1907)、参照値より
関連先のデータが同一ノードにあるかをチェックする
(1908)。同一のノードにあれば、カウントする
(1904)(1909)。同時に全関連元データ数も
カウントし(1904)(1906)、関連情報一つに
つき、関連元データ数に対する同一ノードに格納されて
いる関連先データ数の割合を計算し、関連情報の格納状
態(1515)へ設定する。FIG. 19 shows a method (190) in which the database state analysis utility detects the storage state of each node.
It is a flowchart of 0). The related information specifying the storage method of the corresponding node is acquired (1901), and all the acquired related information is acquired (1902) (1912).
The data of all the related sources are acquired, and the data of each related source are (1903), (1905), and (191).
0), the related reference value is acquired (1907), and it is checked whether the data of the related destination exists in the same node based on the reference value (1908). If they are in the same node, they are counted (1904) (1909). At the same time, the total number of related source data is also counted (1904) (1906), and for each piece of related information, the ratio of the number of related destination data stored in the same node to the number of related source data is calculated, and the storage state of related information ( 1515).
【0041】(6)関連操作を含む問い合せの処理方法 図20は、関連操作を含む問い合せの例題である。各行
について意味を示す。 2000〜2002:EmployeeのmyProjectが
指すProjectのprojectNoが、645であるようなmyProject
が指すProjectのnameと、Employeeのnameを取得しなさ
い。−>が関連操作であり、この場合は参照である。(6) Processing Method of Inquiry Involving Related Operation FIG. 20 shows an example of an inquiry including a related operation. Indicates the meaning of each line. 2000-2002: myProject such that the projectNo of Project pointed to by myProject of Employee is 645
Get the name of Project and the name of Employee. -> Is a related operation, in this case, a reference.
【0042】図21は、図20の問い合せに対する検索
結果の表(2100)である。図22は、図20の問い
合せ文を関連操作を用いない外部結合の問い合せに変換
した結果である。各行について説明する。 2200:参照の関連操作myProject->nameをprojects.
nameに変換。nameも明確にするため、employees.nameに
変換。 2201:表リストへ関連先の表projectsを追加。 2202〜2203:関連の参照値をキーとする左外部
結合を挿入。 2204:参照の関連操作myProject->projectNoをproj
ects.projetsNoに変換。FIG. 21 is a table (2100) of search results for the inquiry of FIG. FIG. 22 shows the result of converting the query statement of FIG. 20 into a query of an outer join that does not use a related operation. Each row will be described. 2200: Reference related operation myProject-> name to projects.
Converted to name. Converted to employees.name for clarity. 2201: Add related table project to table list. 2202 to 2203: Insert a left outer join using the related reference value as a key. 2204: Reference related operation myProject-> projectNo proj
Converted to ects.projetsNo.
【0043】図23は、関連操作を含む問い合せ処理の
フローチャートである。特に、問い合せ処理のうちコー
ド生成までの処理のフローチャート(2300)であ
る。問い合せ文を解析(311)し、関連操作がなけれ
ば図3と等価な処理となる。関連操作があれば(230
1)、問い合せ文を関連操作のない、外部結合を用いた
問い合せ文に等価変換する(2302)。変換した問い
合せ文と関連情報(格納状態を含む)から関連操作の静
的最適化を行なう。その後は、図3の処理と同じであ
る。FIG. 23 is a flowchart of an inquiry process including a related operation. Particularly, it is a flowchart (2300) of a process up to code generation in the inquiry process. The inquiry sentence is analyzed (311), and if there is no related operation, processing equivalent to that of FIG. 3 is performed. If there is a related operation (230
1) Equivalently convert the query statement into a query statement using an outer join without related operations (2302). Static optimization of related operations is performed from the converted query statement and related information (including the storage state). After that, the process is the same as the process in FIG.
【0044】図24は、図23の関連操作を含む問い合
せ文を関連操作のない外部結合を用いた問い合せ文に変
換する処理のフローチャートである(2302)。関連
するデータが格納されている表を表リストへ追加する
(2400)、参照値をキーとする外部結合条件を設定
する(2401)。データの参照を参照先の表の列参照
へ変換する。FIG. 24 is a flowchart of a process for converting the query sentence including the related operation shown in FIG. 23 into a query sentence using an outer join having no related operation (2302). A table storing related data is added to the table list (2400), and an outer join condition using a reference value as a key is set (2401). Converts a data reference to a column reference in the referenced table.
【0045】図25は、図23の関連操作の静的最適化
のフローチャートである(2303)。静的最適化のひ
とつのものさしは、関連情報の格納状態である。まず、
格納情報を取得する(2500)。操作対象の関連をも
つデータの格納状態によって、例えば次の3つの状態か
ら戦略を選択する(2501)。 (a)すべての関連元・関連先のデータの組が同一ノー
ドに格納されている。 (b)いくらかの例外を除いて、関連元・関連先のデー
タの組が同一ノードに格納されている。 (c)格納方法指定に無関係に格納されている。FIG. 25 is a flowchart of the static optimization of the related operation in FIG. 23 (2303). One measure of static optimization is the storage of related information. First,
The storage information is acquired (2500). A strategy is selected from, for example, the following three states depending on the storage state of the data related to the operation target (2501). (A) All sets of related source and related data are stored in the same node. (B) With some exceptions, a set of related source / destination data is stored in the same node. (C) Stored regardless of the storage method specification.
【0046】(a)は、理想的な状態である。ノードご
とに非同期に外部結合処理をする戦略を選択する(25
02)。(b)は、例外的な存在と同一ノードに格納さ
れている関連するデータとを区別して、処理する戦略を
選択する(2503)。具体的には、図26に示すよう
な問い合せの実行になる(2600)。関連元と関連先
の参照値の突き合わせを行い(2601)、関連先が存
在すれば(2602)、結合処理(2603)を行な
う。存在しない場合(例外的な存在)は関連元データを
作業用のノードに転送する(2604)。転送されたデ
ータは、関連先の格納されているノードから関連先デー
タを取得して、転送先のノードで結合処理する。(c)
の場合は、関連情報を用いては最適化を行なわない。そ
の他の情報を用いて最適化を行なう。(A) is an ideal state. Select a strategy for performing outer join processing asynchronously for each node (25
02). In (b), a strategy to be processed is selected by distinguishing exceptional entities from related data stored in the same node (2503). Specifically, an inquiry as shown in FIG. 26 is executed (2600). The reference values of the relation source and the relation destination are compared (2601), and if there is a relation destination (2602), the combining process (2603) is performed. If it does not exist (exceptional existence), the related source data is transferred to the work node (2604). For the transferred data, the associated destination data is acquired from the node where the associated destination is stored, and the transfer destination node performs the joining process. (C)
In the case of, the optimization is not performed using the related information. Optimization is performed using other information.
【0047】ここで、注意しなければならないことは、
コード生成時に参照した格納状態と、コードを実行する
時点の格納状態が異なる場合があるということである。
コード生成時に(a)の格納状態の戦略を選択したとし
ても、実際にそのコードを実行するときには、(b)ま
たは(c)の格納状態の可能性がある。したがって、コ
ード生成時は、そのとき参照した格納状態にしたがって
処理方法を選択するが、他の処理方法を必要に応じて候
補として残しておく必要がある。コード生成時に(a)
の格納状態であるならば、少なくとも(b)に対応する
処理方法も候補に残して置く必要がある。そして、コー
ド実行時にはデータに応じて候補の処理方法の中から適
切なものを選択する。Here, it should be noted that:
This means that the storage state referred to when the code was generated may be different from the storage state at the time of executing the code.
Even if the storage state strategy of (a) is selected at the time of code generation, the storage state of (b) or (c) may be present when the code is actually executed. Therefore, at the time of code generation, a processing method is selected according to the storage state referred to at that time, but it is necessary to leave other processing methods as candidates as necessary. When generating code (a)
, It is necessary to leave at least the processing method corresponding to (b) as a candidate. Then, when executing the code, an appropriate one is selected from the candidate processing methods according to the data.
【0048】(7)例題の格納例 図27は、図11の定義において、図8のデータを格納
した例である。表projectsにおいて、2711は自分自
身の参照値カラムであり、2712はnameカラム、27
13はprojectNoカラム、2714は関連managerのカラ
ムである。表employeesにおいて、2741は自分自身
の参照値カラムであり、2742はnameカラム、274
3は関連bossのカラム、2744は関連myProjectのカ
ラムである。自分自身の参照値カラムと関連のカラムに
は参照値がシステムによって割り付けた参照値を格納し
ている。本例題では、参照値を3文字で表し、最初の文
字がデータの属する表の識別子(eは表employees、pは
表projects)、真ん中の文字が関連先が格納されている
ノードの識別子(1はノード1、2はノード2、3はノ
ード3)、最後の文字が表でのデータ(行)識別子であ
る。(7) Example of Storage of Example FIG. 27 shows an example in which the data of FIG. 8 is stored in the definition of FIG. In the table “projects”, reference numeral 2711 denotes its own reference value column, reference numeral 2712 denotes a name column,
13 is a projectNo column, and 2714 is a column of a related manager. In the table employees, 2741 is its own reference value column, 2742 is the name column, 274
3 is a column of the related boss, and 2744 is a column of the related myProject. The reference value column associated with the own reference value column stores the reference value assigned by the system. In this example, the reference value is represented by three characters, the first character is the identifier of the table to which the data belongs (e is the table employees, p is the table projects), and the middle character is the identifier of the node (1 Is the node 1, node 2 is the node 2, node 3 is the node 3), and the last character is the data (row) identifier in the table.
【0049】図27の格納例は、図28の格納状態とな
る。ノード1のemployees表を例にとって説明する。関
連bossのカラムに着目する。参照値はe17、e23、
e15であり、ノード識別子をからデータ802と80
6のbossはノード1に格納されているが、データ807
はノード2に格納されていることを示している。したが
って、格納状態は3個のデータのうち2個が同一ノード
に格納されているので66(パーセント)となる。一方関
連myProjectのカラムに着目すると、すべての参照値が
p11であるためすべての関連先が同一ノードに格納さ
れていることを示している。したがって、図20の問い
合せでは、関連myProjectの関連先がすべて同一ノード
に格納されているため、ノード1については、とりうる
戦略は図25の2502となる。なお、関連先がNULLの
ときは、関連先が無いことを表す。格納状態検知のとき
には、同一ノードに格納されているとして扱う。The storage example of FIG. 27 is in the storage state of FIG. A description will be given using the employees table of the node 1 as an example. Focus on related boss columns. Reference values are e17, e23,
e15, the data of the nodes 802 and 80
The boss of No. 6 is stored in node 1, but data 807
Indicates that it is stored in node 2. Therefore, the storage state is 66 (percent) because two of the three data are stored in the same node. On the other hand, focusing on the column of the related myProject, all the reference values are p11, indicating that all the related destinations are stored in the same node. Therefore, in the inquiry of FIG. 20, since all the related destinations of the related myProject are stored in the same node, the possible strategy for node 1 is 2502 in FIG. When the related destination is NULL, it indicates that there is no related destination. When the storage state is detected, it is treated as being stored in the same node.
【0050】[0050]
【発明の効果】本発明によれば、分散して格納するデー
タに対し、関連するデータの組(関連する)を同一のノ
ードに格納する手段をもつため、関連操作がノードごと
の非同期処理となるため、並列化に行なうことが可能と
なる。また、同一ノードに格納されていなくとも、関連
するデータの格納状態を検知する手段をもつため、最適
な並列処理を選択することが可能となる。したがって、
関連操作を含む問い合せの高速化を図ることが可能とな
る。According to the present invention, for data to be stored in a distributed manner, there is provided a means for storing a set of related data (related) in the same node. Therefore, it is possible to perform parallel processing. Further, even if the data is not stored in the same node, a means for detecting the storage state of related data is provided, so that it is possible to select an optimal parallel processing. Therefore,
Inquiries including related operations can be speeded up.
【図1】関連操作を含む問い合せの並列処理概要図であ
る。FIG. 1 is a schematic diagram of parallel processing of an inquiry including a related operation.
【図2】ハードウエア構成図である。FIG. 2 is a hardware configuration diagram.
【図3】データベースシステムの構成図である。FIG. 3 is a configuration diagram of a database system.
【図4】関連をもつデータ型の例を示す図である。FIG. 4 is a diagram illustrating an example of an associated data type.
【図5】関連をもつデータの表現方法概要を示す図であ
る。FIG. 5 is a diagram showing an outline of a method of expressing related data.
【図6】関連を表す参照値の構造を示す図である。FIG. 6 is a diagram showing a structure of a reference value indicating an association.
【図7】関連操作の並列処理のフローチャートである。FIG. 7 is a flowchart of parallel processing of related operations.
【図8】関連をもつデータの例を示す図である。FIG. 8 is a diagram showing an example of related data.
【図9】図8のデータのデータ型モデル図である。FIG. 9 is a data type model diagram of the data of FIG. 8;
【図10】図9のデータ型定義例を示す図である。FIG. 10 is a diagram showing an example of a data type definition in FIG. 9;
【図11】図10のデータ型を用いた表の定義例1を示
す図である。11 is a diagram showing a definition example 1 of a table using the data type of FIG. 10;
【図12】図10のデータ型を用いた表の定義例2を示
す図である。12 is a diagram illustrating a definition example 2 of a table using the data type of FIG. 10;
【図13】関連をもつデータの定義登録のフローチャー
トである。FIG. 13 is a flowchart of definition registration of related data.
【図14】関連の参照値を格納するカラム情報の格納構
造図である。FIG. 14 is a storage structure diagram of column information for storing related reference values.
【図15】関連情報の格納構造図である。FIG. 15 is a storage structure diagram of related information.
【図16】図11および図12で定義した表への関連を
もつデータの格納操作例を示す図である。FIG. 16 is a diagram illustrating an example of a storage operation of data related to the tables defined in FIGS. 11 and 12;
【図17】関連をもつデータの格納処理のフローチャー
トである。FIG. 17 is a flowchart of a process of storing related data.
【図18】データベース状態解析処理概要図である。FIG. 18 is a schematic diagram of a database state analysis process.
【図19】関連をもつデータの格納状態を検知する方法
のフローチャートである。FIG. 19 is a flowchart of a method for detecting a storage state of related data.
【図20】関連操作を含む問い合せの例題を示す図であ
る。FIG. 20 is a diagram illustrating an example of an inquiry including a related operation.
【図21】図20の問い合せの結果を示す図である。FIG. 21 is a diagram showing a result of the inquiry in FIG. 20;
【図22】外部結合に変換した図20の問い合せを示す
図である。FIG. 22 is a diagram showing the query of FIG. 20 converted into an outer join.
【図23】関連操作を含む問い合せ処理のフローチャー
トである。FIG. 23 is a flowchart of an inquiry process including a related operation.
【図24】関連操作を含む問い合せ文の外部結合への変
換処理のフローチャートである。FIG. 24 is a flowchart of a process of converting an inquiry sentence including a related operation into an outer join.
【図25】関連操作の静的最適化のフローチャートであ
る。FIG. 25 is a flowchart of static optimization of a related operation.
【図26】関連操作の実行処理のフローチャートであ
る。FIG. 26 is a flowchart of a related operation execution process.
【図27】図8のデータの分散格納例を示す図である。FIG. 27 is a diagram illustrating an example of distributed storage of the data in FIG. 8;
【図28】図27の格納状態を示す図である。28 is a diagram showing the storage state of FIG. 27.
100…ネットワーク、 102…データを操作するノード、 105…格納情報解析・管理ノード、 110…データまたはデータが格納される外部記憶装
置、 311…問い合せ解析部、 312…静的最適化処理、 313…コード生成、 314…動的最適化処理、 315…コード解析実行100: network, 102: node for operating data, 105: stored information analysis / management node, 110: external storage device for storing data or data, 311: query analysis unit, 312: static optimization processing, 313 ... Code generation, 314: Dynamic optimization processing, 315: Code analysis execution
───────────────────────────────────────────────────── フロントページの続き (51)Int.Cl.6 識別記号 FI G06F 15/40 380D (72)発明者 岩田 守弘 神奈川県川崎市幸区鹿島田890番地 株式 会社日立製作所情報・通信開発本部内 (72)発明者 鳥居 俊一 神奈川県川崎市幸区鹿島田890番地 株式 会社日立製作所情報・通信開発本部内 (72)発明者 亀城 嘉人 神奈川県横浜市戸塚区戸塚町5030番地 株 式会社日立製作所ソフトウェア開発本部内──────────────────────────────────────────────────の Continued on the front page (51) Int.Cl. 6 Identification code FIG06F 15/40 380D (72) Inventor Morihiro Iwata 890 Kashimada, Saiwai-ku, Kawasaki-shi, Kanagawa Pref. 72) Inventor Shunichi Torii 890 Kashimada, Saiwai-ku, Kawasaki City, Kanagawa Prefecture Inside the Information and Communications Development Division, Hitachi, Ltd. (72) Inventor Yoshito Kamejo 5030 Totsukacho, Totsuka-ku, Yokohama-shi, Kanagawa Prefecture Software Development, Hitachi, Ltd. In headquarters
Claims (9)
備え、それぞれのノードは他のノードと接続されるデー
タベース管理システムにおいて、 データベースに格納するデータとデータの間に関連があ
る場合に、 データ間の関連の定義と関連するデータの格納方法を受
け付け、関連をもつデータの格納状態とともに管理する
手段と、 関連先のデータを識別する値を関連元のデータに関連を
管理する値として保持し、さらに、関連先のデータにも
同一の値を自分自身を識別する値として付加する、関連
をもつデータの格納手段と、 関連元のデータと関連先のデータに付加した関連先のデ
ータを識別する値を比較することで関連元のデータと関
連先のデータを結合する手段と、 関連操作を含む問い合わせを受け付け問い合わせを解析
し、問い合せの解析結果と、前記データ間の関連の定義
及び関連するデータの格納指定方法と、操作対象の関連
先のデータと関連元のデータが格納されたノードの格納
状態によって最適な処理手順を選択する決定手段と、 選択した処理手順に従い、前記関連元のデータと関連先
のデータを結合する手段を最適なノードで駆動させる実
行手段とを備えることを特徴とするデータベース管理シ
ステム。A plurality of nodes for performing database processing, each of which is connected to another node in a database management system. Means for accepting the definition of the association and the storage method of the associated data and managing the associated data together with the storage state; holding a value for identifying the associated data as a value for managing the association with the associated data; Means for storing related data, which adds the same value to the associated data as a value for identifying itself, and a value for identifying the associated data added to the original data and the associated data A means for combining the data of the related source and the data of the related destination by comparing the The most suitable processing procedure is selected according to the analysis result of the above, the definition of the relation between the data and the method of specifying the storage of the related data, and the storage state of the node storing the data of the relation destination and the data of the relation source to be operated. A database management system comprising: a determination unit; and an execution unit that drives a unit that combines the data of the relation source and the data of the relation destination with an optimum node in accordance with a selected processing procedure.
ムにおいて、 前記データ間の関連の定義と関連するデータの格納方法
を受け付け、管理する手段は、 関連先のデータと関連元のデータを同一のノードに格納
するという格納方法を関連の定義とともに指定する手段
と、 指定された関連の定義と格納方法をデータベースシステ
ムのディクショナリに登録する手段と、 格納方法に対する関連をもつデータの格納状態を管理す
る手段とを備えることを特徴とするデータベース管理シ
ステム。2. The database management system according to claim 1, wherein the means for receiving and managing the definition of the relationship between the data and the storage method of the related data includes: Means for specifying the storage method to be stored in the database together with the relation definition, means for registering the specified relation definition and the storage method in the dictionary of the database system, and means for managing the storage state of data related to the storage method And a database management system.
ムにおいて、 前記関連先のデータを識別する値は、関連先の格納され
ているノードを識別する値を保持することを特徴とする
データベース管理システム。3. The database management system according to claim 1, wherein the value for identifying the data of the association destination holds a value for identifying a node at which the association destination is stored.
ムにおいて、 前記関連元のデータと関連先のデータを結合する手段
は、関連操作を含む問い合わせ文を、関連元及び関連先
のデータが管理されている表を結合するような関連操作
を含まない問い合わせ文に変換することを特徴とするデ
ータベース管理システム。4. The database management system according to claim 1, wherein the means for combining the data of the relation source and the data of the relation destination includes a query sentence including a relation operation, and data of the relation source and relation destination being managed. A database management system for converting a query into a query that does not include a related operation such as joining tables.
ムにおいて、 前記最適な処理手順を選択する決定手段は、問い合わせ
の対象となる関連先データと関連元のデータの組が同一
のノードに格納されており、それぞれの組が各ノードに
分散して格納されている場合は、各ノードで非同期に関
連先のデータと関連もとのデータを結合処理を選択する
ことを特徴とするデータベース管理システム。5. The database management system according to claim 1, wherein the deciding means for selecting the optimum processing procedure is such that a set of related destination data and related source data to be queried is stored in the same node. A database management system characterized in that when each group is stored in a distributed manner at each node, a joining process is selected asynchronously at each node to combine the data of the related destination and the data of the related source.
連の関連先を示す請求項3記載の関連先のデータを識別
する値によって、関連先の格納されているノードを識別
し、同一のノードであれば当該ノードにおいて、同一ノ
ードでなければ関連先のデータが格納されているノード
もしくは作業用のノードにおいて、結合処理を行うこと
を特徴とするデータベース管理システム。6. The execution means according to claim 1, wherein the node that stores the related destination is identified by a value that identifies the related destination data according to claim 3 that indicates the related destination to be processed. A database management system that performs a combining process at a node that stores related data or a working node that is not the same node.
納方法に基づいて、関連先データと関連元データを適切
なノードに格納する手段とを備えるデータベース管理シ
ステム。7. A database management system comprising: means for storing related destination data and related source data in an appropriate node based on the stored related information and the storage method according to claim 1.
ムを含むデータベースシステムにおいて、 データベースに格納されている関連をもつデータに対
し、関連先のデータと関連元のデータの格納状態を検知
する手段と、 関連をもつデータの格納方法に対し、前記格納状態を評
価する手段と、 前記評価した結果を対応する前記格納方法ともに格納す
る手段とを具備することを特徴とするデータベースシス
テム。8. A database system including the database management system according to claim 1, wherein, for data having a relation stored in the database, means for detecting a storage state of data of a relation destination and data of a relation source, A database system comprising: means for evaluating the storage state for a method of storing related data; and means for storing the evaluated result together with the corresponding storage method.
ムのプログラムと、データ間の関連の定義及び関連をも
つデータの格納方法の指定の情報と、関連をもつデータ
の関連先と関連元のデータ内に同一の請求項3記載の関
連先を識別する値を格納したデータベースを格納した記
憶媒体。9. The program of the database management system according to claim 1, information on a definition of a relationship between data and a designation method of a storage method of related data, and information on a relation destination and a relation source of related data. A storage medium storing a database storing a value for identifying an associated destination according to claim 3.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP9041856A JPH10240753A (en) | 1997-02-26 | 1997-02-26 | Database management system and storage medium used therein |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP9041856A JPH10240753A (en) | 1997-02-26 | 1997-02-26 | Database management system and storage medium used therein |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH10240753A true JPH10240753A (en) | 1998-09-11 |
Family
ID=12619901
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP9041856A Pending JPH10240753A (en) | 1997-02-26 | 1997-02-26 | Database management system and storage medium used therein |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH10240753A (en) |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20010099183A (en) * | 2001-09-10 | 2001-11-09 | . | Data Combination Management System |
| KR20030014011A (en) * | 2001-08-10 | 2003-02-15 | (주)프리즘엠아이텍 | Method and system for automatic combining a different kind of database |
| JP2005049943A (en) * | 2003-07-29 | 2005-02-24 | Toshiba Corp | Data processing apparatus, data processing method, and program |
| JP2013131011A (en) * | 2011-12-21 | 2013-07-04 | Nomura Research Institute Ltd | Data using system |
| JP2015118645A (en) * | 2013-12-20 | 2015-06-25 | 株式会社野村総合研究所 | Data distribution management system |
| JP2018101280A (en) * | 2016-12-20 | 2018-06-28 | Kddi株式会社 | Query processing system and query processing method |
| JP2021068365A (en) * | 2019-10-28 | 2021-04-30 | 株式会社日立製作所 | Computer system and method for controlling data |
-
1997
- 1997-02-26 JP JP9041856A patent/JPH10240753A/en active Pending
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20030014011A (en) * | 2001-08-10 | 2003-02-15 | (주)프리즘엠아이텍 | Method and system for automatic combining a different kind of database |
| KR20010099183A (en) * | 2001-09-10 | 2001-11-09 | . | Data Combination Management System |
| JP2005049943A (en) * | 2003-07-29 | 2005-02-24 | Toshiba Corp | Data processing apparatus, data processing method, and program |
| JP2013131011A (en) * | 2011-12-21 | 2013-07-04 | Nomura Research Institute Ltd | Data using system |
| JP2015118645A (en) * | 2013-12-20 | 2015-06-25 | 株式会社野村総合研究所 | Data distribution management system |
| JP2018101280A (en) * | 2016-12-20 | 2018-06-28 | Kddi株式会社 | Query processing system and query processing method |
| JP2021068365A (en) * | 2019-10-28 | 2021-04-30 | 株式会社日立製作所 | Computer system and method for controlling data |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Xun et al. | Fidoop: Parallel mining of frequent itemsets using mapreduce | |
| US6618727B1 (en) | System and method for performing similarity searching | |
| JP4955876B2 (en) | Cost-based materialized view selection for query optimization | |
| US6675160B2 (en) | Database processing method, apparatus for carrying out the same and medium storing processing program | |
| JP3742177B2 (en) | Parallel database system routine execution method | |
| CN108681603B (en) | Method for rapidly searching tree structure data in database and storage medium | |
| US7962494B2 (en) | Method, information processing apparatus, and program for generating array | |
| JP2001084257A (en) | Query processing method and system | |
| JP2001167087A (en) | Structured document search device, structured document search method, program recording medium for structured document search, and index creation method for structured document search | |
| de Freitas et al. | Conceptual mappings to convert relational into NoSQL databases | |
| CN112015741A (en) | Method and device for storing massive data in different databases and tables | |
| EP4296866B1 (en) | Runtime statistics feedback for query plan cost estimation | |
| CN116383247B (en) | Large-scale graph data efficient query method | |
| JPH10240753A (en) | Database management system and storage medium used therein | |
| US20090106289A1 (en) | Array Generation Method And Array Generation Program | |
| US6862590B2 (en) | Converting expressions to execution plans | |
| Bergami et al. | A Join Operator for Property Graphs. | |
| Arnold et al. | HRDBMS: Combining the best of modern and traditional relational databases | |
| JPH08235033A (en) | Joint arithmetic system for object-oriented data base management system | |
| Margoor et al. | Improving join reordering for large scale distributed computing | |
| Jamadagni et al. | GoDB: From batch processing to distributed querying over property graphs | |
| Marinov | A bloom filter application for processing big datasets through mapreduce framework | |
| JPH1153383A (en) | Method for searching a plurality of databases and recording medium storing the search program and the like | |
| Radha et al. | A survey on Automatic Query Optimization Approaches in Multi Store Systems for Big Data Analytics | |
| KR102519538B1 (en) | Data flow tracking method and system |