JP3196925B2 - Relational database delay constraint check method - Google Patents

Relational database delay constraint check method

Info

Publication number
JP3196925B2
JP3196925B2 JP01583797A JP1583797A JP3196925B2 JP 3196925 B2 JP3196925 B2 JP 3196925B2 JP 01583797 A JP01583797 A JP 01583797A JP 1583797 A JP1583797 A JP 1583797A JP 3196925 B2 JP3196925 B2 JP 3196925B2
Authority
JP
Japan
Prior art keywords
constraint
delay
request
information
record
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP01583797A
Other languages
Japanese (ja)
Other versions
JPH10198589A (en
Inventor
尊雄 麦谷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP01583797A priority Critical patent/JP3196925B2/en
Publication of JPH10198589A publication Critical patent/JPH10198589A/en
Application granted granted Critical
Publication of JP3196925B2 publication Critical patent/JP3196925B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

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

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、以下の〜に示
す機能を有する関係データベースシステムにおいて、利
用者からの指定によりレコード更新時の制約チェックを
遅延させトランザクションのコミット(COMMIT)
時に制約チェックを行う関係データベース遅延制約チェ
ック方式に関する。 表定義の一部として制約を定義する。 表に対する更新時に、更新後のレコードの値が制約
に違反するか否かをチェックする。 更新後のレコードの値が制約に違反する場合には、
エラーとすることによりデータベースの整合性を保持す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a relational database system having the following functions (1) to (4): delaying constraint checking at the time of record update by a user's specification, and committing a transaction (COMMIT).
The present invention relates to a relational database delay constraint checking method that sometimes performs constraint checking. Define constraints as part of the table definition. When updating a table, check whether the updated record value violates the constraint. If the updated record value violates a constraint,
Maintain database consistency by setting an error.

【0002】[0002]

【従来の技術】関係データベースシステムにおいては、
データを更新する順番によっては一時的に制約を違反す
ることを許容しながら、コミット時には制約を満足する
ことを保証したい処理(トランザクション処理)を実現
したい場合がある。
2. Description of the Related Art In relational database systems,
Depending on the order in which data is updated, there is a case where it is desired to implement a process (transaction process) for guaranteeing that the constraint is satisfied at the time of commit, while temporarily allowing the constraint to be violated.

【0003】例えば、そのような処理として、図6に示
すような更新処理がある。図6は、社員表の給与項目に
対して定義された制約(下線部分)と、社員表に対する
2つのレコード更新処理(更新1および更新2)とを示
している。
For example, as such processing, there is an updating processing as shown in FIG. FIG. 6 shows restrictions (underlined portions) defined for salary items in the employee table, and two record update processes (update 1 and update 2) for the employee table.

【0004】給与項目に対して定義された制約は、給与
の値が150000から2000000までの範囲でな
ければならないことを示している。更新1は、社員表の
全てのレコードに対して、給与の値を1.12倍に変更
する処理である。更新2は、社員表の部門の値が10
3,105,および118のいずれかであるレコードに
対して、給与の値から3000を差し引く処理である。
[0004] The constraints defined for salary items indicate that salary values must be in the range of 150,000 to 2,000,000. Update 1 is processing for changing the salary value to 1.12 times for all records in the employee table. Update 2 shows that the department value in the employee table is 10
This is a process of subtracting 3000 from the salary value for any of the records 3, 105, and 118.

【0005】ここで、社員表の部門の値が103,10
5,および118のいずれかであるレコードについて
は、更新1による更新処理の結果、給与の値が一時的に
2000000を越えても、更新2によって20000
00より少なくなる可能性がある。このため、更新1と
更新2とを合わせて1つのトランザクション処理とし、
更新1の更新が完了した時点では制約をチェックせず
に、更新2の更新が完了した時点で制約をチェックする
ことが望ましい。
[0005] Here, the section value of the employee table is 103,10.
As for the record which is any one of the records 5 and 118, even if the salary value temporarily exceeds 2,000,000 as a result of the update processing by the update 1, the update 2
May be less than 00. Therefore, update 1 and update 2 are combined into one transaction process,
It is preferable that the constraint is not checked when the update of the update 1 is completed, but the constraint is checked when the update of the update 2 is completed.

【0006】以上のような処理が行われる場合に、レコ
ード更新時の制約チェックを遅延させてトランザクショ
ンのコミット時に制約チェックを行う方式である「関係
データベース遅延制約チェック方式」が必要になる。
When the above processing is performed, a "relational database delay constraint check method" is required, which is a method for delaying the constraint check at the time of record update and performing the constraint check at the time of committing the transaction.

【0007】従来のこの種の関係データベース遅延制約
チェック方式は、例えば特開平2−33665号公報に
示されるように、更新時には更新されたレコード毎に制
約チェックに必要となる更新値やレコード識別子などを
記憶しておき、コミット時にその情報をもとに制約チェ
ックを行うことにより、制約に違反するレコードを検出
していた。
A conventional relational database delay constraint check method of this type is disclosed in, for example, Japanese Patent Laid-Open No. 33665/1990, when updating, an updated value or a record identifier required for constraint check for each updated record. And records that violate the constraints are detected by performing a constraint check based on the information at the time of commit.

【0008】[0008]

【発明が解決しようとする課題】上述した従来の関係デ
ータベース遅延制約チェック方式では、更新されたレコ
ード毎に制約チェックに必要なデータを記憶しておく必
要があるため、以下に示すような問題点があった。
In the above-described conventional relational database delay constraint check method, it is necessary to store data necessary for constraint check for each updated record. was there.

【0009】第1の問題点は、更新するレコードの件数
に比例して多くの記憶容量が必要となることである。従
来の方式では、更新されたレコード毎に制約チェックに
必要なデータを記憶しておく必要があり、レコード件数
と比例して制約チェックのためのデータの情報量が増加
する。このデータ(制約チェックに必要なデータ)は主
記憶装置に記憶することが一般的であるが、レコード件
数が多くなると主記憶装置に入りきらなくなる可能性が
ある。この場合、一旦、二次記憶装置にデータを退避す
ることも可能であるが、主記憶装置に対するアクセス速
度に比べて二次記憶装置に対するアクセス速度は非常に
遅く、二次記憶装置への退避によってデータを記憶して
おくメリットが失われてしまう。
A first problem is that a large storage capacity is required in proportion to the number of records to be updated. In the conventional method, it is necessary to store data necessary for constraint checking for each updated record, and the amount of data for constraint checking increases in proportion to the number of records. This data (data necessary for constraint checking) is generally stored in the main storage device. However, if the number of records increases, the data may not be able to be stored in the main storage device. In this case, it is possible to temporarily save the data to the secondary storage device, but the access speed to the secondary storage device is much slower than the access speed to the main storage device. The merit of storing data is lost.

【0010】第2の問題点は、制約チェックのための条
件判定の回数が多くなることである。コミット時には更
新したレコード毎に制約をチェックしなければならず、
更新したレコードの件数が多いと、それに比例して制約
チェックのための条件判定の回数が増加し、大きなオー
バヘッドがかかってしまう。
[0010] The second problem is that the number of condition determinations for constraint checking increases. When committing, you must check the constraints for each updated record,
When the number of updated records is large, the number of condition determinations for constraint checking increases in proportion to the number of updated records, resulting in a large overhead.

【0011】本発明の目的は、上述の点に鑑み、制約チ
ェックを遅延させるために保存するデータの情報量(更
新時の登録情報量)を削減することによって主記憶装置
の有効利用を可能にするとともに、コミット時の制約チ
ェックに要する条件判定の回数の削減(制約チェック時
の処理の簡易化)を実現して遅延制約チェックのための
オーバヘッドを削減すること(処理の高速化を図るこ
と)を可能ならしめる関係データベース遅延制約チェッ
ク方式を提供することにある。
In view of the above, an object of the present invention is to make it possible to effectively use a main storage device by reducing the information amount of data to be stored (registration information amount at the time of updating) to delay a constraint check. To reduce the number of condition determinations required for constraint checking at the time of committing (simplification of processing at the time of constraint checking), thereby reducing overhead for delay constraint checking (attaining faster processing). It is an object of the present invention to provide a relational database delay constraint check method that makes possible.

【0012】[0012]

【課題を解決するための手段】[Means for Solving the Problems]

(1) 本発明の構成 本発明の関係データベース遅延制約チェック方式は、利
用者からの指定によりレコード更新時の制約チェックを
遅延させトランザクションのコミット時に制約チェック
を行う関係データベースシステムにおいて、利用者から
の要求内容が制約チェック遅延要求であった場合に主記
憶装置上の遅延情報テーブルに要求対象の制約に関する
情報を登録する制約遅延手段と、利用者からの要求内容
がレコード更新要求であった場合に要求対象のレコード
を更新し、その更新に関係する制約の情報が前記遅延情
報テーブルに登録されている場合にはその制約に関する
制約チェックを遅延させた旨を示す情報を前記遅延情報
テーブルに設定する更新処理手段と、コミット要求に対
して、当該コミット要求に関連する制約であり前記遅延
情報テーブルに遅延状態を示す情報が設定されている制
約に関する情報を取得し、その情報に基づき表に対して
制約条件に違反するレコードを検出する問い合わせを動
的に生成し実行することにより制約チェックを行う遅延
制約チェック手段と、利用者からの要求内容がトランザ
クションの終了を示すコミット要求であった場合に、前
記遅延制約チェック手段を呼び出し、制約違反が検出さ
れなかった場合に限りコミット処理を継続するトランザ
クション制御手段と、利用者からの要求内容を解析し
て、その要求内容によって前記制約遅延手段,前記更新
処理手段,および前記トランザクション制御手段のいず
れかを呼び出す要求内容解析手段とを有する。
(1) Configuration of the Present Invention The relational database delay constraint check method according to the present invention provides a relational database system in which a constraint check at the time of record update is delayed by a user's specification and a constraint check is performed at the time of committing a transaction. A constraint delay means for registering information on a constraint to be requested in a delay information table on a main storage device when the request content is a constraint check delay request; Updating a record to be requested and, if information on a constraint related to the update is registered in the delay information table, sets information indicating that constraint checking on the constraint has been delayed in the delay information table. Update processing means and, for a commit request, a constraint related to the commit request; By acquiring information on constraints for which information indicating the delay status is set in the delay information table, and dynamically generating and executing a query for detecting a record that violates the constraints on the table based on the information, the constraint is obtained. A delay constraint checking unit for performing a check, and when the request content from the user is a commit request indicating the end of a transaction, the delay constraint checking unit is called, and commit processing is performed only when a constraint violation is not detected. It has a transaction control unit that continues and a request content analysis unit that analyzes the contents of a request from a user and calls one of the constraint delay unit, the update processing unit, and the transaction control unit according to the request contents.

【0013】(2) 以上のように構成された本発明の
関係データベース遅延制約チェック方式について、以下
に若干の説明を加える。
(2) The relational database delay constraint check method according to the present invention configured as described above will be described below.

【0014】従来の関係データベース遅延制約チェック
方式は、更新されたレコード毎に制約チェックに必要な
データを記憶しておき、そのデータを利用してコミット
時に更新レコード毎に制約チェックを行う。
In the conventional relational database delay constraint checking method, data necessary for constraint checking is stored for each updated record, and the constraint is checked for each updated record at the time of commit using the data.

【0015】これに対して、本発明の関係データベース
遅延制約チェック方式は、遅延された制約毎に登録され
た表と制約情報とを記憶し、コミット時に制約対象の表
に対して制約条件に違反するレコードを検出する問い合
わせを動的に生成・実行することにより、制約チェック
(遅延制約チェック)を行う。
On the other hand, the relational database delay constraint check method of the present invention stores a table registered for each delayed constraint and constraint information, and violates a constraint condition on a table to be restricted upon commit. A constraint check (delay constraint check) is performed by dynamically generating and executing a query for detecting a record to be executed.

【0016】これによって、本発明によると、レコード
更新時に記憶する情報量はレコードの件数に依存するこ
となく一定の量で済み、更新レコードの件数が多いほど
従来の方式に比べて主記憶装置内の領域を使用する量が
少なくなる。
Thus, according to the present invention, the amount of information to be stored at the time of updating a record can be a fixed amount without depending on the number of records. The amount of use of the area is reduced.

【0017】また、本発明の関係データベース遅延制約
チェック方式では、動的に問い合わせを生成・実行する
際に、制約条件によっては、表に定義されているインデ
ックス等の情報をもとに高速に処理することが可能とな
る。すなわち、レコード毎に制約をチェックする従来の
方式に比べて、より効率的に制約チェックを行うことが
可能となる。
Further, in the relational database delay constraint checking method of the present invention, when a query is dynamically generated and executed, depending on constraint conditions, high-speed processing is performed based on information such as indexes defined in a table. It is possible to do. That is, the constraint check can be performed more efficiently than the conventional method of checking the constraint for each record.

【0018】図7は、制約条件に違反するレコードを検
出するために動的に生成される問い合わせの一例を示す
図である。図7では、社員表の給与項目に対して、給与
の値が150000から2000000までの範囲でな
ければならないことを強制する制約(下線部分)が定義
されている。
FIG. 7 is a diagram showing an example of a query dynamically generated to detect a record that violates a constraint. In FIG. 7, a constraint (underlined portion) is defined that enforces that the salary value must be in the range of 150,000 to 2,000,000 for the salary item in the employee table.

【0019】これをもとに生成される問い合わせは、社
員表から給与の値が150000から2000000ま
での範囲にないレコードを選択する内容を有している。
このような問い合わせを使用することによって、給与項
目に対してインデックスが定義されている場合には、1
50000から2000000までの範囲内にない値
(すなわち、150000よりも小さい値または200
0000よりも大きい値)の有無を非常に高速に検索す
ることが可能となる。
The inquiry generated based on this has a content for selecting a record whose salary value is not in the range of 150,000 to 2,000,000 from the employee table.
By using such a query, if an index is defined for a salary item, 1
Values not in the range of 50,000 to 2,000,000 (ie, values less than 150,000 or 200
(A value larger than 0000) can be searched very quickly.

【0020】[0020]

【発明の実施の形態】次に、本発明の実施例について図
面を参照して詳細に説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, embodiments of the present invention will be described in detail with reference to the drawings.

【0021】[0021]

【実施例】図1(a)は、本発明の関係データベース遅
延制約チェック方式の一実施例の構成を示すブロック図
である。
FIG. 1A is a block diagram showing the configuration of an embodiment of a relational database delay constraint check system according to the present invention.

【0022】本実施例の関係データベース遅延制約チェ
ック方式は、要求内答解析手段101と、制約遅延手段
102と、更新処理手段103と、トランザクション制
御手段104と、遅延制約チェック手段105と、主記
憶装置110と、二次記憶装置111とを含んで構成さ
れている。
The relational database delay constraint check method of the present embodiment includes a request answer answer analysis means 101, a constraint delay means 102, an update processing means 103, a transaction control means 104, a delay constraint check means 105, a main memory. It is configured to include a device 110 and a secondary storage device 111.

【0023】主記憶装置110は、遅延情報テーブル1
06を含む。
The main storage device 110 stores the delay information table 1
06.

【0024】二次記憶装置111は、データベース10
7と、ディレクトリ108とを含む。
The secondary storage device 111 stores the database 10
7 and a directory 108.

【0025】要求内容解析手段101は、利用者からの
要求を入力し、その内容を解析する。利用者からの要求
の種類には、以下の〜に示すものが含まれる。 制約チェック遅延要求 レコード更新要求 コミット/ロールバック(ROLLBACK)要求
(コミット要求またはロールバック要求)
The request content analysis means 101 inputs a request from a user and analyzes the content. The types of requests from users include those shown in the following (1) to (4). Constraint check delay request Record update request Commit / rollback (ROLLBACK) request (commit request or rollback request)

【0026】要求内容解析手段101は、利用者からの
要求の種類が「制約チェック遅延要求」の場合には制約
遅延手段102を呼び出し、要求の種類が「レコード更
新要求」の場合には更新処理手段103を呼び出し、要
求の種類が「コミット/ロールバック要求」の場合には
トランザクション制御手段104を呼び出す。
The request content analysis means 101 calls the restriction delay means 102 when the type of the request from the user is "constraint check delay request", and performs the update processing when the type of request is "record update request". When the request type is “commit / rollback request”, the transaction control unit 104 is called.

【0027】制約遅延手段102は、要求内容解析手段
101によって解析された制約チェック遅延要求をもと
に、ディレクトリ108を参照して遅延要求された制約
の有無を確認し、遅延要求された制約が存在しなければ
エラーを返却し、遅延要求された制約が存在すればさら
に必要な情報を読み出し、その情報を遅延情報テーブル
106に登録する。
Based on the constraint check delay request analyzed by the request content analysis unit 101, the constraint delay unit 102 refers to the directory 108 to check whether there is a constraint requested to be delayed. If it does not exist, an error is returned. If there is a constraint requested to be delayed, more necessary information is read out and registered in the delay information table 106.

【0028】更新処理手段103は、要求内容解析手段
101によって解析されたレコード更新要求をもとに、
ディレクトリ108を参照して属性や制約の有無等の情
報を取得し、データベース107に格納されているレコ
ードを更新する。その際、遅延情報テーブル106を参
照し、更新対象のレコードが格納されている表に対して
定義されている制約が登録されているか否かを確認し、
登録されていればその制約の制約チェックが遅延された
ことを示すフラグをオン(ON)にし、制約チェックを
行わずに処理を終了する。その制約が遅延情報テーブル
106に登録されていなければ、更新内答をもとに制約
チェックを行う。
The update processing means 103, based on the record update request analyzed by the request content analysis means 101,
Information such as the presence or absence of attributes and restrictions is acquired with reference to the directory 108, and the record stored in the database 107 is updated. At that time, by referring to the delay information table 106, it is checked whether the constraint defined for the table storing the record to be updated is registered,
If registered, the flag indicating that the constraint check of the constraint has been delayed is turned on (ON), and the process ends without performing the constraint check. If the constraint is not registered in the delay information table 106, a constraint check is performed based on the updated answer.

【0029】トランザクション制御手段104は、要求
内容解析手段101によって解析されたコミット/ロー
ルバック要求をもとに、トランザクションの確定処理
(コミット処理)または復旧処理(ロールバック処理)
を行う。ここで、コミット要求の場合に限り、トランザ
クションを確定する前に遅延制約チェック手段105を
呼び出す。遅延制約チェック手段105からエラー(異
常終了)が返却された場合には、トランザクションの確
定処理を行わずに復旧処理に切り替える。遅延制約チェ
ック手段105が正常終了した場合には、遅延情報テー
ブル106に登録されている情報を削除し、全ての制約
が遅延されていない状態に戻す。ロールバック要求の場
合には、レコードに対する更新が無効となるため、制約
チェックの必要はない。
The transaction control means 104 determines the transaction (commit processing) or restores the transaction (rollback processing) based on the commit / rollback request analyzed by the request content analyzing means 101.
I do. Here, only in the case of a commit request, the delay constraint check unit 105 is called before the transaction is determined. When an error (abnormal termination) is returned from the delay constraint checking unit 105, the process is switched to the recovery process without performing the transaction confirmation process. When the delay constraint checking means 105 ends normally, the information registered in the delay information table 106 is deleted, and all the constraints are returned to a state where they are not delayed. In the case of a rollback request, there is no need to perform constraint checking because updating of records is invalidated.

【0030】遅延制約チェック手段105は、遅延情報
テーブル106を参照し、制約チェックが遅延された制
約が存在する場合には、登録されている情報をもとに制
約に違反するレコードの存在の有無をチェックする。制
約に違反するレコードが存在する場合にはエラーを返却
する。
The delay constraint checking means 105 refers to the delay information table 106, and if there is a constraint whose constraint check has been delayed, the presence or absence of a record violating the constraint based on the registered information. Check. If there is a record that violates the constraint, an error is returned.

【0031】遅延情報テーブル106は、制約チェック
遅延要求のあった制約に関する情報を格納するためのテ
ーブルであり、主記憶装置110上に確保される。遅延
情報テーブル106は、制約遅延手段102,更新処理
手段103,および遅延制約チェック手段105によっ
て参照/更新される。
The delay information table 106 is a table for storing information relating to a constraint for which a constraint check delay has been requested, and is secured on the main storage device 110. The delay information table 106 is referenced / updated by the constraint delay unit 102, the update processing unit 103, and the delay constraint check unit 105.

【0032】図1(b)に示すように、遅延情報テーブ
ル106は、各制約に対して、制約識別情報,制約内容
情報,および制約遅延フラグからなるエントリを有して
いる。なお、遅延情報テーブル106の構造は、図1
(b)に示すものに限られるものではない。
As shown in FIG. 1B, the delay information table 106 has, for each constraint, an entry including constraint identification information, constraint content information, and a constraint delay flag. The structure of the delay information table 106 is shown in FIG.
It is not limited to the one shown in FIG.

【0033】データベース107は、表のレコードイン
デックスなどを格納する。データベース107は、二次
記憶装置111上に確保される。
The database 107 stores a table record index and the like. The database 107 is secured on the secondary storage device 111.

【0034】ディレクトリ108は、当該関係データベ
ースシステムで1つ存在し、表,インデックス,および
制約などの情報を格納する。ディレクトリ108もま
た、二次記憶装置111上に確保される。
One directory 108 exists in the relational database system, and stores information such as tables, indexes, and constraints. The directory 108 is also reserved on the secondary storage device 111.

【0035】図2は、制約遅延手段102の処理手順を
示すフローチャート(流れ図)である。この処理手順
は、制約有無判定ステップ201と、制約内容取得ステ
ップ202と、制約内容登録ステップ203と、制約遅
延フラグオフステップ204とからなる。なお、制約遅
延手段102の処理手順は同様の処理内容を得られるも
のであれば、図2に示す処理手順に限定されるものでは
ない(図3〜図5のフローチャートについても同様)。
FIG. 2 is a flowchart (flow chart) showing a processing procedure of the constraint delay means 102. This processing procedure includes a constraint presence / absence determination step 201, a constraint content acquisition step 202, a constraint content registration step 203, and a constraint delay flag off step 204. Note that the processing procedure of the constraint delay unit 102 is not limited to the processing procedure shown in FIG. 2 as long as the same processing content can be obtained (the same applies to the flowcharts of FIGS. 3 to 5).

【0036】図3は、更新処理手段103の処理手順を
示すフローチャートである。この処理手順は、レコード
更新ステップ301と、制約有無判定ステップ302
と、遅延情報テーブル登録有無判定ステップ303と、
制約チェックステップ304と、制約遅延フラグオンス
テップ305と、制約違反判定ステップ306とからな
る。
FIG. 3 is a flowchart showing the processing procedure of the update processing means 103. This processing procedure includes a record update step 301 and a constraint presence / absence determination step 302.
And a delay information table registration presence / absence determination step 303;
Consisting of a constraint check step 304, a constraint delay flag on step 305, and a constraint violation determination step 306.

【0037】図4は、トランザクション制御手段104
の処理手順を示すフローチャートである。この処理手順
は、コミット要求/ロールバック要求判定ステップ40
1と、遅延制約チェック手段呼び出しステップ402
と、正常終了判定ステップ403と、トランザクション
確定処理ステップ404と、第1トランザクション復旧
処理ステップ405と、第2トランザクション復旧処理
ステップ406とからなる。
FIG. 4 shows the transaction control means 104.
6 is a flowchart showing the processing procedure of FIG. This processing procedure includes a commit request / rollback request determination step 40
1 and delay constraint check means calling step 402
, A normal end determination step 403, a transaction confirmation processing step 404, a first transaction recovery processing step 405, and a second transaction recovery processing step 406.

【0038】図5は、遅延制約チェック手段105の処
理手順を示すフローチャートである。この処理手順は、
遅延情報テーブル登録有無判定ステップ501と、制約
遅延フラグ判定ステップ502と、問い合わせ生成ステ
ップ503と、問い合わせ実行ステップ504と、問い
合わせ結果有無判定ステップ505とからなる。
FIG. 5 is a flowchart showing the processing procedure of the delay constraint checking means 105. This procedure is
It comprises a delay information table registration presence / absence determination step 501, a constraint delay flag determination step 502, an inquiry generation step 503, an inquiry execution step 504, and an inquiry result presence / absence determination step 505.

【0039】次に、このように構成された本実施例の関
係データベース遅延制約チェック方式の動作について説
明する。
Next, the operation of the relational database delay constraint check method of the present embodiment configured as described above will be described.

【0040】(1) 要求内容解析手段101は、利用
者から要求を受け取り、要求の種類が「制約チェック遅
延要求」の場合には制約遅延手段102を呼び出し、要
求の種類が「レコード更新要求」の場合には更新処理手
段103を呼び出し、要求の種類が「コミット/ロール
バック要求」の場合にはトランザクション制御手段10
4を呼び出す。
(1) The request content analysis means 101 receives a request from a user, and calls the constraint delay means 102 when the type of request is "constraint check delay request", and the request type is "record update request". If the request type is "commit / rollback request", the transaction control means 10 is called.
Call 4

【0041】(2) 要求内容解析手段101によって
呼び出された制約遅延手段102は、以下に示すような
処理を行う(図2参照)。
(2) The constraint delay means 102 called by the request content analysis means 101 performs the following processing (see FIG. 2).

【0042】まず、二次記憶装置111内のディレクト
リ108を参照して、利用者から要求のあった制約が存
在するか否かを判定(確認)する(ステップ201)。
First, referring to the directory 108 in the secondary storage device 111, it is determined (confirmed) whether or not there is a constraint requested by the user (step 201).

【0043】ステップ201で「その制約が存在しな
い」と判定した場合には、エラーを返却して異常終了す
る。
If it is determined in step 201 that the constraint does not exist, an error is returned and the process ends abnormally.

【0044】ステップ201で「その制約が存在する」
と判定した場合には、ディレクトリ108から目的の制
約の内容を取得し(ステップ202)、その内容を主記
憶装置110内の遅延情報テーブル106に登録する
(ステップ203)。すなわち、その制約に関するエン
トリを遅延情報テーブル106に登録し、そのエントリ
中の制約識別情報にその制約の識別情報を設定し、その
エントリ中の制約内容情報にステップ202で取得した
内容を設定する。
In step 201, "there is a constraint"
If it is determined, the contents of the target constraint are acquired from the directory 108 (step 202), and the contents are registered in the delay information table 106 in the main storage device 110 (step 203). That is, an entry relating to the constraint is registered in the delay information table 106, the constraint identification information in the entry is set to the constraint identification information, and the content acquired in step 202 is set to the constraint content information in the entry.

【0045】さらに、ステップ203で登録したエント
リ中の制約遅延フラグをオフ(OFF)に初期化し(ス
テップ204)、正常に処理を終了する。
Further, the constraint delay flag in the entry registered in step 203 is initialized to off (OFF) (step 204), and the process ends normally.

【0046】(3) 要求内容解析手段101によって
呼び出された更新処理手段103は、以下に示すような
処理を行う(図3参照)。
(3) The update processing means 103 called by the request content analysis means 101 performs the following processing (see FIG. 3).

【0047】まず、利用者からの要求に従って、二次記
憶装置111内のデータベース107中の表のレコード
を更新する(ステップ301)。
First, in accordance with a request from the user, the table record in the database 107 in the secondary storage device 111 is updated (step 301).

【0048】次に、ステップ301の更新内容をもとに
ディレクトリ108を参照し、チェックすべき制約の有
無を判定(確認)する(ステップ302)。
Next, it is determined (confirmed) whether or not there is a constraint to be checked by referring to the directory 108 based on the updated contents of step 301 (step 302).

【0049】ステップ302で「チェックすべき制約が
存在しない」と判定した場合には、正常に処理を終了す
る。
If it is determined in step 302 that "there is no constraint to be checked", the process ends normally.

【0050】ステップ302で「チェックすべき制約が
存在する」と判定した場合には、その制約の制約識別情
報で遅延情報テーブル106を検索し、その制約が遅延
情報テーブル106に登録されているか否かを判定する
(ステップ303)。
If it is determined in step 302 that "a constraint to be checked exists", the delay information table 106 is searched using the constraint identification information of the constraint, and whether the constraint is registered in the delay information table 106 is determined. Is determined (step 303).

【0051】ステップ303で「その制約が遅延情報テ
ーブル106に登録されている」と判定した場合には、
その制約のエントリ中の制約遅延フラグをオンに設定
(更新)し(ステップ305)、その後ステップ302
に戻ってさらにチェックすべき制約が存在するか否かを
確認し、以後の処理を継続する。
If it is determined in step 303 that the constraint is registered in the delay information table 106,
The constraint delay flag in the entry of the constraint is set to ON (update) (step 305), and then step 302
To confirm whether there is a constraint to be further checked, and continue the subsequent processing.

【0052】ステップ303で「その制約が遅延情報テ
ーブル106に登録されていない」と判定した場合に
は、即時にその制約をチェックし(ステップ304)、
更新レコードが制約に違反しているか否かを判定する
(ステップ306)。
If it is determined in step 303 that the constraint is not registered in the delay information table 106, the constraint is immediately checked (step 304).
It is determined whether the update record violates the constraint (step 306).

【0053】ステップ306で「更新レコードが制約に
違反している」と判定した場合には、エラーを返却して
異常終了する。
If it is determined in step 306 that "the updated record violates the constraint", an error is returned and the process ends abnormally.

【0054】ステップ306で「更新レコードが制約に
違反していない」と判定した場合には、ステップ302
に戻ってさらにチェックすべき制約が存在するか否かを
確認し、以後の処理を継続する。
If it is determined in step 306 that “the updated record does not violate the constraint”, step 302
To confirm whether there is a constraint to be further checked, and continue the subsequent processing.

【0055】(4) 要求内容解析手段101によって
呼び出されたトランザクション制御手段104は、以下
に示すような処理を行う(図4参照)。
(4) The transaction control means 104 called by the request content analysis means 101 performs the following processing (see FIG. 4).

【0056】まず、コミット/ロールバック要求の要求
内容がコミット要求であるか否か(コミット要求である
かロールバック要求であるか)を判定する(ステップ4
01)。
First, it is determined whether the content of the commit / rollback request is a commit request (whether it is a commit request or a rollback request) (step 4).
01).

【0057】ステップ401で「要求内容がロールバッ
ク要求である」と判定した場合には、データベース10
7への更新のキャンセルや排他制御に用いたロックの解
放等を含むトランザクション復旧処理を行い(ステップ
405)、正常に処理を終了する。
If it is determined in step 401 that the request is a rollback request, the database 10
Transaction recovery processing including canceling the update to No. 7 and releasing the lock used for exclusive control is performed (step 405), and the processing ends normally.

【0058】ステップ401で「要求内答がコミット要
求である」と判定した場合には、遅延制約チェック手段
105を呼び出し(ステップ402)、その結果(呼び
出された遅延制約チェック手段105の処理結果(図5
参照))が正常終了であるか否かを判定する(ステップ
403)。
If it is determined in step 401 that "the answer is a commit request", the delay constraint checking means 105 is called (step 402), and the result (the processing result of the called delay constraint checking means 105 ( FIG.
) Is normally terminated (step 403).

【0059】ステップ403で「遅延制約チェック手段
105の処理結果が正常終了である」と判定した場合に
は、データベース107への更新の反映や排他制御に用
いたロックの解放等を含むトランザクション確定処理を
行い(ステップ404)、正常に処理を終了する。
If it is determined in step 403 that "the processing result of the delay constraint checking means 105 is a normal end", the transaction confirmation processing includes reflection of the update in the database 107, release of the lock used for exclusive control, and the like. (Step 404), and the process ends normally.

【0060】ステップ403で「遅延制約チェック手段
105の処理結果が異常終了である」と判定した場合に
は、データベース107への更新のキャンセルや排他制
御に用いたロックの解放等を含むトランザクション復旧
処理を行い(ステップ406)、エラーを返却して異常
終了する。
If it is determined in step 403 that "the processing result of the delay constraint check means 105 is abnormal termination", the transaction recovery processing includes canceling the update to the database 107 and releasing the lock used for exclusive control. (Step 406), an error is returned, and the process ends abnormally.

【0061】(5) トランザクション制御手段104
によって呼び出された遅延制約チェック手段105は、
以下に示すような処理を行う(図5参照)。
(5) Transaction control means 104
The delay constraint checking means 105 called by
The following processing is performed (see FIG. 5).

【0062】まず、遅延情報テーブル106を参照し
て、登録されている制約の有無を判定(確認)する(ス
テップ501)。
First, the presence or absence of a registered constraint is determined (confirmed) with reference to the delay information table 106 (step 501).

【0063】ステップ501で「制約が存在しない」と
判定した場合には、正常に処理を終了する。
If it is determined in step 501 that "there is no constraint", the process ends normally.

【0064】ステップ501で「制約が登録されてい
る」と判定した場合には、その制約の制約遅延フラグが
オンであるかオフであるかを判定する(ステップ50
2)。
If it is determined in step 501 that "the constraint is registered", it is determined whether the constraint delay flag of the constraint is on or off (step 50).
2).

【0065】ステップ502で「制約遅延フラグがオフ
である」と判定した場合には、ステップ501に戻って
さらに遅延情報テーブル106に登録されている制約が
存在するか否かを確認し、以後の処理を継続する。
If it is determined in step 502 that "the constraint delay flag is off", the flow returns to step 501 to check whether or not any constraint registered in the delay information table 106 exists. Continue processing.

【0066】ステップ502で「制約遅延フラグがオン
である」と判定した場合には、遅延情報テーブル106
に登録されている制約の内容をもとに、制約条件に違反
するレコードを検出するための問い合わせを生成し(ス
テップ503)、その問い合わせを実行する(ステップ
504)。
If it is determined in step 502 that “the constraint delay flag is on”, the delay information table 106
A query for detecting a record that violates the constraint condition is generated based on the content of the constraint registered in (step 503), and the query is executed (step 504).

【0067】次に、問い合わせ結果(ステップ504に
おける問い合わせの実行に対する結果)を確認し、問い
合わせ結果が存在するか否かを判定する(ステップ50
5)。
Next, the result of the inquiry (result for the execution of the inquiry in step 504) is confirmed, and it is determined whether or not the inquiry result exists (step 50).
5).

【0068】ステップ505で「問い合わせ結果が存在
する」と判定した場合には、制約を違反しているレコー
ドが存在することを認識し、エラーを返却して異常終了
する。
If it is determined in step 505 that "a query result exists", it is recognized that a record violating the constraint exists, an error is returned, and the process ends abnormally.

【0069】ステップ505で「問い合わせ結果が存在
しない」と判定した場合には、ステップ501に戻って
さらに遅延情報テーブル106に登録されている制約が
存在するか否かを確認し、以後の処理を継続する。
If it is determined in step 505 that “the inquiry result does not exist”, the flow returns to step 501 to check whether or not there is a constraint registered in the delay information table 106, and to perform the subsequent processing. continue.

【0070】[0070]

【発明の効果】以上説明したように、本発明によると、
以下に示すような効果が生じる。
As described above, according to the present invention,
The following effects are produced.

【0071】第1の効果は、制約チェックを遅延させる
ために保存すべきデータの情報量を削減することによっ
て、主記憶装置の有効利用が可能になることである。こ
れは、従来の方式では、更新されたレコード単位に制約
チェックに必要なデータを記憶していたのに対して、本
発明の関係データベース遅延制約チェック方式は、レコ
ード単位に記憶する情報が存在しないためである。
The first effect is that the effective use of the main storage device can be achieved by reducing the information amount of data to be stored in order to delay the constraint check. This is because, in the conventional method, data necessary for constraint checking is stored in updated record units, whereas in the relational database delay constraint checking method of the present invention, there is no information to be stored in record units. That's why.

【0072】第2の効果は、コミット時の制約チェック
に要する条件判定の回数を削減し、遅延制約チェックの
ためのオーバヘッドを削減することが可能になることで
ある。これは、従来の方式では、更新されたレコード単
位に制約チェックのための条件判定を行っていたのに対
して、本発明の関係データベース遅延制約チェック方式
は、表に対する問い合わせを実行しており、適切なイン
デックスを用いて高速に処理することが可能になるため
である。
The second effect is that it is possible to reduce the number of condition determinations required for constraint checking at the time of commit, and to reduce overhead for delay constraint checking. This is because, in the conventional method, the condition determination for the constraint check is performed for each updated record unit, whereas the relational database delay constraint check method of the present invention executes an inquiry to the table, This is because high-speed processing can be performed using an appropriate index.

【図面の簡単な説明】[Brief description of the drawings]

【図1】(a)は本発明の関係データベース遅延制約チ
ェック方式の一実施例の構成を示すブロック図であり、
(b)は(a)中の遅延情報テーブルの構造の一例を示
す図である。
FIG. 1A is a block diagram showing a configuration of an embodiment of a relational database delay constraint check method according to the present invention;
(B) is a diagram showing an example of the structure of the delay information table in (a).

【図2】図1(a)中の制約遅延手段の処理手順を示す
フローチャートである。
FIG. 2 is a flowchart showing a processing procedure of a constraint delay unit in FIG.

【図3】図1(a)中の更新処理手段の処理手順を示す
フローチャートである。
FIG. 3 is a flowchart showing a processing procedure of an update processing unit in FIG.

【図4】図1(a)中のトランザクション制御手段の処
理手順を示すフローチャートである。
FIG. 4 is a flowchart showing a processing procedure of a transaction control unit in FIG.

【図5】図1(a)中の遅延制約チェック手段の処理手
順を示すフローチャートである。
FIG. 5 is a flowchart showing a processing procedure of a delay constraint check unit in FIG.

【図6】制約を即時にチェックせずにコミット時まで遅
延することが有効なトランザクション処理の一例を示す
図である。
FIG. 6 is a diagram illustrating an example of transaction processing in which it is effective to delay until commit without immediately checking a constraint;

【図7】本発明の関係データベース遅延制約チェック方
式によって制約から生成される問い合わせの一例を示す
図である。
FIG. 7 is a diagram showing an example of an inquiry generated from a constraint by the relational database delay constraint checking method of the present invention.

【符号の説明】[Explanation of symbols]

101 要求内容解析手段 102 制約遅延手段 103 更新処理手段 104 トランザクション制御手段 105 遅延制約チェック手段 106 遅延情報テーブル 107 データベース 108 ディレクトリ 110 主記憶装置 111 二次記憶装置 101 Request Contents Analysis Unit 102 Constraint Delay Unit 103 Update Processing Unit 104 Transaction Control Unit 105 Delay Constraint Check Unit 106 Delay Information Table 107 Database 108 Directory 110 Main Storage Device 111 Secondary Storage Device

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G06F 12/00 518 G06F 12/00 512 G06F 12/00 531 G06F 17/30 340 ──────────────────────────────────────────────────続 き Continued on the front page (58) Fields surveyed (Int. Cl. 7 , DB name) G06F 12/00 518 G06F 12/00 512 G06F 12/00 531 G06F 17/30 340

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 利用者からの指定によりレコード更新時
の制約チェックを遅延させトランザクションのコミット
時に制約チェックを行う関係データベースシステムにお
いて、 利用者からの要求内容が制約チェック遅延要求であった
場合に主記憶装置上の遅延情報テーブルに要求対象の制
約に関する情報を登録する制約遅延手段と、 利用者からの要求内容がレコード更新要求であった場合
に要求対象のレコードを更新し、その更新に関係する制
約の情報が前記遅延情報テーブルに登録されている場合
にはその制約に関する制約チェックを遅延させた旨を示
す情報を前記遅延情報テーブルに設定する更新処理手段
と、 コミット要求に対して、当該コミット要求に関連する制
約であり前記遅延情報テーブルに遅延状態を示す情報が
設定されている制約に関する情報を取得し、その情報に
基づき表に対して制約条件に違反するレコードを検出す
る問い合わせを動的に生成し実行することにより制約チ
ェックを行う遅延制約チェック手段と、利用者からの要
求内容がトランザクションの終了を示すコミット要求で
あった場合に、前記遅延制約チェック手段を呼び出し、
制約違反が検出されなかった場合に限りコミット処理を
継続するトランザクション制御手段と、 利用者からの要求内容を解析して、その要求内容によっ
て前記制約遅延手段,前記更新処理手段,および前記ト
ランザクション制御手段のいずれかを呼び出す要求内容
解析手段とを有することを特徴とする関係データベース
遅延制約チェック方式。
1. A relational database system which delays constraint checking at the time of record update according to designation by a user and performs constraint checking at the time of committing a transaction. A constraint delay unit for registering information on a constraint to be requested in a delay information table on a storage device; and updating a record to be requested when a request content from a user is a record update request, and relating to the update. An update processing unit configured to set, in the delay information table, information indicating that a constraint check on the constraint has been delayed when the constraint information is registered in the delay information table; A restriction related to the request, wherein the information indicating the delay state is set in the delay information table. Delay constraint checking means for acquiring information about contracts, dynamically generating and executing a query for detecting a record that violates a constraint condition with respect to a table based on the information, and performing constraint checking, and a request from a user If the content is a commit request indicating the end of the transaction, call the delay constraint checking means,
A transaction control means for continuing the commit process only when no constraint violation is detected; a request content from a user is analyzed; and the constraint delay means, the update processing means, and the transaction control means according to the request content. And a request content analyzing means for calling any one of the following.
【請求項2】 遅延情報テーブルが制約識別情報,制約
内容情報,および制約遅延フラグからなるエントリを有
することを特徴とする請求項1記載の関係データベース
遅延制約チェック方式。
2. The relational database delay constraint check method according to claim 1, wherein the delay information table has an entry consisting of constraint identification information, constraint content information, and a constraint delay flag.
JP01583797A 1997-01-13 1997-01-13 Relational database delay constraint check method Expired - Lifetime JP3196925B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP01583797A JP3196925B2 (en) 1997-01-13 1997-01-13 Relational database delay constraint check method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP01583797A JP3196925B2 (en) 1997-01-13 1997-01-13 Relational database delay constraint check method

Publications (2)

Publication Number Publication Date
JPH10198589A JPH10198589A (en) 1998-07-31
JP3196925B2 true JP3196925B2 (en) 2001-08-06

Family

ID=11899961

Family Applications (1)

Application Number Title Priority Date Filing Date
JP01583797A Expired - Lifetime JP3196925B2 (en) 1997-01-13 1997-01-13 Relational database delay constraint check method

Country Status (1)

Country Link
JP (1) JP3196925B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6928607B2 (en) * 2000-10-19 2005-08-09 Oracle International Corporation Data integrity verification mechanism
US8171003B2 (en) 2007-06-06 2012-05-01 Kunio Kamimura Method and apparatus for changing reference of database
JP4573277B2 (en) 2007-06-06 2010-11-04 株式会社アテナテレコムラボ Database conflict resolution method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JEFFREY D.ULLMAN著,國井利▲泰▼,大保信夫訳,「データベース・システムの原理」,日本コンピュータ協会,昭和60年5月25日発行,P422−P428(10.1 一貫性)

Also Published As

Publication number Publication date
JPH10198589A (en) 1998-07-31

Similar Documents

Publication Publication Date Title
US6772155B1 (en) Looking data in a database system
US5809238A (en) Data server with event driven sampling
US6029160A (en) Method and means for linking a database system with a system for filing data
US6879981B2 (en) Sharing live data with a non cooperative DBMS
US6216135B1 (en) Method of determining visibility to a remote database client of a plurality of database transactions having variable visibility strengths
AU2006240541B2 (en) Systems and methods for manipulating data in a data storage system
US6178425B1 (en) Method of determining the visibility to a remote database client of a plurality of database transactions using simplified visibility rules
US6684438B2 (en) Method of using cache to determine the visibility to a remote database client of a plurality of database transactions
US5640555A (en) Performance optimization in a heterogeneous, distributed database environment
US6240413B1 (en) Fine-grained consistency mechanism for optimistic concurrency control using lock groups
US5220665A (en) Method and system for supporting concurrent use during sequential batch applications utilizing persistent cursors
Barbard et al. The Demarcation Protocol: A technique for maintaining linear arithmetic constraints in distributed database systems
KR0126245B1 (en) Locking mechanism for check in/check out model
US6823514B1 (en) Method and system for caching across multiple contexts
JP2002528788A (en) Model impact analysis
US6092163A (en) Pageable filter driver for prospective implementation of disk space quotas
US6959305B2 (en) Unique identification of SQL cursor occurrences in a repetitive, nested environment
Joshi Adaptive Locking Strategies in a Multi-node Data Sharing Environment.
JP3196925B2 (en) Relational database delay constraint check method
US20040236744A1 (en) Method for ensuring referential integrity in highly concurrent datbase environments
US20130268503A1 (en) Database navigation of changes at commit time
Choi et al. XPath-based concurrency control for XML data
Lomet et al. Using the lock manager to choose timestamps
US6889358B1 (en) Concurrency control in materialized views of a database
Kiviniemi et al. Transaction processing in the RODAIN real-time database system

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080608

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090608

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100608

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100608

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110608

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110608

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120608

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120608

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130608

Year of fee payment: 12

EXPY Cancellation because of completion of term