JP2010015344A - Database system - Google Patents

Database system Download PDF

Info

Publication number
JP2010015344A
JP2010015344A JP2008174134A JP2008174134A JP2010015344A JP 2010015344 A JP2010015344 A JP 2010015344A JP 2008174134 A JP2008174134 A JP 2008174134A JP 2008174134 A JP2008174134 A JP 2008174134A JP 2010015344 A JP2010015344 A JP 2010015344A
Authority
JP
Japan
Prior art keywords
database
data
vacuum
unit
temporary memory
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.)
Withdrawn
Application number
JP2008174134A
Other languages
Japanese (ja)
Inventor
Tetsuo Mori
哲生 森
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.)
Murata Machinery Ltd
Original Assignee
Murata Machinery Ltd
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 Murata Machinery Ltd filed Critical Murata Machinery Ltd
Priority to JP2008174134A priority Critical patent/JP2010015344A/en
Publication of JP2010015344A publication Critical patent/JP2010015344A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a database system using simultaneous execution control, wherein vacuum processing and update processing do not adversely effect each other. <P>SOLUTION: A copy part 133 copies a database file for vacuum processing to a temporary memory 12 from a database 11. A vacuum part 132 executes the vacuum processing in the temporary memory 12 not but in the database 11. An overwrite part 134 overwrites the database file subjected to the vacuum processing into the database 11 from the temporary memory 12. The vacuum part 132 executes the vacuum processing to the temporary memory 12. User terminals 2, 3 execute the update processing to the database 11. Even when the vacuum processing needs a long time, the vacuum processing and the update processing do not adversely effect each other. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、同時実行制御を利用するデータベースシステムにおいて、同時実行制御により発生する過剰データを削除して、データベースの操作性を向上させる技術に関する。   The present invention relates to a technique for improving the operability of a database by deleting excess data generated by the concurrent execution control in a database system using the concurrent execution control.

同時実行制御を利用するデータベースシステムがある。すなわち、データベースシステムは、あるユーザ端末からあるデータに対する書き込み指示を受け付けているときでも、他のユーザ端末からそのデータに対する読み込み指示を受け付けられる。   There are database systems that use concurrency control. That is, even when the database system accepts a write instruction for certain data from a certain user terminal, it can accept a read instruction for that data from another user terminal.

データベースシステムは、読み込み指示を受け付けるときには、いまだコミットされていないデータを提供するのではなく、すでにコミットされているデータを提供する。すなわち、データベースシステムは、読み込み指示を受け付けるときには、整合性が保証されていないデータを提供するのではなく、整合性が保証されているデータを提供する。   When receiving a read instruction, the database system provides data that has already been committed, not data that has not yet been committed. That is, when receiving a read instruction, the database system provides data that is guaranteed to be consistent, not data that is not guaranteed to be consistent.

データベースシステムは、ある時刻(第1時刻)においてすでにコミットされているデータを提供するために、第1時刻において書き込み指示を受け付けているときでも、第1時刻においてすでにコミットされているデータを格納している必要がある。   In order to provide data already committed at a certain time (first time), the database system stores data already committed at the first time, even when a write instruction is accepted at the first time. Need to be.

データベースシステムは、後の時刻(第2時刻)においてすでにコミットされているデータを提供するために、第2時刻において書き込み指示を受け付けているときでも、第2時刻においてすでにコミットされているデータを格納している必要がある。   The database system stores data that has already been committed at the second time, even when a write instruction is accepted at the second time, in order to provide data that has already been committed at a later time (second time). Need to be.

ここで、データベースシステムは、第1時刻、第2時刻、・・・においてすでにコミットされているデータを格納し続ける。しかし、データベースシステムは、第1時刻、第2時刻、・・・においてすでにコミットされているデータをいずれは提供しなくなる。そこで、データベースシステムは、これらのデータを過剰データとして格納し続ける。   Here, the database system continues to store data that has already been committed at the first time, the second time,. However, the database system will no longer provide data that has already been committed at the first time, the second time,. Therefore, the database system continues to store these data as excess data.

非特許文献1のデータベースシステムは、バキューム処理を実行する。すなわち、データベースシステムは、バキューム処理の直近以外にコミットされているデータを削除して、バキューム処理の直近にコミットされているデータを抽出する。そのため、データベースシステムは、データベースの操作性を向上させることができる。   The database system of Non-Patent Document 1 executes a vacuum process. In other words, the database system deletes data that has been committed other than immediately before the vacuum process, and extracts data that has been committed immediately before the vacuum process. Therefore, the database system can improve the operability of the database.

“PostgreSQL 8.3.1文書”、[online]、平成20年4月3日、PostgreSQL グローバル開発グループ、[平成20年6月4日検索]、インターネット<URL:http://www.postgresql.jp/document/pg831doc/html/>“PostgreSQL 8.3.1 Document”, [online], April 3, 2008, PostgreSQL Global Development Group, [Search June 4, 2008], Internet <URL: http: //www.postgresql. jp / document / pg831doc / html / >

非特許文献1のデータベースシステムは、バキューム処理および更新処理を実行するときには、バキューム処理により更新処理に悪影響を及ぼすことがあり、更新処理によりバキューム処理に悪影響を及ぼすことがある。データベースシステムは、バキューム処理に長時間を必要とするときには、以上の問題点を重要な問題点とすることになる。   When executing the vacuum process and the update process, the database system of Non-Patent Document 1 may adversely affect the update process by the vacuum process, and may adversely affect the vacuum process by the update process. When the database system requires a long time for the vacuum processing, the above problems become important problems.

そこで、本発明は前記問題点に鑑み、バキューム処理が長時間を必要とするときでも、バキューム処理が更新処理に悪影響を及ぼすことがなく、更新処理がバキューム処理に悪影響を及ぼすことがないデータベースシステムを提供することを目的とする。   Therefore, in view of the above problems, the present invention provides a database system in which even when the vacuum processing requires a long time, the vacuum processing does not adversely affect the update processing, and the update processing does not adversely affect the vacuum processing. The purpose is to provide.

上記課題を解決するため、請求項1記載の発明は、データベースシステムであって、データベースと、テンポラリメモリと、一のコミット前にコミットされたコミット前データと、前記一のコミット後にコミットされたコミット後データを、前記データベースから前記テンポラリメモリにコピーするコピー部と、前記テンポラリメモリでコピーされた前記コミット前データと前記コミット後データから、前記コミット前データを削除して前記コミット後データを抽出するバキューム部と、前記テンポラリメモリで抽出された前記コミット後データを、前記テンポラリメモリから前記データベースに上書きする上書き部と、を備えることを特徴とする。   In order to solve the above-mentioned problem, the invention according to claim 1 is a database system comprising a database, a temporary memory, pre-commit data committed before one commit, and a commit committed after the one commit. The post-commit data is extracted by deleting the pre-commit data from the pre-commit data and the post-commit data copied from the database to the temporary memory, and the pre-commit data and the post-commit data copied in the temporary memory. A vacuum unit, and an overwriting unit that overwrites the post-commit data extracted in the temporary memory from the temporary memory to the database.

請求項2記載の発明は、請求項1に記載のデータベースシステムにおいて、前記バキューム部は、前記コピー部により前記コミット前データと前記コミット後データがコピーされているなかで、前記データベースに格納されている前記コミット後データが更新されたときには、前記コミット後データの抽出を中止するバキューム中止部、を含むことを特徴とする。   According to a second aspect of the present invention, in the database system according to the first aspect, the vacuum unit is stored in the database while the pre-commit data and the post-commit data are copied by the copy unit. A vacuum canceling unit for canceling the extraction of the post-commit data when the post-commit data is updated.

請求項3記載の発明は、請求項1または請求項2に記載のデータベースシステムにおいて、前記上書き部は、前記バキューム部により前記コミット後データが抽出されているなかで、前記データベースに格納されている前記コミット後データが更新されたときには、前記コミット後データの上書きを中止する上書き中止部、を含むことを特徴とする。   According to a third aspect of the present invention, in the database system according to the first or second aspect, the overwriting unit is stored in the database while the post-commit data is extracted by the vacuum unit. And an overwrite canceling unit for canceling overwriting of the post-commit data when the post-commit data is updated.

請求項4記載の発明は、請求項1ないし請求項3のいずれかに記載のデータベースシステムにおいて、さらに、前記上書き部により前記コミット後データが上書きされているときには、前記データベースに排他的ロックをかける排他的ロック部、を備えることを特徴とする。   According to a fourth aspect of the present invention, in the database system according to any one of the first to third aspects, when the post-commit data is overwritten by the overwriting unit, an exclusive lock is applied to the database. An exclusive lock unit is provided.

データベースシステムは、データベース、テンポラリメモリ、コピー部、バキューム部、上書き部から構成される。データベースは、データを永続的に格納するが、テンポラリメモリは、データを一時的に格納する。   The database system includes a database, a temporary memory, a copy unit, a vacuum unit, and an overwrite unit. The database stores data permanently, while the temporary memory stores data temporarily.

コピー部は、バキューム処理の直近以外にコミットされているデータ、バキューム処理の直近にコミットされているデータを、データベースからテンポラリメモリにコピーする。バキューム部は、データベースにおいてではなく、テンポラリメモリにおいて、バキューム処理の直近以外にコミットされているデータを削除して、バキューム処理の直近にコミットされているデータを抽出する。上書き部は、バキューム処理の直近にコミットされているデータを、テンポラリメモリからデータベースに上書きする。   The copy unit copies data committed other than immediately before the vacuum process and data committed immediately after the vacuum process from the database to the temporary memory. The vacuum unit deletes data committed in the temporary memory other than the latest in the vacuum process, not in the database, and extracts data committed in the immediate vicinity of the vacuum process. The overwriting unit overwrites the data committed in the latest vacuum processing from the temporary memory to the database.

バキューム部は、テンポラリメモリに対して、バキューム処理を実行する。ユーザ端末は、データベースに対して、更新処理を実行する。データベースシステムは、バキューム処理に長時間を必要とするときでも、バキューム処理により更新処理に悪影響を及ぼすことがなく、更新処理によりバキューム処理に悪影響を及ぼすことがない。   The vacuum unit performs a vacuum process on the temporary memory. The user terminal executes update processing on the database. Even when a long time is required for the vacuum process, the database system does not adversely affect the update process by the vacuum process, and does not adversely affect the vacuum process by the update process.

{バキューム処理の概要}
以下、図面を参照しつつ、本発明の実施の形態について説明する。図1は、バキューム処理の概要を示すタイムチャートである。サーバ1は、データベースを格納する。ユーザ端末2、3は、データベースを操作する。サーバ1は、同時実行制御を利用する。
{Outline of vacuum processing}
Hereinafter, embodiments of the present invention will be described with reference to the drawings. FIG. 1 is a time chart showing an outline of the vacuum processing. The server 1 stores a database. The user terminals 2 and 3 operate the database. The server 1 uses simultaneous execution control.

ユーザ端末2は、トランザクション21を実行する。ユーザ端末3は、トランザクション31、32を実行する。トランザクション31は、トランザクション21と並行して実行されるが、トランザクション32は、トランザクション21とタイミングをずらして実行される。   The user terminal 2 executes the transaction 21. The user terminal 3 executes transactions 31 and 32. The transaction 31 is executed in parallel with the transaction 21, but the transaction 32 is executed at a different timing from the transaction 21.

サーバ1がステップS21の実行前にデータベースに格納しているデータは、直近トランザクションにおいてすでにコミットされており、ユーザ端末2により更新される前のデータ(既コミット更新前データ)である(ステップS11)。   The data stored in the database before the execution of step S21 by the server 1 is data that has already been committed in the most recent transaction and is not updated by the user terminal 2 (data that has already been committed update) (step S11). .

ユーザ端末2は、サーバ1に読み込み指示を送信する(ステップS21)。ユーザ端末2は、サーバ1から既コミット更新前データを取得して、図1に不図示の表示部に既コミット更新前データを表示する(ステップS22)。   The user terminal 2 transmits a reading instruction to the server 1 (step S21). The user terminal 2 obtains the data before the commit update from the server 1 and displays the data before the commit update on the display unit (not shown in FIG. 1) (step S22).

ユーザ端末2は、サーバ1に1回目の書き込み指示を送信する(ステップS23)。サーバ1がステップS23の実行後にログ情報に記録しているデータは、トランザクション21においていまだコミットされておらず、ユーザ端末2により更新されている最中のデータ(未コミット更新中データ)である(ステップS12)。   The user terminal 2 transmits a first write instruction to the server 1 (step S23). The data recorded in the log information by the server 1 after the execution of step S23 is data that has not yet been committed in the transaction 21 and is being updated by the user terminal 2 (uncommitted updating data) ( Step S12).

ユーザ端末2は、サーバ1に2回目の書き込み指示を送信する(ステップS24)。サーバ1がステップS24の実行後にログ情報に記録しているデータは、トランザクション21においていまだコミットされておらず、ユーザ端末2により更新された後のデータ(未コミット更新後データ)である(ステップS13)。   The user terminal 2 transmits a second write instruction to the server 1 (step S24). The data recorded in the log information by the server 1 after the execution of step S24 is data that has not yet been committed in the transaction 21 and has been updated by the user terminal 2 (data after uncommitted update) (step S13). ).

サーバ1は、ステップS23、S24における書き込み内容に整合性が認められるときには、コミット処理を実行する。サーバ1は、ステップS23、S24における書き込み内容に整合性が認められないときには、ロールバック処理を実行する。図1においては、サーバ1は、コミット処理を実行する(ステップS14)。   The server 1 executes the commit process when the written contents in steps S23 and S24 are recognized to be consistent. The server 1 executes a rollback process when the written contents in steps S23 and S24 are not consistent. In FIG. 1, the server 1 executes a commit process (step S14).

サーバ1がステップS14の実行後にデータベースに格納しているデータは、トランザクション21においてすでにコミットされており、ユーザ端末2により更新された後のデータ(既コミット更新後データ)である(ステップS15)。   The data stored in the database after execution of step S14 by the server 1 is data that has already been committed in the transaction 21 and has been updated by the user terminal 2 (data that has already been committed and updated) (step S15).

ユーザ端末3は、サーバ1に読み込み指示を送信する(ステップS31)。ここで、未コミット更新中データが、ログ情報に記録されている(ステップS12)。しかし、ユーザ端末3は、サーバ1から既コミット更新前データを取得して、図1に不図示の表示部に既コミット更新前データを表示する(ステップS32)。そのため、ユーザ端末3は、整合性が保証されたデータを取得できて表示できる。   The user terminal 3 transmits a reading instruction to the server 1 (step S31). Here, uncommitted updating data is recorded in the log information (step S12). However, the user terminal 3 obtains the data before the commit update from the server 1, and displays the data before the commit update on the display unit (not shown in FIG. 1) (step S32). Therefore, the user terminal 3 can acquire and display data with guaranteed consistency.

ユーザ端末3は、サーバ1に読み込み指示を送信する(ステップS33)。ここで、既コミット更新後データが、データベースに格納されている(ステップS15)。そこで、ユーザ端末3は、サーバ1から既コミット更新後データを取得して、図1に不図示の表示部に既コミット更新後データを表示する(ステップS34)。そのため、ユーザ端末3は、整合性が保証されたデータを取得できて表示できる。   The user terminal 3 transmits a reading instruction to the server 1 (step S33). Here, the data after the already committed update is stored in the database (step S15). Therefore, the user terminal 3 acquires the data after the already-committed update from the server 1, and displays the data after the already-committed update on the display unit (not shown in FIG. 1) (step S34). Therefore, the user terminal 3 can acquire and display data with guaranteed consistency.

サーバ1は、ユーザ端末3に既コミット更新前データを提供するため(ステップS32)、既コミット更新前データを格納している(ステップS11)。サーバ1は、ユーザ端末3に既コミット更新後データを提供するため(ステップS34)、既コミット更新後データを格納しているが、既コミット更新前データも格納している(ステップS15)。   The server 1 stores pre-commit update data in order to provide the user terminal 3 with pre-commit update data (step S32). The server 1 stores the data after the previous commit update in order to provide the user terminal 3 with the data after the previous commit update (step S34), but also stores the data before the previous commit update (step S15).

既コミット更新後データは、今後とも参照される可能性がある必要なデータであるが、既コミット更新前データは、今後とも参照される可能性がない過剰なデータである。サーバ1は、バキューム処理を実行することにより、既コミット更新前データを削除して、既コミット更新後データを抽出して、データベースの操作性を向上させる。   The data after the already-committed update is necessary data that may be referred to in the future, but the data before the already-committed update is excessive data that cannot be referred to in the future. By executing the vacuum process, the server 1 deletes the data before the commit update, extracts the data after the commit update, and improves the operability of the database.

{サーバの構成要素}
図2は、サーバ1の構成要素を示すブロック図である。サーバ1は、データベース11、テンポラリメモリ12、データベースマネージメントシステム13から構成される。データベース11は、データを永続的に格納する。テンポラリメモリ12は、データを一時的に格納する。データベースマネージメントシステム13は、ユーザ端末2、3から操作指示を入力して、データベース11、テンポラリメモリ12に操作命令を出力する。
{Server components}
FIG. 2 is a block diagram showing components of the server 1. The server 1 includes a database 11, a temporary memory 12, and a database management system 13. The database 11 stores data permanently. The temporary memory 12 temporarily stores data. The database management system 13 inputs an operation instruction from the user terminals 2 and 3 and outputs an operation command to the database 11 and the temporary memory 12.

データベース11は、第1ファイル111、第2ファイル112、第3ファイル113から構成される。一のファイルは、他のファイルに関連しておらず、他のファイルから独立している。一のファイルに対するバキューム処理および更新処理は、他のファイルに対するバキューム処理および更新処理から独立している。   The database 11 includes a first file 111, a second file 112, and a third file 113. One file is not related to other files and is independent of other files. The vacuum process and update process for one file are independent of the vacuum process and update process for another file.

データベースマネージメントシステム13は、アクセス部131、バキューム部132、コピー部133、上書き部134から構成される。   The database management system 13 includes an access unit 131, a vacuum unit 132, a copy unit 133, and an overwrite unit 134.

アクセス部131は、データベース11に格納されているデータに対して、更新処理を実行する。バキューム部132は、テンポラリメモリ12に格納されているデータに対して、バキューム処理を実行する。アクセス部131による更新処理、バキューム部132によるバキューム処理は、相互に衝突することがない。   The access unit 131 executes an update process on the data stored in the database 11. The vacuum unit 132 performs a vacuum process on the data stored in the temporary memory 12. The update process by the access unit 131 and the vacuum process by the vacuum unit 132 do not collide with each other.

コピー部133は、データベース11に格納されているバキューム処理を実行されていないデータを、データベース11からテンポラリメモリ12にコピーする。上書き部134は、テンポラリメモリ12に格納されているバキューム処理を実行されているデータを、テンポラリメモリ12からデータベース11に上書きする。   The copy unit 133 copies data that has not been subjected to vacuum processing stored in the database 11 from the database 11 to the temporary memory 12. The overwriting unit 134 overwrites the data that has been subjected to vacuum processing stored in the temporary memory 12 from the temporary memory 12 to the database 11.

{バキューム処理の流れ}
図3および図4は、バキューム処理の流れを示すフローチャートである。図5から図7までは、バキューム処理を示すタイムチャートである。一のファイルに対するバキューム処理は、他のファイルに対するバキューム処理から独立している。
{Flow of vacuum processing}
3 and 4 are flowcharts showing the flow of the vacuum process. 5 to 7 are time charts showing vacuum processing. The vacuum process for one file is independent of the vacuum process for the other file.

「参照データ」は、バキューム処理の直近にコミットされているデータであり、今後とも参照される可能性がある必要なデータである。「参照データ」は、図1のステップS15における「既コミット更新後データ」に相当する。   “Reference data” is data that has been committed most recently in vacuum processing, and is necessary data that may be referred to in the future. The “reference data” corresponds to “updated data already committed” in step S15 in FIG.

「非参照データ」は、バキューム処理の直近以外にコミットされているデータであり、今後とも参照される可能性がない過剰なデータである。「非参照データ」は、図1のステップS11における「既コミット更新前データ」に相当する。   “Non-reference data” is data that has been committed other than immediately before the vacuum process, and is excessive data that cannot be referred to in the future. “Non-reference data” corresponds to “data before commit update” in step S11 of FIG.

[第1ファイルのバキューム処理]
図5は、第1ファイル111のバキューム処理を示すタイムチャートである。ここで、第1ファイル111がデータベース11からテンポラリメモリ12にコピーされているときに、第1ファイル111がデータベース11において更新されない。そして、第1ファイル111がテンポラリメモリ12においてバキュームされているときに、第1ファイル111がデータベース11において更新されない。
[Vacuum processing of the first file]
FIG. 5 is a time chart showing the vacuum processing of the first file 111. Here, when the first file 111 is copied from the database 11 to the temporary memory 12, the first file 111 is not updated in the database 11. The first file 111 is not updated in the database 11 when the first file 111 is vacuumed in the temporary memory 12.

バキューム部132は、バキューム処理タイミングが到来しているかどうかをチェックする(ステップS41)。図5においては、バキューム処理タイミングが到来している場合を示す(ステップS42においてYES)。バキューム部132は、バキューム処理タイミングが到来していないことを確認したときには(ステップS42においてNO)、バキューム処理を実行しない。   The vacuum unit 132 checks whether or not the vacuum processing timing has come (step S41). FIG. 5 shows a case where the vacuum processing timing has arrived (YES in step S42). When it is confirmed that the vacuum processing timing has not arrived (NO in step S42), the vacuum unit 132 does not execute the vacuum processing.

バキューム部132は、ユーザ端末2、3による設定時刻が到来していることをチェックしてもよい。バキューム部132は、現実のデータサイズが本来のデータサイズの所定数倍以上になっていることをチェックしてもよい。バキューム部132は、ユーザ端末2、3がデータベース11にアクセスしていないことをチェックしてもよい。   The vacuum unit 132 may check that the set time by the user terminals 2 and 3 has arrived. The vacuum unit 132 may check that the actual data size is a predetermined number of times or more than the original data size. The vacuum unit 132 may check that the user terminals 2 and 3 are not accessing the database 11.

コピー部133は、参照データ1111、非参照データ1112を含む第1ファイル111を、データベース11からテンポラリメモリ12にコピーする(ステップS43)。   The copy unit 133 copies the first file 111 including the reference data 1111 and the non-reference data 1112 from the database 11 to the temporary memory 12 (step S43).

バキューム部132は、第1ファイル111がコピー処理中にデータベース11において更新されているかどうかを、コピー処理後にチェックする(ステップS44)。バキューム部132は、第1ファイル111がコピー処理中にデータベース11において更新されていないことを確認する(ステップS45においてNO)。   The vacuum unit 132 checks whether or not the first file 111 has been updated in the database 11 during the copy process after the copy process (step S44). The vacuum unit 132 confirms that the first file 111 has not been updated in the database 11 during the copy process (NO in step S45).

バキューム部132は、参照データ1111、非参照データ1112を含む第1ファイル111に対して、テンポラリメモリ12においてバキューム処理を実行する。バキューム部132は、参照データ1111をテンポラリメモリ12において抽出して、非参照データ1112をテンポラリメモリ12において削除する(ステップS46)。   The vacuum unit 132 performs a vacuum process in the temporary memory 12 for the first file 111 including the reference data 1111 and the non-reference data 1112. The vacuum unit 132 extracts the reference data 1111 in the temporary memory 12 and deletes the non-reference data 1112 in the temporary memory 12 (step S46).

バキューム部132は、第1ファイル111がバキューム処理中にデータベース11において更新されているかどうかを、バキューム処理後にチェックする(ステップS47)。バキューム部132は、第1ファイル111がバキューム処理中にデータベース11において更新されていないことを確認する(ステップS48においてNO)。   The vacuum unit 132 checks after the vacuum processing whether the first file 111 is updated in the database 11 during the vacuum processing (step S47). The vacuum unit 132 confirms that the first file 111 has not been updated in the database 11 during the vacuum process (NO in step S48).

バキューム部132は、データベース11に格納されているログ情報をチェックすることにより、データベースファイルがデータベース11において更新されているかどうかをチェックしてもよい。バキューム部132は、データベース11に格納されているデータベースファイルをモニターすることにより、データベースファイルがデータベース11において更新されているかどうかをチェックしてもよい。   The vacuum unit 132 may check whether or not the database file has been updated in the database 11 by checking log information stored in the database 11. The vacuum unit 132 may check whether the database file is updated in the database 11 by monitoring the database file stored in the database 11.

アクセス部131は、データベース11に格納されている第1ファイル111に対して、排他的ロックをかける(ステップS49)。ユーザ端末2、3は、第1ファイル111にアクセスできない。上書き部134は、参照データ1111を、テンポラリメモリ12からデータベース11に上書きする(ステップS50)。   The access unit 131 places an exclusive lock on the first file 111 stored in the database 11 (step S49). The user terminals 2 and 3 cannot access the first file 111. The overwriting unit 134 overwrites the reference data 1111 from the temporary memory 12 to the database 11 (step S50).

アクセス部131は、データベース11に格納されている参照データ1111に対して、排他的ロックを解除する(ステップS51)。ユーザ端末2、3は、参照データ1111にアクセスできる。バキューム部132は、参照データ1111を、テンポラリメモリ12から削除する(ステップS52)。以上により第1ファイル111のバキューム処理が終了する。   The access unit 131 releases the exclusive lock on the reference data 1111 stored in the database 11 (step S51). User terminals 2 and 3 can access reference data 1111. The vacuum unit 132 deletes the reference data 1111 from the temporary memory 12 (step S52). Thus, the vacuum process for the first file 111 is completed.

[第2ファイルのバキューム処理]
図6は、第2ファイル112のバキューム処理を示すタイムチャートである。ここで、第2ファイル112がデータベース11からテンポラリメモリ12にコピーされているときに、第2ファイル112がデータベース11において更新される。
[Vacuum processing of second file]
FIG. 6 is a time chart showing the vacuum processing of the second file 112. Here, when the second file 112 is copied from the database 11 to the temporary memory 12, the second file 112 is updated in the database 11.

バキューム部132は、バキューム処理タイミングが到来しているかどうかをチェックする(ステップS41)。図6においては、バキューム処理タイミングが到来している場合を示す(ステップS42においてYES)。バキューム部132は、バキューム処理タイミングが到来していないことを確認したときには(ステップS42においてNO)、バキューム処理を実行しない。   The vacuum unit 132 checks whether or not the vacuum processing timing has come (step S41). FIG. 6 shows a case where the vacuum processing timing has arrived (YES in step S42). When it is confirmed that the vacuum processing timing has not arrived (NO in step S42), the vacuum unit 132 does not execute the vacuum processing.

コピー部133は、参照データ1121、非参照データ1122を含む第2ファイル112を、データベース11からテンポラリメモリ12にコピーする(ステップS43)。   The copy unit 133 copies the second file 112 including the reference data 1121 and the non-reference data 1122 from the database 11 to the temporary memory 12 (Step S43).

バキューム部132は、第2ファイル112がコピー処理中にデータベース11において更新されているかどうかを、コピー処理後にチェックする(ステップS44)。バキューム部132は、第2ファイル112がコピー処理中にデータベース11において更新されていることを確認する(ステップS45においてYES)。   The vacuum unit 132 checks after the copy process whether the second file 112 is updated in the database 11 during the copy process (step S44). The vacuum unit 132 confirms that the second file 112 has been updated in the database 11 during the copy process (YES in step S45).

すなわち、ユーザ端末2またはユーザ端末3は、コピー処理中に、サーバ1に更新データの書き込み指示を送信している。そして、サーバ1は、コピー処理中に、コミット処理を実行して、データベース11に更新データ1123を格納している。   That is, the user terminal 2 or the user terminal 3 transmits an update data write instruction to the server 1 during the copy process. Then, the server 1 executes commit processing during the copy processing, and stores the update data 1123 in the database 11.

バキューム部132が参照データ1121を抽出して、上書き部134が参照データ1121を上書きするならば、すでにコミットされた更新データ1123は削除される。そこで、バキューム部132は、バキューム処理を実行しない。バキューム部132は、参照データ1121、非参照データ1122を、テンポラリメモリ12から削除する(ステップS52)。以上により第2ファイル112のバキューム処理が終了する。   If the vacuum unit 132 extracts the reference data 1121 and the overwriting unit 134 overwrites the reference data 1121, the update data 1123 that has already been committed is deleted. Therefore, the vacuum unit 132 does not execute a vacuum process. The vacuum unit 132 deletes the reference data 1121 and the non-reference data 1122 from the temporary memory 12 (step S52). Thus, the vacuum process for the second file 112 is completed.

[第3ファイルのバキューム処理]
図7は、第3ファイル113のバキューム処理を示すタイムチャートである。ここで、第3ファイル113がデータベース11からテンポラリメモリ12にコピーされているときに、第3ファイル113がデータベース11において更新されない。しかし、第3ファイル113がテンポラリメモリ12においてバキュームされているときに、第3ファイル113がデータベース11において更新される。
[Vacuum processing of third file]
FIG. 7 is a time chart showing vacuum processing of the third file 113. Here, when the third file 113 is copied from the database 11 to the temporary memory 12, the third file 113 is not updated in the database 11. However, the third file 113 is updated in the database 11 when the third file 113 is vacuumed in the temporary memory 12.

バキューム部132は、バキューム処理タイミングが到来しているかどうかをチェックする(ステップS41)。図7においては、バキューム処理タイミングが到来している場合を示す(ステップS42においてYES)。バキューム部132は、バキューム処理タイミングが到来していないことを確認したときには(ステップS42においてNO)、バキューム処理を実行しない。   The vacuum unit 132 checks whether or not the vacuum processing timing has come (step S41). FIG. 7 shows a case where the vacuum processing timing has arrived (YES in step S42). When it is confirmed that the vacuum processing timing has not arrived (NO in step S42), the vacuum unit 132 does not execute the vacuum processing.

コピー部133は、参照データ1131、非参照データ1132を含む第3ファイル113を、データベース11からテンポラリメモリ12にコピーする(ステップS43)。   The copy unit 133 copies the third file 113 including the reference data 1131 and the non-reference data 1132 from the database 11 to the temporary memory 12 (Step S43).

バキューム部132は、第3ファイル113がコピー処理中にデータベース11において更新されているかどうかを、コピー処理後にチェックする(ステップS44)。バキューム部132は、第3ファイル113がコピー処理中にデータベース11において更新されていないことを確認する(ステップS45においてNO)。   The vacuum unit 132 checks after the copy process whether the third file 113 is updated in the database 11 during the copy process (step S44). The vacuum unit 132 confirms that the third file 113 has not been updated in the database 11 during the copy process (NO in step S45).

バキューム部132は、参照データ1131、非参照データ1132を含む第3ファイル113に対して、テンポラリメモリ12においてバキューム処理を実行する。バキューム部132は、参照データ1131をテンポラリメモリ12において抽出して、非参照データ1132をテンポラリメモリ12において削除する(ステップS46)。   The vacuum unit 132 performs a vacuum process in the temporary memory 12 for the third file 113 including the reference data 1131 and the non-reference data 1132. The vacuum unit 132 extracts the reference data 1131 in the temporary memory 12 and deletes the non-reference data 1132 in the temporary memory 12 (step S46).

バキューム部132は、第3ファイル113がバキューム処理中にデータベース11において更新されているかどうかを、バキューム処理後にチェックする(ステップS47)。バキューム部132は、第3ファイル113がバキューム処理中にデータベース11において更新されていることを確認する(ステップS48においてYES)。   The vacuum unit 132 checks after the vacuum processing whether the third file 113 is updated in the database 11 during the vacuum processing (step S47). The vacuum unit 132 confirms that the third file 113 is updated in the database 11 during the vacuum process (YES in step S48).

すなわち、ユーザ端末2またはユーザ端末3は、バキューム処理中に、サーバ1に更新データの書き込み指示を送信している。そして、サーバ1は、バキューム処理中に、コミット処理を実行して、データベース11に更新データ1133を格納している。   That is, the user terminal 2 or the user terminal 3 transmits an update data write instruction to the server 1 during the vacuum process. The server 1 executes the commit process during the vacuum process and stores the update data 1133 in the database 11.

バキューム部132が参照データ1131を抽出して、上書き部134が参照データ1131を上書きするならば、すでにコミットされた更新データ1133は削除される。そこで、上書き部134は、上書き処理を実行しない。バキューム部132は、参照データ1131を、テンポラリメモリ12から削除する(ステップS52)。以上により第3ファイル113のバキューム処理が終了する。   If the vacuum unit 132 extracts the reference data 1131 and the overwrite unit 134 overwrites the reference data 1131, the update data 1133 that has already been committed is deleted. Therefore, the overwriting unit 134 does not execute the overwriting process. The vacuum unit 132 deletes the reference data 1131 from the temporary memory 12 (step S52). Thus, the vacuum process for the third file 113 is completed.

{本発明のまとめ}
バキューム部132は、テンポラリメモリ12に対して、バキューム処理を実行する。ユーザ端末2、3は、データベース11に対して、更新処理を実行する。サーバ1は、バキューム処理に長時間を必要とするときでも、バキューム処理により更新処理に悪影響を及ぼすことがなく、更新処理によりバキューム処理に悪影響を及ぼすことがない。
{Summary of the invention}
The vacuum unit 132 performs a vacuum process on the temporary memory 12. The user terminals 2 and 3 execute update processing on the database 11. Even when the vacuum process requires a long time, the server 1 does not adversely affect the update process by the vacuum process, and does not adversely affect the vacuum process by the update process.

バキューム部132は、コピー処理中に更新処理が実行されたときには、バキューム処理を実行しない。上書き部134は、バキューム処理中に更新処理が実行されたときには、上書き処理を実行しない。サーバ1は、バキューム処理または上書き処理を誤って実行することにより、更新処理を誤って無効化することがない。   The vacuum unit 132 does not execute the vacuum process when the update process is executed during the copy process. The overwrite unit 134 does not execute the overwrite process when the update process is executed during the vacuum process. The server 1 does not erroneously invalidate the update process by erroneously executing the vacuum process or the overwrite process.

バキューム部132は、コピー処理中またはバキューム処理中に更新処理が実行されているかどうかを、それぞれコピー処理後またはバキューム処理後にチェックしてもよい。バキューム部132は、コピー処理中またはバキューム処理中に更新処理が実行されているかどうかを、それぞれコピー処理中またはバキューム処理中にチェックしてもよい。   The vacuum unit 132 may check whether the update process is being executed during the copy process or the vacuum process after the copy process or the vacuum process, respectively. The vacuum unit 132 may check whether the update process is being executed during the copy process or the vacuum process, during the copy process or the vacuum process, respectively.

前者のチェック方法では、バキューム部132は、コピー処理中またはバキューム処理中に更新処理の有無をチェックする負担をなくすことができる。後者のチェック方法では、バキューム部132は、コピー処理中またはバキューム処理中に更新処理の有無をチェックする負担をなくすことができないが、コピー処理中またはバキューム処理中に更新処理の無効化を防止する措置をより早期段階で採ることができる。   In the former check method, the vacuum unit 132 can eliminate the burden of checking whether there is an update process during the copy process or the vacuum process. In the latter check method, the vacuum unit 132 cannot eliminate the burden of checking for the presence of update processing during copy processing or vacuum processing, but prevents invalidation of update processing during copy processing or vacuum processing. Measures can be taken at an earlier stage.

本発明は、様々なデータ格納装置に適用できる。たとえば、本発明は、デジタル複合機に適用できる。デジタル複合機は、文書データを受信したときに、文書データの格納先などのデータをデータベースに格納する。デジタル複合機は、文書データを印刷したときに、文書データの格納先などのデータをデータベースから削除する。ここで、デジタル複合機は、同時実行制御を利用することにより、参照に不必要なデータを格納することになる。しかし、デジタル複合機は、SQLiteなどのデータベース言語を開発言語に組み込んで本発明を適用することにより、参照に不必要なデータを削除することができる。   The present invention can be applied to various data storage devices. For example, the present invention can be applied to a digital multi-function peripheral. When receiving the document data, the digital multi-function peripheral stores data such as a storage destination of the document data in the database. When the digital multi-function peripheral prints document data, the digital multi-function peripheral deletes data such as a storage destination of the document data from the database. Here, the digital multi-function peripheral stores data unnecessary for reference by using the simultaneous execution control. However, the digital multi-function peripheral can delete data unnecessary for reference by incorporating the database language such as SQL Lite into the development language and applying the present invention.

バキューム処理の概要を示すタイムチャートである。It is a time chart which shows the outline | summary of a vacuum process. サーバの構成要素を示すブロック図である。It is a block diagram which shows the component of a server. バキューム処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a vacuum process. バキューム処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a vacuum process. 第1ファイルのバキューム処理を示すタイムチャートである。It is a time chart which shows the vacuum process of a 1st file. 第2ファイルのバキューム処理を示すタイムチャートである。It is a time chart which shows the vacuum process of a 2nd file. 第3ファイルのバキューム処理を示すタイムチャートである。It is a time chart which shows the vacuum process of a 3rd file.

符号の説明Explanation of symbols

1 サーバ
2、3 ユーザ端末
11 データベース
12 テンポラリメモリ
13 データベースマネージメントシステム
111 第1ファイル
112 第2ファイル
113 第3ファイル
131 アクセス部
132 バキューム部
133 コピー部
134 上書き部
DESCRIPTION OF SYMBOLS 1 Server 2, 3 User terminal 11 Database 12 Temporary memory 13 Database management system 111 1st file 112 2nd file 113 3rd file 131 Access part 132 Vacuum part 133 Copy part 134 Overwrite part

Claims (4)

データベースと、
テンポラリメモリと、
一のコミット前にコミットされたコミット前データと、前記一のコミット後にコミットされたコミット後データを、前記データベースから前記テンポラリメモリにコピーするコピー部と、
前記テンポラリメモリでコピーされた前記コミット前データと前記コミット後データから、前記コミット前データを削除して前記コミット後データを抽出するバキューム部と、
前記テンポラリメモリで抽出された前記コミット後データを、前記テンポラリメモリから前記データベースに上書きする上書き部と、
を備えることを特徴とするデータベースシステム。
A database,
Temporary memory,
A copy unit that copies pre-commit data committed before one commit and post-commit data committed after the one commit from the database to the temporary memory;
A vacuum unit for deleting the pre-commit data and extracting the post-commit data from the pre-commit data and the post-commit data copied in the temporary memory;
An overwriting unit for overwriting the post-commit data extracted in the temporary memory from the temporary memory to the database;
A database system comprising:
請求項1に記載のデータベースシステムにおいて、
前記バキューム部は、
前記コピー部により前記コミット前データと前記コミット後データがコピーされているなかで、前記データベースに格納されている前記コミット後データが更新されたときには、前記コミット後データの抽出を中止するバキューム中止部、
を含むことを特徴とするデータベースシステム。
The database system according to claim 1,
The vacuum part is
While the pre-commit data and the post-commit data are copied by the copy unit, the vacuum stop unit stops the extraction of the post-commit data when the post-commit data stored in the database is updated ,
A database system comprising:
請求項1または請求項2に記載のデータベースシステムにおいて、
前記上書き部は、
前記バキューム部により前記コミット後データが抽出されているなかで、前記データベースに格納されている前記コミット後データが更新されたときには、前記コミット後データの上書きを中止する上書き中止部、
を含むことを特徴とするデータベースシステム。
In the database system according to claim 1 or 2,
The overwriting unit is
While the post-commit data is extracted by the vacuum unit, when the post-commit data stored in the database is updated, an overwrite cancel unit that cancels overwriting of the post-commit data,
A database system comprising:
請求項1ないし請求項3のいずれかに記載のデータベースシステムにおいて、さらに、
前記上書き部により前記コミット後データが上書きされているときには、前記データベースに排他的ロックをかける排他的ロック部、
を備えることを特徴とするデータベースシステム。
The database system according to any one of claims 1 to 3, further comprising:
When the post-commit data is overwritten by the overwriting unit, an exclusive lock unit that puts an exclusive lock on the database,
A database system comprising:
JP2008174134A 2008-07-03 2008-07-03 Database system Withdrawn JP2010015344A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008174134A JP2010015344A (en) 2008-07-03 2008-07-03 Database system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008174134A JP2010015344A (en) 2008-07-03 2008-07-03 Database system

Publications (1)

Publication Number Publication Date
JP2010015344A true JP2010015344A (en) 2010-01-21

Family

ID=41701414

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008174134A Withdrawn JP2010015344A (en) 2008-07-03 2008-07-03 Database system

Country Status (1)

Country Link
JP (1) JP2010015344A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018049394A (en) * 2016-09-20 2018-03-29 株式会社東芝 Database management device, database management method, and database management program
CN108287835A (en) * 2017-01-09 2018-07-17 腾讯科技(深圳)有限公司 A kind of data clearing method and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018049394A (en) * 2016-09-20 2018-03-29 株式会社東芝 Database management device, database management method, and database management program
CN108287835A (en) * 2017-01-09 2018-07-17 腾讯科技(深圳)有限公司 A kind of data clearing method and device
US11023448B2 (en) * 2017-01-09 2021-06-01 Tencent Technology (Shenzhen) Company Limited Data scrubbing method and apparatus, and computer readable storage medium

Similar Documents

Publication Publication Date Title
US10664362B2 (en) Recovery processing for database in persistent system
US7801855B2 (en) Method and apparatus for merging log entries in a database management system
US8874515B2 (en) Low level object version tracking using non-volatile memory write generations
US20140172791A1 (en) Application of a differential dataset to a data store using sequential change sets
JP2008539515A (en) Transaction transform
US8380660B2 (en) Database system, database update method, database, and database update program
KR20120104302A (en) Consistency without ordering dependency
JP2010015344A (en) Database system
US9223806B2 (en) Restarting a batch process from an execution point
JP5543918B2 (en) Conflict resolution method for parallel database editing
JP2010061200A (en) Document management system and operation history display method
JP4335299B2 (en) Recording control apparatus and recording control method
US20130066835A1 (en) Techniques for efficient file operations
US11822539B1 (en) System and method for facilitating optimization of file upload operations via transaction transformation
CN111143277B (en) Data processing method and device and electronic equipment
US8521776B2 (en) Accessing data in a multi-generation database
US9355189B2 (en) Determining dependencies during macro expansion
JP2009193284A (en) Database processing apparatus
CN101739411A (en) Method for managing mapping file version
WO2004031957A1 (en) Database copying method, database copying apparatus, database creation method, and database creation apparatus
JPH11203186A (en) Journal acquisition method
JP2009289129A (en) Method, device, system and program for supporting software development
JP2006268389A (en) Long transaction management device, long transaction management method and long transaction management program recording medium

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20110906