JP4623318B2 - Write-once database management system, unnecessary area repair processing method, and unnecessary area repair program - Google Patents

Write-once database management system, unnecessary area repair processing method, and unnecessary area repair program Download PDF

Info

Publication number
JP4623318B2
JP4623318B2 JP2007013849A JP2007013849A JP4623318B2 JP 4623318 B2 JP4623318 B2 JP 4623318B2 JP 2007013849 A JP2007013849 A JP 2007013849A JP 2007013849 A JP2007013849 A JP 2007013849A JP 4623318 B2 JP4623318 B2 JP 4623318B2
Authority
JP
Japan
Prior art keywords
unnecessary area
data
tuple
page
unnecessary
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2007013849A
Other languages
Japanese (ja)
Other versions
JP2008181297A (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 JP2007013849A priority Critical patent/JP4623318B2/en
Publication of JP2008181297A publication Critical patent/JP2008181297A/en
Application granted granted Critical
Publication of JP4623318B2 publication Critical patent/JP4623318B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、追記型データベース管理システム、不要領域修復処理方法及び不要領域修復プログラムに関し、特に、データベースの更新に伴うテーブルの不要領域の修復を効率よく行う追記型データベース管理システム、不要領域修復処理方法及び不要領域修復プログラムに関する。   The present invention relates to a write-once database management system, an unnecessary area repair processing method, and an unnecessary area repair program, and more particularly to a write-once database management system and an unnecessary area repair processing method for efficiently repairing an unnecessary area of a table accompanying database update. And an unnecessary area repair program.

従来、データベースを管理するデータベース管理システムでは、トランザクションの同時実効性制御を考慮する必要があった。   Conventionally, in a database management system for managing a database, it has been necessary to consider the concurrency control of transactions.

このトランザクションとは、データベースにおいてデータを処理する為の一連の処理手続きのことを言う。   This transaction refers to a series of processing procedures for processing data in a database.

具体的には、コンピュータを用いてデータを処理する際、ハードウェアやソフトウェアの障害などが発生しても、全体に破綻をきたさないように、データの処理を確実に行うための論理ユニットのことを指す。   Specifically, when processing data using a computer, this is a logical unit that ensures data processing so that the entire system will not fail even if a hardware or software failure occurs. Point to.

ここで、従来の追記型のストレージを持つデータベース管理システムでは、データベースの更新を行う際、更新前のデータと、更新後のデータとの両方を保持する多版式同時実行制御(Multi Version Concurrency Control)を用いている。   Here, in a conventional database management system with write-once storage, when updating a database, multi-version concurrent control (Multi Version Concurrency Control) that retains both the data before update and the data after update Is used.

この追記型ストレージを用いた多版式同時実効制御では、問い合わせロックの獲得と、書き込みロックとの獲得が競合しないため、ロールバックやリカバリの実装が非常に単純になる。   In the multi-version simultaneous effective control using this write-once storage, the acquisition of the inquiry lock and the acquisition of the write lock do not compete with each other, so that the rollback and recovery implementation becomes very simple.

しかしながら、この多版式同時実行制御は、削除や更新が発生するごとに古いデータが丸ごと不必要となり、古いデータが残存することにより、データを記憶する記憶領域を大きく消費していくという問題がある。   However, this multi-version simultaneous execution control has a problem that the entire old data becomes unnecessary every time deletion or update occurs, and the old data remains, so that the storage area for storing the data is consumed greatly. .

なお、追記型でない既存のデータベース管理システムであっても、削除や更新時にはデータを書き換えることにより不要領域が発生するので、追記型でない既存のデータベース管理システムの場合であっても追記型のデータベースより不要領域が大きくないものの、同様に不要領域が発生してしまう。   Even in the case of existing database management systems that are not write-once type, unnecessary areas are generated by rewriting data at the time of deletion or update. Although the unnecessary area is not large, an unnecessary area similarly occurs.

このような場合には、データベースのレコードを分割して格納することにより、不要領域の再利用を行うなどの機能が備わっているが、複数のブロックに1つのレコードを挿入する状態が発生し、挿入・更新に時間がかかってしまう場合がある。   In such a case, there is a function of reusing unnecessary areas by dividing and storing records in the database, but a state occurs in which one record is inserted into a plurality of blocks, Insertion / update may take time.

なぜなら、データベースは、レコードの集合体であり、レコードは、1つのカードのようなものである。そのレコードには、フィールドと呼ばれる互いに関連する情報の断片を含んでいるため、1つのレコードに含まれる情報を、複数のブロックに分割することになるからである。   Because a database is a collection of records, a record is like a card. This is because the record includes pieces of information related to each other called fields, so that the information included in one record is divided into a plurality of blocks.

そこで、追記型のデータベース管理システムでは、定期的にデータベースの記録単位であるページごとに自動的に不要領域を詰め、利用可能な領域のページアドレスと利用可能領域サイズを記憶することによって、データを再利用するための処理が行われている。   Therefore, the write-once database management system automatically fills unnecessary areas periodically for each page that is a recording unit of the database, and stores the page address of the usable area and the usable area size to store the data. Processing for reuse is performed.

また更に、不要領域が詰められたページにおいて、テーブルに対するデータ(以下、これをテーブルデータと言うことがある。)の更新件数の割合などによって、不要領域の修復処理(以下、これを不要領域修復処理という。)を自動的に行う方法なども行われている(非特許文献1参照)。   Furthermore, in a page where unnecessary areas are packed, unnecessary area repair processing (hereinafter referred to as unnecessary area repair) is performed depending on the ratio of the number of updates of data to the table (hereinafter, this may be referred to as table data). A method of automatically performing processing is also performed (see Non-Patent Document 1).

なお、ここで言うテーブルとは、データを記憶する為のオブジェクトであって、同じフィールドを共有しているレコードの集まりのことを言う。また、テーブルは、レコード(行)とフィールド(列)のオブジェクトによって管理されている。   The table referred to here is an object for storing data and means a collection of records sharing the same field. The table is managed by record (row) and field (column) objects.

しかしながら、このような従来技術では、不要領域の修復処理がテーブルにおける不要領域が発生した全てのページに対してスキャンが行われることにより、ディスクなどの処理負荷が高くなり、この不要領域修復処理は、ストレージ等を持つデータベースの記憶装置に、高い処理負荷を与えることとなり、他の処理に悪影響を与えるという問題があった。   However, in such a conventional technique, the unnecessary area repair process scans all pages in which unnecessary areas have occurred in the table, thereby increasing the processing load on the disk and the like. Therefore, there is a problem that a high processing load is given to a storage device of a database having a storage or the like, which adversely affects other processes.

また、この不要領域修復処理は、テーブルの更新行数(すなわち、レコード数)が、テーブル全体に対して一定の割合を超えた場合に不要領域の修復処理を行っていたので、不要領域の大きさとは何ら無関係に不要領域修復処理を行っていた。   In addition, since the unnecessary area repair processing is performed when the number of updated rows (that is, the number of records) in the table exceeds a certain ratio with respect to the entire table, the unnecessary area is repaired. Unnecessary area repair processing was performed regardless of the situation.

従って、不要領域修復処理を行う際に、領域修復率が低い場合であっても不要領域修復処理を行っているという問題があった。   Therefore, when performing the unnecessary area repair process, there is a problem that the unnecessary area repair process is performed even when the area repair rate is low.

具体的には例えば、可変長のデータ定義がされた場合には、それぞれのテーブルデータのサイズが違うため、更新行数が不要領域サイズには必ずしも比例しない。そのため、全体としては不要領域が少なくても更新行数が多い場合には、不要領域修復処理が行われてしまう可能性があった。   Specifically, for example, when variable-length data is defined, the size of each table data is different, so the number of updated rows is not necessarily proportional to the unnecessary area size. For this reason, there is a possibility that unnecessary area repair processing may be performed when the number of updated rows is large even if the number of unnecessary areas is small as a whole.

また、ページの不要領域に偏りが生じている場合にも、領域の修復率が低いページに対してデータを詰める処理が発生し、非常に非効率になってしまうという問題があった。   In addition, even when an unnecessary area of the page is biased, there is a problem that processing for packing data occurs for a page with a low area repair rate, which is very inefficient.

そこで、このようなデータベース管理システムにおける不要領域のデータの取り扱いに関するものが、特許文献1乃至3に記載されている。
石井達夫著「PostgreSQL完全攻略ガイド 改定第5版」 技術評論社出版、2006年4月1日、pp.437−446 特開2000−137639号公報 特開2001−075832号公報 特開2004−303368号公報
Accordingly, Patent Documents 1 to 3 describe handling of unnecessary area data in such a database management system.
Tatsuo Ishii, “PostgreSQL Complete Strategy Guide Revised 5th Edition”, Technical Review Publishing Co., Ltd. April 1, 2006, pp. 437-446 JP 2000-137639 A JP 2001-075832 A JP 2004-303368 A

しかしながら、特許文献1及び3に記載されたものを、従来の追記型データベース管理システムに適用したとしても、不要領域が大量にデータベースに蓄積した状態であって空き容量を確保し直す場合には、不要領域修復処理が複雑となり、ストレージであるディスクに相当な負担がかかることによって処理能力が低下し、他の処理に悪影響を与えるという問題が依然としてあった。   However, even if the ones described in Patent Documents 1 and 3 are applied to a conventional write-once database management system, when a large amount of unnecessary area is accumulated in the database and free space is secured again, There is still a problem that the unnecessary area repair processing becomes complicated and the processing capacity is lowered due to a considerable burden on the storage disk, which adversely affects other processing.

本発明は、上記問題点に鑑みてなされたものであり、データの更新に伴う不要領域修復処理を効率良く行う追記型データベース管理システム、不要領域修復処理方法及び不要領域修復プログラムを提供することを目的とする。   The present invention has been made in view of the above problems, and provides a write-once database management system, an unnecessary area repair processing method, and an unnecessary area repair program that efficiently perform unnecessary area repair processing accompanying data update. Objective.

本発明に係る追記型データベース管理システムは、データを記憶するデータベースを管理する追記型データベース管理システムにおいて、前記データを更新又は削除することにより前記データベース内に生じる不要領域を、当該データベースの記録単位であるページ毎に更新しながら管理する管理手段と、前記管理手段が前記ページ毎に管理する前記不要領域から当該不要領域のサイズを算出すると共に、当該不要領域のサイズと、前記データベース内における当該不要領域の位置とを、前記ページ毎に記憶する不要領域記憶手段と、前記ページに前記不要領域が発生した場合に、前記不要領域記憶手段に記憶された前記不要領域のサイズと、当該ページにおける前記不要領域の比率に基づいて、当該不要領域に属するデータを解放するか否かを判断する不要領域比率判断手段と、を備え、前記不要領域比率判断手段は、前記不要領域のサイズと、前記ページにおける前記不要領域の比率とに基づいて、予め設定された閾値を超えた場合には、当該ページの前記不要領域に属するデータを前記不要領域の位置から解放する不要領域解放処理手段を更に備えることを特徴とする。   The write-once database management system according to the present invention is a write-once database management system for managing a database that stores data. In the write-once database management system, unnecessary areas generated in the database by updating or deleting the data are recorded in units of recording of the database. Management means that manages while updating every page, and calculates the size of the unnecessary area from the unnecessary area managed by the management means for each page, and the size of the unnecessary area and the unnecessary in the database An unnecessary area storage unit that stores the position of each area for each page; and when the unnecessary area occurs in the page, the size of the unnecessary area stored in the unnecessary area storage unit, and the size of the page in the page Whether to release data belonging to the unnecessary area based on the ratio of the unnecessary area An unnecessary area ratio determining means for determining the unnecessary area ratio determining means when the unnecessary area ratio determining means exceeds a preset threshold based on the size of the unnecessary area and the ratio of the unnecessary area on the page Is further provided with unnecessary area release processing means for releasing data belonging to the unnecessary area of the page from the position of the unnecessary area.

また本発明に係る追記型データベース管理システムは、前記不要領域解放処理手段が、前記ページの前記不要領域に属するデータの実行ログであるトランザクション識別子と、システムの実行ログとして一番古く関わった最古トランザクションとを比較して、当該不要領域に属するデータが削除可能なタプルデータか否かを判断するタプルデータ有効性判断手段と、前記タプルデータ有効性判断手段により、前記トランザクション識別子が前記最古トランザクション識別子より古い場合には、前記不要領域に属するデータは、前記削除可能なタプルデータと判断されると共に、当該削除可能なタプルデータに対し削除予約を行うタプルデータ削除予約手段と、前記タプルデータ削除予約手段により、前記削除可能なタプルデータがある場合には、当該削除可能なタプルデータに割り当てられたインデックスデータの有無を判断するインデックスデータ判断手段と、前記インデックス判断手段により、前記削除可能なタプルデータに割り当てられた前記インデックスデータが有った場合には、当該インデックスデータを削除するインデックスデータ削除手段と、を備え、前記インデックス判断手段は、前記インデックスデータ削除手段によって前記インデックスデータが無くなった場合又は前記インデックスデータが前記削除可能なタプルデータに無かった場合には、当該削除可能なタプルデータを解放して空き領域を確保するようにしても良い。   Further, in the write-once database management system according to the present invention, the unnecessary area release processing unit is the oldest involved as the transaction identifier that is an execution log of data belonging to the unnecessary area of the page and the oldest execution log of the system. A tuple data validity judging means for comparing the transaction and determining whether or not the data belonging to the unnecessary area is deleteable tuple data; and the tuple data validity judging means determines that the transaction identifier is the oldest transaction. If it is older than the identifier, the data belonging to the unnecessary area is determined to be the deleteable tuple data, and the tuple data deletion reservation means for performing deletion reservation for the deleteable tuple data, and the tuple data deletion When there is tuple data that can be deleted by the reservation means When there is the index data assigned to the removable tuple data by the index data judging means for judging the presence or absence of the index data assigned to the removable tuple data, and the index judging means Index data deleting means for deleting the index data, wherein the index determining means is when the index data is deleted by the index data deleting means or when the index data is not in the deleteable tuple data Alternatively, the deleteable tuple data may be released to secure a free area.

また本発明に係る追記型データベース管理システムは、前記管理手段が前記ページを更新することにより、前記データベースに記憶された前記データを更新する場合であって、更新により前記データベースに新たに追記するタプルデータのレコードを、追記タプルデータ長として算出するタプル長算出手段、を更に備え、前記タプル長算出手段によって前記追記タプルデータ長が算出されることにより、確保された前記空き領域に、当該追記タプルデータ長の前記タプルデータのレコードを挿入可能な場合には、当該空き領域に挿入すると共に、挿入された当該タプルデータの前記ページを更新し、算出された前記タプルデータ長の前記タプルデータが前記空き領域に挿入できない場合であって、前記データベースの最終ページに当該タプルデータ長の前記タプルデータを挿入できる場合には、当該最終ページに挿入し、算出された前記タプルデータ長の前記タプルデータが前記空き領域に挿入できない場合であって、前記データベースの前記最終ページに前記タプルデータ長の前記タプルデータを挿入できない場合には、前記データベースに新規ページを確保して、当該タプルデータ長の前記タプルデータを追記するようにしても良い。   Further, the write-once database management system according to the present invention is a tuple in which the management means updates the data stored in the database by updating the page, and newly appends to the database by the update. Tuple length calculating means for calculating a record of data as an additional tuple data length, and the additional tuple is secured in the free space secured by calculating the additional tuple data length by the tuple length calculating means. When the tuple data record having the data length can be inserted, the tuple data having the calculated tuple data length is inserted into the empty area, and the page of the inserted tuple data is updated. If it is not possible to insert into the free space, the tuple is added to the last page of the database. The tuple data of the data length can be inserted into the last page, and the tuple data of the calculated tuple data length cannot be inserted into the empty area, and the last page of the database If the tuple data having the tuple data length cannot be inserted, a new page may be secured in the database and the tuple data having the tuple data length may be additionally written.

また本発明に係る追記型データベース管理システムは、前記管理手段が、前記データベース内に生じる前記不要領域を、前記データのテーブル毎に合計しながら管理するテーブル合計管理手段と、前記テーブル合計管理手段が、当該テーブル毎の前記不要領域のサイズを更新しながら記憶するテーブル不要領域記憶手段と、を更に備え、前記テーブル合計管理手段は、前記テーブル毎の前記不要領域のサイズと、前記テーブルにおける前記不要領域の比率とに基づいて、前記不要領域解放処理手段を開始する開始閾値、又は前記不要領域解放処理手段を終了する終了閾値の少なくとも一方を備えると共に、前記開始閾値又は前記終了閾値によって前記不要領域解放処理手段を制御するようにしても良い。   In the write-once database management system according to the present invention, the management unit manages the unnecessary area generated in the database while totaling each data table, and the table total management unit includes: Table unnecessary area storage means for storing the unnecessary area for each table while updating the size, and the table total management means includes the size of the unnecessary area for each table and the unnecessary area in the table. And a start threshold value for starting the unnecessary area release processing means, or an end threshold value for ending the unnecessary area release processing means, based on the ratio of the areas, and the unnecessary area depending on the start threshold value or the end threshold value. The release processing means may be controlled.

また本発明に係る追記型データベース管理システムは、前記不要領域比率判断手段が、前記ページに前記不要領域が発生した場合であって、前記予め設定された閾値を超えた場合には、前記不要領域解放処理手段を実施するための予約を行う不要領域解放処理予約手段を更に備え、前記不要領域解放処理予約手段は、前記データベースの処理負荷に基づいて、前記不要領域解放処理手段を制御するようにしても良い。   In the write-once database management system according to the present invention, the unnecessary area ratio determining unit may generate the unnecessary area when the unnecessary area is generated on the page and exceeds the preset threshold. The system further comprises unnecessary area release processing reservation means for performing reservation for implementing the release processing means, and the unnecessary area release processing reservation means controls the unnecessary area release processing means based on the processing load of the database. May be.

本発明によれば、データベース内に発生する不要領域をデータベースの記録単位であるページ毎に管理すると共に、発生した不要領域のサイズと、ページにおける不要領域の比率とに基づいて、予め設定された閾値を超えた場合には、閾値を超えたそのページに対して不要領域解放処理を行うことができる。従って、不要領域のサイズが、閾値を超えたページに限定して不要領域修復処理を行うことができるので、かくして、データの更新に伴う不要領域修復処理を効率良く行う追記型データベース管理システム、不要領域修復処理方法及び不要領域修復プログラムを実現できる。   According to the present invention, the unnecessary area generated in the database is managed for each page which is a recording unit of the database, and is set in advance based on the size of the generated unnecessary area and the ratio of the unnecessary area in the page. When the threshold is exceeded, an unnecessary area release process can be performed on the page that exceeds the threshold. Therefore, the unnecessary area can be repaired by limiting the size of the unnecessary area to a page that exceeds the threshold value. Thus, the write-once database management system that efficiently performs the unnecessary area repair processing accompanying the data update is unnecessary. An area repair processing method and an unnecessary area repair program can be realized.

次に、本発明の実施の形態の構成について図面を参照して詳細に説明する。
(第1の実施の形態)
(1)第1の実施の形態による追記型データベース管理システム
(1−1)追記型データベース管理システムの構成
図1を参照すると、第1の実施の形態による追記型データベース管理システムは、データベースクライアント1と、データベースクライアント1が接続されるデータベース管理システム2と、データベースを記憶する記憶装置3とを備えている。
Next, the configuration of the embodiment of the present invention will be described in detail with reference to the drawings.
(First embodiment)
(1) Write-once database management system according to first embodiment (1-1) Configuration of write-once database management system Referring to FIG. 1, a write-once database management system according to the first embodiment includes a database client 1 And a database management system 2 to which the database client 1 is connected, and a storage device 3 for storing the database.

データベース管理システム2は、クエリ管理部21と、トランザクション管理部22と、ストレージ管理部23とを備えている。   The database management system 2 includes a query management unit 21, a transaction management unit 22, and a storage management unit 23.

クエリ管理部21は、クエリ解析部211と、実行計画作成部212とを備えている。   The query management unit 21 includes a query analysis unit 211 and an execution plan creation unit 212.

クエリ解析部211は、データベースクライアントから渡されたクエリを解析し、その結果を実行計画作成部212に渡す。   The query analysis unit 211 analyzes the query passed from the database client and passes the result to the execution plan creation unit 212.

実行計画作成部212は、トランザクション管理部22やストレージ管理部23での実行計画を作成する。   The execution plan creation unit 212 creates an execution plan in the transaction management unit 22 and the storage management unit 23.

トランザクション管理部22は、トランザクション制御管理部221を備えている。   The transaction management unit 22 includes a transaction control management unit 221.

トランザクション制御管理部221は、後述するトランザクションの有効状態をストレージ管理部23のタプル管理部233が有するタプルデータ、及びトランザクション情報記憶部33のコミット状態情報から、タプルが有効な状態か無効な状態かの判定を行う。   The transaction control management unit 221 determines whether the tuple is valid or invalid from the tuple data included in the tuple management unit 233 of the storage management unit 23 and the commit status information of the transaction information storage unit 33. Judgment is made.

ここでタプルとは、いくつかの値を1つにまとめて、あたかも1つの値のように扱う機能のことであり、表における行に相当する。また、タプルデータとは、タプルの機能によって割り当てられるデータのことを言う。   Here, a tuple is a function that combines several values into one and treats them as if they were one value, and corresponds to a row in the table. The tuple data refers to data assigned by the tuple function.

ストレージ管理部23は、インデックス管理部231と、ページ管理部232(本発明における管理手段に該当する。)と、タプル管理部233(本発明における管理手段に該当する。)と、空き容量管理部234(本発明における不要領域比率判断手段に該当する。)と、統計情報管理部235とを備えている。   The storage management unit 23 includes an index management unit 231, a page management unit 232 (corresponding to management means in the present invention), a tuple management unit 233 (corresponding to management means in the present invention), and a free capacity management unit. 234 (corresponding to the unnecessary area ratio determining means in the present invention) and a statistical information management unit 235.

インデックス管理部231は、後述するタプルイメージをタプル管理部233より受け取り、インデックスデータの作成・削除などを行う。また、インデックス管理部231は、作成したインデックスデータを、後述するインデックスデータ記憶部31へ入出力を行い管理する。   The index management unit 231 receives a tuple image, which will be described later, from the tuple management unit 233, and creates and deletes index data. Further, the index management unit 231 manages the created index data by inputting / outputting the index data to / from an index data storage unit 31 described later.

ページ管理部232は、タプル管理部233から後述するタプルイメージを受け取ると共にページの作成を行い、そのページのデータ(以下、これをページデータと言う。)をテーブルデータとして、後述するテーブルデータ記憶部32へ入出力する。また、ページ管理部232は、不要領域修復処理なども行う。   The page management unit 232 receives a tuple image, which will be described later, from the tuple management unit 233 and creates a page. The page data (hereinafter referred to as page data) is used as table data, and a table data storage unit, which will be described later. I / O to 32. The page management unit 232 also performs unnecessary area repair processing and the like.

タプル管理部233は、クエリ管理部21やトランザクション管理部22から受け取った情報により、タプルイメージの生成やページ管理部232から受け取ったページデータからタプルデータの取得を行う。また、タプルの生成や抽出した情報から、後述するトランザクション情報のトランザクション情報記憶部33へ入出力を行う。   The tuple management unit 233 generates tuple images and acquires tuple data from the page data received from the page management unit 232 based on information received from the query management unit 21 and the transaction management unit 22. Further, input / output is performed to / from the transaction information storage unit 33 of transaction information described later from the tuple generation and extracted information.

ここで、タプルイメージとは、タプルデータとタプル機能とによって生成される、ページデータに相当するテーブルデータに対応するものである。   Here, the tuple image corresponds to table data corresponding to page data generated by the tuple data and the tuple function.

空き容量管理部234は、更新や削除によって生じた不要領域を含むページ情報と、不要領域のサイズ情報とを、後述するページ不要領域情報記憶部35へ入出力を行う。   The free space management unit 234 inputs / outputs page information including an unnecessary area generated by update or deletion and size information of the unnecessary area to a page unnecessary area information storage unit 35 described later.

統計情報管理部235は、テーブルの定義や、テーブルデータサイズ、ページサイズ、ページ不要領域修復処理開始閾値、空き容量を持っているページアドレスとサイズ、最古トランザクション識別子などといったデータベースの全体情報を管理する。また、それらのデータベース統計情報記憶部34への入出力を行う。   The statistical information management unit 235 manages the entire database information such as table definition, table data size, page size, page unnecessary area repair processing start threshold, page address and size with free capacity, oldest transaction identifier, etc. To do. Further, input / output to / from the database statistical information storage unit 34 is performed.

記憶装置3は、インデックスデータ記憶部31と、テーブルデータ記憶部32と、トランザクション情報記憶部33と、データベース統計情報記憶部34と、ページ不要領域情報記憶部35(本発明における不要領域記憶手段に該当する。)とを備えている。   The storage device 3 includes an index data storage unit 31, a table data storage unit 32, a transaction information storage unit 33, a database statistical information storage unit 34, and a page unnecessary area information storage unit 35 (in the unnecessary area storage means in the present invention). Applicable).

インデックスデータ記憶部31は、テーブルにインデックスが作成されている場合のインデックスデータを記憶する。   The index data storage unit 31 stores index data when an index is created in the table.

テーブルデータ記憶部32は、データベースのテーブルデータを、ページと呼ばれる単位で記憶する。   The table data storage unit 32 stores database table data in units called pages.

トランザクション情報記憶部33は、各トランザクションを一意に示すためのトランザクション識別子(図示する場合、これをトランザクションIDと言うことがある。)によって、トランザクション別の状態情報を記憶する。   The transaction information storage unit 33 stores state information for each transaction by a transaction identifier for uniquely indicating each transaction (in the figure, this may be referred to as a transaction ID).

データベース統計情報記憶部34は、データベース管理システムの実行中の全トランザクションにおいて、一番古いコミット済みトランザクション識別子(これを、最古トランザクション識別子という。)、テーブルの定義や、テーブルデータサイズ、ページサイズ、ページ不要領域修復処理開始閾値、空き容量を持っているページアドレスとサイズなどを記憶する。   The database statistical information storage unit 34 is the oldest committed transaction identifier (this is called the oldest transaction identifier), table definition, table data size, page size, A page unnecessary area repair process start threshold, a page address having a free space, a size, and the like are stored.

ページ不要領域情報記憶部35は、テーブルデータ記憶部32に記憶されているテーブルデータに対して更新や削除が実行された際に発生したページ毎の不要領域合計サイズを記憶する。
(1−2)追記型データベース管理システムの不要領域修復処理
次に、図1のブロック図と、図2及び図3のフローチャートを参照して、第1の実施の形態による追記型データベース管理システムの不要領域修復処理について、詳細に説明する。
The page unnecessary area information storage unit 35 stores the total unnecessary area size for each page generated when the table data stored in the table data storage unit 32 is updated or deleted.
(1-2) Unnecessary Area Repair Processing of Write-Once Database Management System Next, referring to the block diagram of FIG. 1 and the flowcharts of FIGS. 2 and 3, the write-once database management system according to the first embodiment The unnecessary area repair process will be described in detail.

なお、第1の実施の形態では、対象となるデータベースの操作を多版式同時実行制御(Multi Version Concurrency Control)により、不要領域が発生した場合の不要領域の削除と、更新のクエリの動作のみに限って説明を行う。   In the first embodiment, the operation of the target database is performed only by deleting unnecessary areas and updating queries when unnecessary areas are generated by multi-version concurrent control (Multi Version Concurrency Control). The explanation is limited.

まず、データベース管理システム2(図1)は、データベースクライアント1(図1)から、更新のクエリを受ける。   First, the database management system 2 (FIG. 1) receives an update query from the database client 1 (FIG. 1).

次に、クエリ管理部21がクエリを受け取ると、クエリ解析部211が、そのクエリの解析を行う。   Next, when the query management unit 21 receives the query, the query analysis unit 211 analyzes the query.

そして、実行計画作成部212が実行計画を作成し、その情報(すなわち作成された実行計画である。)を、ストレージ管理部23へ送る(図2のステップA1)。   Then, the execution plan creation unit 212 creates an execution plan and sends the information (that is, the created execution plan) to the storage management unit 23 (step A1 in FIG. 2).

ストレージ管理部23は、トランザクションの多版式同時実行制御を行うため、トランザクション管理部22のトランザクション制御管理部221によって、トランザクション識別子(図2では、これをトランザクションIDと記載する。)を受け取る(図2のステップA2)。   The storage management unit 23 receives a transaction identifier (referred to as transaction ID in FIG. 2) by the transaction control management unit 221 of the transaction management unit 22 in order to perform multi-version simultaneous execution control of transactions (FIG. 2 describes this as a transaction ID). Step A2).

ここで、先に受け取ったクエリが、更新であるか或いは削除であるかによって動作が変わる(図2のステップA3)。   Here, the operation changes depending on whether the previously received query is update or deletion (step A3 in FIG. 2).

もし先に受け取ったクエリが更新の場合には、タプル管理部233(図1)によってタプルイメージを作成し、ページ管理部232(図1)により、そのタプルイメージをテーブルデータとしてテーブルデータ記憶部32に書込みを行う。   If the previously received query is an update, a tuple image is created by the tuple management unit 233 (FIG. 1), and the table data storage unit 32 uses the tuple image as table data by the page management unit 232 (FIG. 1). Write to.

ここで、作成されたタプルイメージにインデックスが有る場合には、インデックス管理部231がインデックスデータ記憶部31に、作成されたタプルイメージのインデックスの書込みを行う(図2のステップA4)。   Here, when the created tuple image has an index, the index management unit 231 writes the index of the created tuple image in the index data storage unit 31 (step A4 in FIG. 2).

これに対し、先に受け取ったクエリが削除であった場合、或いは更新データの書込みが終了した場合には、タプル管理部233によって作成されたタプルイメージに、削除フラグとトランザクション識別子を書き込み(図2のステップA5)、そのタプルイメージをテーブルデータとしてページ管理部232によってテーブルデータ記憶部32に書き込む(図2のステップA6)。   On the other hand, when the query received earlier is deletion or when the update data has been written, the deletion flag and the transaction identifier are written in the tuple image created by the tuple management unit 233 (FIG. 2). In step A5), the tuple image is written as table data in the table data storage unit 32 by the page management unit 232 (step A6 in FIG. 2).

これにより、現在のトランザクション識別子によって削除された状態になる。   As a result, the current transaction identifier is deleted.

また、空き容量管理部234は、ステップA5において、削除フラグを立てたタプルイメージのページアドレスとタプルイメージのサイズを記憶しておき、ステップA6において、削除されたページアドレスとタプルイメージのデータのサイズから、ページごとの合計不要領域サイズが記憶されているページ不要領域情報記憶部35へ更新を行う。   In step A5, the free space management unit 234 stores the page address of the tuple image and the size of the tuple image for which the deletion flag has been set, and in step A6, the deleted page address and the size of the tuple image data. To the page unnecessary area information storage unit 35 in which the total unnecessary area size for each page is stored.

タプル管理部233は、トランザクションが終了したことを記録するため、トランザクション情報記憶部33に対して、トランザクション識別子にコミットされた情報を書き込む。また、タプル管理部233は、統計情報管理部235(図1)を介して、データベース統計情報記憶部34に記憶していた最古トランザクション識別子の更新が行える場合には、更新情報を書き込む(図2のステップA7)。   The tuple management unit 233 writes the committed information in the transaction identifier in the transaction information storage unit 33 in order to record the completion of the transaction. In addition, the tuple management unit 233 writes the update information when the oldest transaction identifier stored in the database statistical information storage unit 34 can be updated via the statistical information management unit 235 (FIG. 1) (see FIG. 1). Step A7).

その後、空き容量管理部234は、統計情報管理部235からページのサイズやページ不要領域修復処理開始閾値を取得し、ステップA4において更新を行ったページの不要領域サイズ比率が閾値を超えているか否か、ページ不要領域情報記憶部35に記憶されている情報から、ページ毎に調査する(図2のステップA8〜A9)。   Thereafter, the free space management unit 234 acquires the page size and the page unnecessary area repair processing start threshold from the statistical information management unit 235, and whether or not the unnecessary area size ratio of the page updated in step A4 exceeds the threshold. Or, it investigates for every page from the information memorize | stored in the page unnecessary area | region information storage part 35 (step A8-A9 of FIG. 2).

ここで、更新済みのページであって(ステップA8)、その更新済みのページにおいてページ不要領域の比率を判断し(ステップA9)、閾値の比率を超えていれば、そのページに対して後述する不要領域解放処理を行う(図2のステップB)。   Here, if it is an updated page (step A8), the ratio of the page unnecessary area in the updated page is determined (step A9), and if it exceeds the threshold ratio, the page will be described later. Unnecessary area release processing is performed (step B in FIG. 2).

そして、ステップBによる不要領域解放処理が終了したか、或いはステップA9で閾値の比率を超えていなければ、この次のページの処理を行うためにステップA8に戻る。   If the unnecessary area releasing process in step B is completed or if the threshold ratio is not exceeded in step A9, the process returns to step A8 to perform the process for the next page.

このように、全ての更新されたページに対して、ページ不要領域の比率の確認が終了した時点で、当初に受け取ったクエリの処理は終了とする。
(1−3)追記型データベース管理システムの不要領域解放処理(ステップB)
次に、不要領域解放処理(図2のステップB)について、図3のフローチャートを用いて説明する。
As described above, when the confirmation of the ratio of the page unnecessary area is completed for all the updated pages, the processing of the query received initially is terminated.
(1-3) Unnecessary area release processing of write-once database management system (step B)
Next, the unnecessary area releasing process (step B in FIG. 2) will be described with reference to the flowchart in FIG.

まず、ページ管理部232(図1)とタプル管理部233(図1)は、テーブルデータ記憶部32(図1)から獲得した不要領域解放を行うページに対して、タプル領域を一番目から検査していく(図3のステップB1)。   First, the page management unit 232 (FIG. 1) and the tuple management unit 233 (FIG. 1) inspect the tuple area from the first for the page for releasing the unnecessary area acquired from the table data storage unit 32 (FIG. 1). (Step B1 in FIG. 3).

ここで、ページ内に未検査のタプルが有る場合は、データベース統計情報記憶部34を通じて最古トランザクション識別子を参照する。   Here, when there is an unexamined tuple in the page, the oldest transaction identifier is referred to through the database statistical information storage unit 34.

そして、トランザクション制御管理部221は、タプルのトランザクション識別子と最古トランザクション識別子とを比較して、タプルのトランザクション識別子が最古トランザクション識別子よりも古いと判定されれば、削除可能となる(図3のステップB2)。   Then, the transaction control management unit 221 compares the tuple transaction identifier with the oldest transaction identifier, and if it is determined that the tuple transaction identifier is older than the oldest transaction identifier, the transaction control management unit 221 can delete the tuple (FIG. 3). Step B2).

また、削除可能な場合には、ストレージ管理部23が、タプルの位置情報を削除予約リストに格納する(図3のステップB3)。   If deletion is possible, the storage management unit 23 stores the tuple position information in the deletion reservation list (step B3 in FIG. 3).

このように、図3のステップB1からステップB3を繰り返し、ページに格納されている全てのタプルについて検査を行う。   In this way, the steps B1 to B3 in FIG. 3 are repeated, and all the tuples stored in the page are inspected.

全てのタプルについて検査が終了すると、図3のステップB3で確認された削除予約リストに、タプル削除情報が格納されているかを確認する(図3のステップB4)。   When the inspection is completed for all the tuples, it is confirmed whether or not the tuple deletion information is stored in the deletion reservation list confirmed in step B3 in FIG. 3 (step B4 in FIG. 3).

ここで、削除予約リストに削除対象タプルが存在する場合には、テーブルのインデックスの有無を検査する(図3のステップB5)。   Here, if there is a deletion target tuple in the deletion reservation list, the presence / absence of an index in the table is checked (step B5 in FIG. 3).

そして、削除対象タプルにインデックスが存在する場合には、インデックス管理部231が、ページに含まれる削除対象タプルのインデックス情報(すなわち、インデックスデータに相当する。)を削除する(図3のステップB6)。   If there is an index in the deletion target tuple, the index management unit 231 deletes the index information (that is, corresponding to the index data) of the deletion target tuple included in the page (step B6 in FIG. 3). .

これにより、インデックス情報がなかった場合、又は全てのインデックス情報の削除が完了した場合には、ページ管理部232がページの空き領域を確保する(図3のステップB7)。   Thereby, when there is no index information or when deletion of all the index information is completed, the page management unit 232 secures a free area of the page (step B7 in FIG. 3).

空き容量管理部234は、統計情報管理部235を介して、データベース統計情報記憶部34に確保した空き領域とページ番号を記憶し、空き領域と領域情報を更新する(図3のステップB8)。   The free space management unit 234 stores the free space and page number secured in the database statistical information storage unit 34 via the statistical information management unit 235, and updates the free space and region information (step B8 in FIG. 3).

ここで、空き領域の確保(図3のステップB7)について、具体例として図4において説明を行うことにする。   Here, the securing of the free space (step B7 in FIG. 3) will be described with reference to FIG. 4 as a specific example.

図4を参照すると、空き領域の解放前ページ4には、ページ管理情報41と、タプルデータ42とが含まれている。   Referring to FIG. 4, the page 4 before free space release includes page management information 41 and tuple data 42.

また、タプルデータ42には、有効タプルデータ421と、424とを有すると共に、削除可能タプルデータ422と、423と及び425が存在している。   The tuple data 42 includes valid tuple data 421 and 424, and deleteable tuple data 422, 423, and 425.

ページ管理情報41には、タプルデータ421から425の有効性情報が格納されている。そして、解放前ページ4から空き領域の確保を行ったものが空き領域解放後ページ5となる。   In the page management information 41, validity information of the tuple data 421 to 425 is stored. Then, the page 5 after securing the free area from the page 4 before release becomes the page 5 after free area release.

ページ管理部232は、有効タプルデータ421、424を順に後ろから揃えると共に、ページ管理情報41に削除可能として管理されている、削除可能タプルデータ422と、423及び425のタプルデータを無効化し、ページ管理情報51に書き換える。   The page management unit 232 arranges the valid tuple data 421 and 424 in order from the back, invalidates the tuple data of the erasable tuple data 422 and 423 and 425 managed as erasable in the page management information 41, The management information 51 is rewritten.

つまり、有効タプルデータ421のデータが有効タプルデータ521と、有効タプルデータ424のデータが有効タプルデータ522と、等しいデータになっている。   That is, the valid tuple data 421 is equal to the valid tuple data 521 and the valid tuple data 424 is equal to the valid tuple data 522.

これにより有効なタプルデータのみが残り、空き領域を適切に確保することができる。
(1−4)追記型データベース管理システムの確保領域追記処理
次に、この確保した空き領域を利用した確保領域追記処理について、図5に示すフローチャートによって説明を行う。
As a result, only valid tuple data remains, and a free area can be secured appropriately.
(1-4) Reserved Area Additional Recording Process of Write-Once Database Management System Next, the reserved area additional recording process using the reserved empty area will be described with reference to the flowchart shown in FIG.

データベースであるテーブルデータ記憶部32にテーブルデータの挿入及び更新により、データ追記が発生したら、ストレージ管理部23が追記対象のタプルデータを、ひとつずつ操作していく(図5のステップC1)。   When additional data is generated by inserting and updating table data in the table data storage unit 32, which is a database, the storage management unit 23 operates the tuple data to be added one by one (step C1 in FIG. 5).

まず、タプル管理部233は、追記対象であるタプルデータのタプル長を算出する(図5のステップC2)。   First, the tuple management unit 233 calculates the tuple length of the tuple data to be added (step C2 in FIG. 5).

そして、そのタプル長が、再利用領域で格納できるページが存在するか否か、空き容量管理部234によって確認する(図5のステップC3)。   Then, the free capacity management unit 234 checks whether there is a page whose tuple length can be stored in the reuse area (step C3 in FIG. 5).

ここで、もし再利用可能なページが存在した場合には、ページ管理部232がテーブルデータ記憶部32の対象ページに追記対象のタプルデータを挿入する(図5のステップC4)。   Here, if there is a page that can be reused, the page management unit 232 inserts additional tuple data into the target page of the table data storage unit 32 (step C4 in FIG. 5).

その後、空き容量管理部234が再利用領域情報へ利用したページのサイズ情報を更新する(図5のステップC5)。   Thereafter, the free space management unit 234 updates the page size information used for the reuse area information (step C5 in FIG. 5).

これに対し、再利用領域に格納できるページが存在しない場合には、ページ管理部232が最終ページに追記対象のタプルデータの挿入ができるか否か、確認を行う(図5のステップC6)。   On the other hand, if there is no page that can be stored in the reuse area, the page management unit 232 checks whether or not the tuple data to be added can be inserted into the final page (step C6 in FIG. 5).

もし、その追記対象のタプルデータが挿入できる場合には、最終ページにその追記対象のタプルデータの挿入を行う(図5のステップC7)。   If the additional target tuple data can be inserted, the additional target tuple data is inserted into the last page (step C7 in FIG. 5).

一方、最終ページにおいて、追記対象のタプルデータを挿入できない場合には、新しいページを確保して、その追記対象のタプルデータの挿入を行う(図5のステップC8)。   On the other hand, if the tuple data to be added cannot be inserted on the last page, a new page is secured and the tuple data to be added is inserted (step C8 in FIG. 5).

以上のステップC1からステップC8を繰り返し、全てのタプルデータの挿入が終われば、終了となる。
(1−5)追記型データベース管理システムの効果
本実施の形態では、空き容量管理部234が、更新や削除によって発生した不要領域を、ページ不要領域情報記憶部35に、ページごとに記憶するように構成されているので、テーブルデータの更新や削除によって、ページごとの不要領域を管理し、記憶する。
The above steps C1 to C8 are repeated, and when all the tuple data has been inserted, the process ends.
(1-5) Effect of Write-once Database Management System In this embodiment, the free space management unit 234 stores the unnecessary area generated by the update or deletion in the page unnecessary area information storage unit 35 for each page. Therefore, the unnecessary area for each page is managed and stored by updating or deleting the table data.

これにより、ページごとの自動的な不要領域修復と再利用を効率的に実施することができる。また、運用状況により、ページ不要領域修復処理開始閾値を小さくすることにより、不要容量を発生させにくくさせることができ、或いは、ページ不要領域修復処理開始閾値を大きくすることにより、不要領域解放処理を効率の高いページに限定することもできる。   Thereby, automatic unnecessary area repair and reuse for each page can be efficiently performed. Also, depending on the operation status, it is possible to make it difficult to generate unnecessary capacity by reducing the threshold for starting page unnecessary area repair processing, or by increasing the threshold for starting page unnecessary area repair processing, It can also be limited to highly efficient pages.

このように、本実施の形態によれば、不要領域となったサイズをデータベースの記録単位であるページごとに管理していることにより、不要領域修復を行う対象のページを、不要領域の比率が予め設定された閾値以上のページに限定して行うことができるので、効率の良い不要領域修復処理ができることにある。   As described above, according to the present embodiment, the size of the unnecessary area is managed for each page that is a recording unit of the database, so that the ratio of the unnecessary area is determined for the page to be subjected to the unnecessary area repair. Since it is possible to limit the number of pages to a predetermined threshold or more, it is possible to efficiently perform unnecessary area repair processing.

更に、本実施の形態によれば、不要領域解放処理を不要領域が発生した全てのページに対して行わず、削除や更新により不要領域が発生する毎に、その際、不要領域の比率の閾値を超えたページにのみ不要領域修復処理を行うことができるので、不要領域修復処理を分散化させることができる。
(第2の実施の形態)
(2)第2の実施の形態による追記型データベース管理システム
(2−1)追記型データベース管理システムの構成
次に、第2の実施の形態による追記型データベース管理システムについて説明する。
Furthermore, according to the present embodiment, unnecessary area release processing is not performed on all pages where unnecessary areas have occurred, and each time unnecessary areas are generated by deletion or update, the threshold of the ratio of unnecessary areas Since the unnecessary area repair process can be performed only on pages exceeding the limit, the unnecessary area repair process can be distributed.
(Second Embodiment)
(2) Write-once database management system according to second embodiment (2-1) Configuration of write-once database management system Next, a write-once database management system according to the second embodiment will be described.

図6を参照すると、第2の実施の形態による追記型データベース管理システムでは、第1の実施の形態における構成に加え、更に記憶装置6が、テーブル不要領域情報記憶部61を備えている。   Referring to FIG. 6, in the write-once database management system according to the second embodiment, in addition to the configuration in the first embodiment, the storage device 6 further includes a table unnecessary area information storage unit 61.

テーブル不要領域情報記憶部61には、ページ不要領域情報記憶部35で記憶されている不要領域サイズのテーブル毎の合計が、記録されている。   The table unnecessary area information storage unit 61 records the total of the unnecessary area sizes stored in the page unnecessary area information storage unit 35 for each table.

また、データベース統計情報記憶部34には、テーブル不要領域修復処理開始閾値と、テーブル不要領域修復終了閾値とが保存されている。   The database statistical information storage unit 34 stores a table unnecessary area repair processing start threshold and a table unnecessary area repair end threshold.

但し、ここでは、具体例として、テーブル不要領域修復処理開始閾値が、テーブル不要領域修復処理終了閾値よりも大きい値であるものとする。
(2−2)追記型データベース管理システムの不要領域修復処理
次に、第2の実施の形態における不要領域修復処理について、図6及び図7のフローチャートを参照しながら、詳細に説明する。
However, here, as a specific example, it is assumed that the table unnecessary area repair processing start threshold is larger than the table unnecessary area repair processing end threshold.
(2-2) Unnecessary Region Repair Processing of Write-Once Database Management System Next, unnecessary region repair processing in the second embodiment will be described in detail with reference to the flowcharts of FIGS. 6 and 7.

図7のフローチャートにおいて、ステップA1からA6及びステップA7、またステップBで示される第2の実施の形態におけるクエリ解析部211、実行計画作成部212、トランザクション制御管理部221、インデックス管理部231、ページ管理部232、タプル管理部233、空き容量管理部234及び統計情報管理部235の動作は、第1の実施の形態で示した動作と同一であるため、説明は省略する。   In the flowchart of FIG. 7, the query analysis unit 211, the execution plan creation unit 212, the transaction control management unit 221, the index management unit 231, the page in the second embodiment indicated by steps A 1 to A 6 and step A 7 and step B Since the operations of the management unit 232, the tuple management unit 233, the free space management unit 234, and the statistical information management unit 235 are the same as the operations described in the first embodiment, description thereof is omitted.

第1の実施の形態では、空き容量管理部234が管理していたものは、ページ毎の不要領域のサイズのみであった。   In the first embodiment, the free space management unit 234 manages only the size of the unnecessary area for each page.

これに対し、第2の実施の形態では、ステップA6においてページサイズ情報の更新の後、空き容量管理部234が、テーブルにおける合計不要領域サイズを、テーブル不要領域情報記憶部61に更新する。   In contrast, in the second embodiment, after the page size information is updated in step A6, the free space management unit 234 updates the total unnecessary area size in the table to the table unnecessary area information storage unit 61.

すなわち、空き容量管理部234は、参照しているテーブルのページ不要領域情報記憶部35で保存している不要領域サイズの総和と等しい値を更新する(図7のステップD1)。   That is, the free space management unit 234 updates a value equal to the sum of the unnecessary area sizes stored in the page unnecessary area information storage unit 35 of the referenced table (step D1 in FIG. 7).

そして、図7のステップA7におけるトランザクションのコミットログを書込み後、空き容量管理部234は、統計情報管理部235からテーブルのサイズやテーブル不要領域修復処理開始閾値を取得すると共に、テーブル不要領域情報記憶部61から合計テーブル不要容量サイズを取得する。そして、空き容量管理部234は、テーブルの不要領域比率(以下、テーブル不要領域比率と言う。)がテーブル不要領域修復処理開始閾値を超えていないか確認する(図7のステップD2)。   After writing the transaction commit log in step A7 in FIG. 7, the free space management unit 234 obtains the table size and the table unnecessary area repair processing start threshold from the statistical information management unit 235, and stores the table unnecessary area information. The total table unnecessary capacity size is acquired from the unit 61. Then, the free space management unit 234 checks whether the unnecessary area ratio of the table (hereinafter referred to as the table unnecessary area ratio) does not exceed the table unnecessary area repair processing start threshold (step D2 in FIG. 7).

ここで、テーブル不要領域比率が、テーブル不要領域修復処理開始閾値を超えている場合には、ページ不要領域情報記憶部35から一番大きい不要領域サイズを持っているページを調査し、そのページに対して不要領域解放処理(ステップB)を行う。   If the table unnecessary area ratio exceeds the table unnecessary area repair processing start threshold, the page having the largest unnecessary area size is checked from the page unnecessary area information storage unit 35, and the page is displayed. On the other hand, an unnecessary area release process (step B) is performed.

そして、不要領域解放処理(ステップB)を行った後、ステップD3へ戻り、先のテーブル不要領域比率が、データベース統計情報記憶部34に記憶されているテーブル不要領域修復終了閾値より小さいか否かを判断し、小さければ終了となる。   Then, after performing the unnecessary area release process (step B), the process returns to step D3, and whether or not the previous table unnecessary area ratio is smaller than the table unnecessary area repair end threshold stored in the database statistical information storage unit 34. If it is smaller, the process ends.

ここで、具体的に検討すると、例えば、テーブル不要領域修復処理開始閾値が30%であるとし、テーブル不要領域修復処理終了閾値が10%であるとする。   Here, specifically, for example, it is assumed that the table unnecessary area repair processing start threshold is 30% and the table unnecessary area repair processing end threshold is 10%.

もし、例えば、ステップD2において、あるテーブル不要領域比率が32%であった場合には、図7のステップD3へ進むと共に、テーブル不要領域修復処理終了閾値が10%であるので、ステップD4へ進む。また、ステップD4では、一番大きい不要領域サイズを持つページを調査し、不要比率の高いページを検索した後にステップBへ移り、不要領域解放処理を実施する。   For example, if a certain table unnecessary area ratio is 32% in step D2, the process proceeds to step D3 in FIG. 7 and the table unnecessary area repair processing end threshold is 10%, and therefore the process proceeds to step D4. . In step D4, the page having the largest unnecessary area size is investigated, and after searching for a page having a high unnecessary ratio, the process proceeds to step B, and unnecessary area releasing processing is performed.

この場合、例えば、一番大きい不要領域サイズを持つページに対して不要領域解放処理(ステップB)を行ったことにより、32%であったテーブル不要領域比率が、ステップD3において、テーブル不要領域修復処理終了閾値である10%より小さくなった場合に、終了となる。   In this case, for example, the unnecessary area release process (step B) is performed on the page having the largest unnecessary area size, so that the table unnecessary area ratio that was 32% is restored in step D3. When the processing end threshold is less than 10%, the processing ends.

これに対し、ステップD3において、テーブル不要領域比率が、テーブル不要領域修復終了閾値である10%よりもまだ大きい場合には、次に大きい不要領域サイズを持っているページを調査し(図7のステップD4)、そのページに対して不要領域解放処理(ステップB)を行う。   On the other hand, if the table unnecessary area ratio is still larger than 10%, which is the table unnecessary area repair end threshold, in step D3, the page having the next larger unnecessary area size is investigated (FIG. 7). Step D4), an unnecessary area release process (Step B) is performed on the page.

そして、不要領域解放処理(ステップB)が終了するとステップD3に戻り、テーブル不要領域の比率を判断し、テーブル不要領域修復終了閾値(上述の例では、10%)を満たすまで不要領域解放処理(ステップB)を繰り返す。   When the unnecessary area release process (step B) ends, the process returns to step D3, the ratio of table unnecessary areas is determined, and the unnecessary area release process (10% in the above example) is satisfied until the table unnecessary area repair end threshold (10% in the above example) is satisfied. Repeat step B).

なお、第2の実施の形態では、図7に示したステップD2及びD3の処理に特徴を有しており、確保した空き領域を利用したデータの確保領域追記処理については、第1の実施の形態の場合(1−4)と同一であるため、説明は省略する。   Note that the second embodiment has a feature in the processing of steps D2 and D3 shown in FIG. 7, and the reserved area additional process of data using the reserved empty area is described in the first embodiment. Since it is the same as the case of the form (1-4), the description is omitted.

また或いは、ステップD2とステップD3の間に、ステップD4とステップBを設け、テーブル不要領域修復処理開始閾値(例えば、30%)を満たしていない場合に、もっとも大きい不要領域サイズを有するページを調査し(ステップD4)、そのページに対して不要領域解放処理(ステップB)を行い、テーブル不要領域修復処理終了閾値(例えば、10%)を満たすような処理を追加しても良い。
(2−3)追記型データベースシステムの効果
第2の実施の形態では、テーブル不要領域修復処理開始閾値と、テーブル不要領域修復終了閾値とを設けることにより、テーブル全体での不要容量の比率によって不要容量修復のタイミングを自動的に計ることができる。
Alternatively, Step D4 and Step B are provided between Step D2 and Step D3, and when the table unnecessary area repair processing start threshold value (for example, 30%) is not satisfied, the page having the largest unnecessary area size is examined. (Step D4), an unnecessary area release process (Step B) is performed on the page, and a process that satisfies the table unnecessary area repair process end threshold (for example, 10%) may be added.
(2-3) Effect of write-once database system In the second embodiment, by providing a table unnecessary area repair processing start threshold and a table unnecessary area repair end threshold, it is unnecessary depending on the ratio of unnecessary capacity in the entire table. The capacity restoration timing can be measured automatically.

また、第1の実施の形態と同様に、空き容量管理部234が、ページ不要領域情報記憶部35に更新や削除によって発生した不要容量を、ページごとに記憶するように構成されているので、効率性の高いページから不要容量修復を行うことができる。   Similarly to the first embodiment, the free capacity management unit 234 is configured to store the unnecessary capacity generated by the update or deletion in the page unnecessary area information storage unit 35 for each page. Unnecessary capacity restoration can be performed from a highly efficient page.

また、運用状況により、第1の実施の形態で示したように、テーブル不要領域修復処理開始閾値を小さくすることによって、不要容量を発生させにくくさせることができると共に、テーブル不要領域修復処理終了閾値の大きくすることによって、不要容量修復の負荷をできるだけ小さくすることもできる。
(3)第3の実施の形態による追記型データベース管理システム
(3−1)追記型データベース管理システムの構成
第3の実施の形態における構成は、第1の実の形態の場合と同様であり、図1と同一であるが、ページ管理部232がオペレーティングシステムを通じてディスクの負荷や処理状況などを監視する点と、不要領域修復の開始条件となるディスク負荷閾値を有する点で異なる。
(3−2)追記型データベースシステムの不要領域修復処理
次に、第3の実施の形態における不要領域修復処理について、図8及び図9のフローチャートを参照しながら、詳細に説明する。
Further, depending on the operation status, as shown in the first embodiment, by reducing the table unnecessary area repair processing start threshold, it is possible to make it difficult to generate unnecessary capacity, and the table unnecessary area repair processing end threshold. By increasing the size, the load for repairing unnecessary capacity can be reduced as much as possible.
(3) Write-once database management system according to the third embodiment (3-1) Configuration of the write-once database management system The structure in the third embodiment is the same as in the case of the first embodiment, 1 is the same as FIG. 1 except that the page management unit 232 monitors the disk load and processing status through the operating system and has a disk load threshold value that is a condition for starting unnecessary area repair.
(3-2) Unnecessary Region Repair Processing of Write-Once Database System Next, unnecessary region repair processing in the third embodiment will be described in detail with reference to the flowcharts of FIGS. 8 and 9.

図8のフローチャートにおいて、ステップA1からA8及びA9で示される第3の実施の形態におけるクエリ解析部211、実行計画作成部212、トランザクション制御管理部221、インデックス管理部231、ページ管理部232、タプル管理部233、空き容量管理部234及び統計情報管理部235の動作は、第1の実施の形態で示した動作と同一であるため、説明は省略する。   In the flowchart of FIG. 8, the query analysis unit 211, the execution plan creation unit 212, the transaction control management unit 221, the index management unit 231, the page management unit 232, the tuple in the third embodiment indicated by steps A1 to A8 and A9. The operations of the management unit 233, the free space management unit 234, and the statistical information management unit 235 are the same as the operations described in the first embodiment, and thus description thereof is omitted.

第1の実施の形態では、不要領域サイズ比率が閾値を超えていた場合、その比較の後にステップBによる不要領域解放処理によって不要領域の修復を行っていた。   In the first embodiment, when the unnecessary area size ratio exceeds the threshold value, the unnecessary area is repaired by the unnecessary area releasing process in step B after the comparison.

これに対し、第3の実施の形態では、ステップA9において不要領域比率の調査後に、不要領域サイズ閾値を超えていた場合には、そのページに対する不要領域修復の予約を、対象ページ位置と共にページ管理部232が覚えておく(図8のステップE1)。   In contrast, in the third embodiment, after the unnecessary area ratio is checked in step A9, if the unnecessary area size threshold is exceeded, reservation of unnecessary area repair for the page is performed together with the target page position. The part 232 remembers (step E1 in FIG. 8).

次に、図9のフローチャートを参照すると、また、ページ管理部232は、一定時間ごとや指定された時間帯に不要領域修復の予約が登録されているかどうかを確認する。(図9のステップF1)。   Next, referring to the flowchart of FIG. 9, the page management unit 232 confirms whether reservations for unnecessary area repair are registered at regular time intervals or at designated time zones. (Step F1 in FIG. 9).

ここで、不要領域修復の予約が登録されている場合には、ページ管理部232は、オペレーティングシステムを通じてディスクの負荷や処理状況を調べる(図9のステップF2)。   If a reservation for unnecessary area repair is registered, the page management unit 232 checks the disk load and processing status through the operating system (step F2 in FIG. 9).

そして、一定時間の間、ディスク負荷が、ディスク負荷閾値を超えた場合には、ディスク負荷が、ディスク負荷閾値を下回り続けるまで待機する(図9のステップF3)。   If the disk load exceeds the disk load threshold for a certain time, the process waits until the disk load continues to be below the disk load threshold (step F3 in FIG. 9).

このように、ディスク負荷が下がるまで待機することにより(図9のステップF3)、ディスク負荷がディスク負荷閾値を下回り続けた場合、或いはステップF2においてディスク負荷が低い場合には、不要領域解放処理を行う(図9のステップB)。   Thus, by waiting until the disk load decreases (step F3 in FIG. 9), if the disk load continues to fall below the disk load threshold, or if the disk load is low in step F2, unnecessary area release processing is performed. Perform (Step B in FIG. 9).

ステップBの不要領域解放処理が終了すると、ステップF1に戻り、不要領域修復の予約が無くなるまで一連の流れを続け、不要領域解放処理の予約が無くなれば、第3の実施の形態における不要領域修復処理は、終了となる。   When the unnecessary area release processing in step B is completed, the process returns to step F1 and continues a series of steps until there is no reservation for unnecessary area repair. If there is no reservation for unnecessary area repair processing, the unnecessary area repair in the third embodiment is performed. The process ends.

なお、不要領域解放処理や、確保した空き領域を利用した確保領域追記処理については、第1の実施の形態のものと同一であるため、説明は省略する。
(3−3)追記型データベースの効果
本実施の形態では、不要領域修復の実施タイミングについて、ディスク負荷が低いときに自動的に行うことが出来る。
The unnecessary area releasing process and the reserved area additional process using the reserved empty area are the same as those in the first embodiment, and thus the description thereof is omitted.
(3-3) Effect of Write-once Database In the present embodiment, the execution timing of unnecessary area repair can be automatically performed when the disk load is low.

これにより、第1の実施の形態で示したように、ページ単位で不要領域修復のために領域修復対象範囲を少なくしている上、更にディスク負荷が低いときに不要領域を修復させることから、データベースの他の操作や同計算機上で動いている他のアプリケーションへの影響を最小限にとどめることが出来る。   Thereby, as shown in the first embodiment, the area to be repaired is reduced for repairing the unnecessary area in units of pages, and the unnecessary area is repaired when the disk load is low. The impact on other operations of the database and other applications running on the same computer can be minimized.

また、事前にデータベースやその他アプリケーションの影響範囲が低い時間帯が分かっている場合には、この不要領域修復の実行時期を予め指定しておくことにより、不要領域修復の影響をさらに限定的にすることも出来る。   In addition, if the time zone where the influence range of the database and other applications is low is known in advance, the effect of unnecessary area repair can be further limited by specifying the execution timing of this unnecessary area repair in advance. You can also

本発明における第1の実施の形態による追加型データベース管理システムの構成を示すブロック図である。It is a block diagram which shows the structure of the additional type database management system by the 1st Embodiment in this invention. 本発明における第1の実施の形態による不要領域修復処理を表すフローチャートである。It is a flowchart showing the unnecessary area | region repair process by the 1st Embodiment in this invention. 本発明における第1の実施の形態による不要領域解放処理を表すフローチャートである。It is a flowchart showing the unnecessary area | region release process by the 1st Embodiment in this invention. 本発明における第1の実施の形態による空き領域の確保を具体例で示した図である。It is the figure which showed the securing of the empty area by the 1st Embodiment in this invention by the example. 本発明における第1の実施の形態による確保領域追記処理を表すフローチャートである。It is a flowchart showing the securing area additional recording process by the 1st Embodiment in this invention. 本発明における第2の実施の形態による追加型データベース管理システムの構成を示すブロック図である。It is a block diagram which shows the structure of the additional type database management system by the 2nd Embodiment in this invention. 本発明における第2の実施の形態による不要領域修復処理を表すフローチャートである。It is a flowchart showing the unnecessary area | region repair process by the 2nd Embodiment in this invention. 本発明における第3の実施の形態による不要領域修復処理を表すフローチャートである。It is a flowchart showing the unnecessary area | region repair process by the 3rd Embodiment in this invention. 本発明における第3の実施の形態による不要領域解放処理を解放処理予約の有無によって実行するフローチャートである。It is a flowchart which performs the unnecessary area | region release process by the 3rd Embodiment in this invention by the presence or absence of a release process reservation.

符号の説明Explanation of symbols

1 データベースクライアント
2 データベース管理システム
3、6 記憶装置
4 解放前ページ
5 解放後ページ
21 クエリ管理部
22 トランザクション管理部
23 ストレージ管理部
31 インデックスデータ記憶部
32 テーブルデータ記憶部
33 トランザクション情報記憶部
34 データベース統計情報記憶部
35 ページ不要領域情報記憶部
41、51 ページ管理情報
42 タプルデータ
61 テーブル不要領域情報記憶部
211 クエリ解析部
212 実行計画作成部
221 トランザクション制御管理部
231 インデックス管理部
232 ページ管理部
233 タプル管理部
234 空き容量管理部
235 統計情報管理部
421、423、424 有効タプルデータ
422、425 削除可能タプルデータ
521、522 有効タプルデータ
DESCRIPTION OF SYMBOLS 1 Database client 2 Database management system 3, 6 Storage device 4 Page before release 5 Page after release 21 Query management part 22 Transaction management part 23 Storage management part 31 Index data storage part 32 Table data storage part 33 Transaction information storage part 34 Database statistics Information storage section 35 Page unnecessary area information storage section 41, 51 Page management information 42 Tuple data 61 Table unnecessary area information storage section 211 Query analysis section 212 Execution plan creation section 221 Transaction control management section 231 Index management section 232 Page management section 233 Tuple Management unit 234 Free capacity management unit 235 Statistical information management unit 421, 423, 424 Valid tuple data 422, 425 Deletable tuple data 521, 522 Valid tuple data

Claims (15)

データを記憶するデータベースを管理する追記型データベース管理システムにおいて、
前記データを更新又は削除することにより前記データベース内に生じる不要領域を、当該データベースの記録単位であるページ毎に更新しながら管理する管理手段と、
前記管理手段が前記ページ毎に管理する前記不要領域から当該不要領域のサイズを算出すると共に、当該不要領域のサイズと、前記データベース内における当該不要領域の位置とを、前記ページ毎に記憶する不要領域記憶手段と、
前記ページに前記不要領域が発生した場合に、前記不要領域記憶手段に記憶された前記不要領域のサイズと、当該ページにおける前記不要領域の比率に基づいて、当該不要領域に属するデータを解放するか否かを判断する不要領域比率判断手段と、を備え、
前記不要領域比率判断手段は、
前記不要領域のサイズと、前記ページにおける前記不要領域の比率とに基づいて、予め設定された閾値を超えた場合には、当該ページの前記不要領域に属するデータを前記不要領域の位置から解放する不要領域解放処理手段
を更に備えることを特徴とする追記型データベース管理システム。
In a write-once database management system that manages a database that stores data,
A management means for managing unnecessary areas generated in the database by updating or deleting the data while updating each page as a recording unit of the database;
The management unit calculates the size of the unnecessary area from the unnecessary area managed for each page, and stores the size of the unnecessary area and the position of the unnecessary area in the database for each page. Area storage means;
Whether the data belonging to the unnecessary area is released based on the size of the unnecessary area stored in the unnecessary area storage unit and the ratio of the unnecessary area in the page when the unnecessary area occurs in the page Unnecessary area ratio determining means for determining whether or not,
The unnecessary area ratio determining means includes:
Based on the size of the unnecessary area and the ratio of the unnecessary area in the page, when a preset threshold is exceeded, the data belonging to the unnecessary area of the page is released from the position of the unnecessary area. A write-once database management system, further comprising unnecessary area release processing means.
前記不要領域解放処理手段は、
前記ページの前記不要領域に属するデータの実行ログであるトランザクション識別子と、システムの実行ログとして一番古く関わった最古トランザクションとを比較して、当該不要領域に属するデータが削除可能なタプルデータか否かを判断するタプルデータ有効性判断手段と、
前記タプルデータ有効性判断手段により、前記トランザクション識別子が前記最古トランザクション識別子より古い場合には、前記不要領域に属するデータは、前記削除可能なタプルデータと判断されると共に、当該削除可能なタプルデータに対し削除予約を行うタプルデータ削除予約手段と、
前記タプルデータ削除予約手段により、前記削除可能なタプルデータがある場合には、当該削除可能なタプルデータに割り当てられたインデックスデータの有無を判断するインデックスデータ判断手段と、
前記インデックス判断手段により、前記削除可能なタプルデータに割り当てられた前記インデックスデータが有った場合には、当該インデックスデータを削除するインデックスデータ削除手段と、を備え、
前記インデックス判断手段は、前記インデックスデータ削除手段によって前記インデックスデータが無くなった場合又は前記インデックスデータが前記削除可能なタプルデータに無かった場合には、当該削除可能なタプルデータを解放して空き領域を確保する
ことを特徴とする請求項1記載の追記型データベース管理システム。
The unnecessary area release processing means includes:
Compare the transaction identifier, which is the execution log of the data belonging to the unnecessary area of the page, with the oldest transaction related to the oldest as the system execution log, and determine whether the data belonging to the unnecessary area can be deleted. Tuple data validity determination means for determining whether or not,
When the transaction identifier is older than the oldest transaction identifier by the tuple data validity determination means, the data belonging to the unnecessary area is determined as the deleteable tuple data and the deleteable tuple data Tuple data deletion reservation means for performing deletion reservation for
When there is tuple data that can be deleted by the tuple data deletion reservation unit, index data determination unit that determines whether there is index data assigned to the deleteable tuple data;
When there is the index data assigned to the deleteable tuple data by the index determining means, the index data deleting means for deleting the index data,
The index determining means releases the erasable tuple data to release a free area when the index data is deleted by the index data deleting means or when the index data is not in the erasable tuple data. The write-once database management system according to claim 1, wherein the write-once database management system is secured.
前記管理手段が前記ページを更新することにより、前記データベースに記憶された前記データを更新する場合であって、
更新により前記データベースに新たに追記するタプルデータのレコードを、追記タプルデータ長として算出するタプル長算出手段、を更に備え、
前記タプル長算出手段によって前記追記タプルデータ長が算出されることにより、確保された前記空き領域に、当該追記タプルデータ長の前記タプルデータのレコードを挿入可能な場合には、当該空き領域に挿入すると共に、挿入された当該タプルデータの前記ページを更新し、
算出された前記タプルデータ長の前記タプルデータが前記空き領域に挿入できない場合であって、前記データベースの最終ページに当該タプルデータ長の前記タプルデータを挿入できる場合には、当該最終ページに挿入し、
算出された前記タプルデータ長の前記タプルデータが前記空き領域に挿入できない場合であって、前記データベースの前記最終ページに前記タプルデータ長の前記タプルデータを挿入できない場合には、前記データベースに新規ページを確保して、当該タプルデータ長の前記タプルデータを追記する
ことを特徴とする請求項2記載の追記型データベース管理システム。
When the management means updates the data stored in the database by updating the page,
A tuple length calculating means for calculating a tuple data record to be newly added to the database by updating, as a appending tuple data length;
If the tuple data length is calculated by the tuple length calculation means and the tuple data record of the additional write tuple data length can be inserted in the reserved free area, it is inserted into the free area. And update the page of the inserted tuple data,
When the tuple data having the calculated tuple data length cannot be inserted into the empty area and the tuple data having the tuple data length can be inserted into the last page of the database, the tuple data is inserted into the last page. ,
When the tuple data having the calculated tuple data length cannot be inserted into the empty area and the tuple data having the tuple data length cannot be inserted into the last page of the database, a new page is added to the database. The write-once database management system according to claim 2, wherein the tuple data of the tuple data length is additionally recorded.
前記管理手段が、前記データベース内に生じる前記不要領域を、前記データのテーブル毎に合計しながら管理するテーブル合計管理手段と、
前記テーブル合計管理手段が、当該テーブル毎の前記不要領域のサイズを更新しながら記憶するテーブル不要領域記憶手段と、を更に備え、
前記テーブル合計管理手段は、
前記テーブル毎の前記不要領域のサイズと、前記テーブルにおける前記不要領域の比率とに基づいて、前記不要領域解放処理手段を開始する開始閾値、又は前記不要領域解放処理手段を終了する終了閾値の少なくとも一方を備えると共に、
前記開始閾値又は前記終了閾値によって前記不要領域解放処理手段を制御する
ことを特徴とする請求項1記載の追記型データベース管理システム。
Table total management means for managing the unnecessary area generated in the database while totaling the unnecessary areas for each table of the data;
The table total management means further comprises table unnecessary area storage means for storing while updating the size of the unnecessary area for each table,
The table total management means includes:
Based on the size of the unnecessary area for each table and the ratio of the unnecessary area in the table, at least a start threshold value for starting the unnecessary area release processing means or an end threshold value for ending the unnecessary area release processing means With one side,
The write-once database management system according to claim 1, wherein the unnecessary area release processing means is controlled by the start threshold value or the end threshold value.
前記不要領域比率判断手段は、
前記ページに前記不要領域が発生した場合であって、前記予め設定された閾値を超えた場合には、前記不要領域解放処理手段を実施するための予約を行う不要領域解放処理予約手段を更に備え、
前記不要領域解放処理予約手段は、
前記データベースの処理負荷に基づいて、前記不要領域解放処理手段を制御する
ことを特徴とする請求項1記載の追記型データベース管理システム。
The unnecessary area ratio determining means includes:
When the unnecessary area occurs in the page and the preset threshold value is exceeded, an unnecessary area release processing reservation unit that performs a reservation for performing the unnecessary area release processing unit is further provided. ,
The unnecessary area release process reservation means includes:
The write-once database management system according to claim 1, wherein the unnecessary area release processing means is controlled based on a processing load of the database.
データを記憶するデータベースを管理する追記型データベース管理システムにおける不要領域修復処理方法であって、
前記データを更新又は削除することにより前記データベース内に生じる不要領域を、当該データベースの記録単位であるページ毎に更新しながら管理する管理ステップと、
前記管理ステップにおいて前記ページ毎に管理する前記不要領域から当該不要領域のサイズを算出すると共に、当該不要領域のサイズと、前記データベース内における当該不要領域の位置とを、前記ページ毎に記憶する不要領域記憶ステップと、
前記ページに前記不要領域が発生した場合に、前記不要領域記憶ステップに記憶された前記不要領域のサイズと、当該ページにおける前記不要領域の比率に基づいて、当該不要領域に属するデータを解放するか否かを判断する不要領域比率判断ステップと、を備え、
前記不要領域比率判断ステップは、
前記不要領域のサイズと、前記ページにおける前記不要領域の比率とに基づいて、予め設定された閾値を超えた場合には、当該ページの前記不要領域に属するデータを前記不要領域の位置から解放する不要領域解放処理ステップ
を更に備えることを特徴とする不要領域修復処理方法。
An unnecessary area repair processing method in a write-once database management system for managing a database storing data,
A management step of managing unnecessary areas generated in the database by updating or deleting the data while updating each page which is a recording unit of the database;
It is unnecessary to calculate the size of the unnecessary area from the unnecessary area managed for each page in the management step, and to store the size of the unnecessary area and the position of the unnecessary area in the database for each page. An area storage step;
Whether the data belonging to the unnecessary area is released based on the size of the unnecessary area stored in the unnecessary area storing step and the ratio of the unnecessary area in the page when the unnecessary area occurs in the page An unnecessary area ratio determining step for determining whether or not,
The unnecessary area ratio determining step includes:
Based on the size of the unnecessary area and the ratio of the unnecessary area in the page, when a preset threshold is exceeded, the data belonging to the unnecessary area of the page is released from the position of the unnecessary area. An unnecessary area repair processing method, further comprising: an unnecessary area release processing step.
前記不要領域解放処理ステップは、
前記ページの前記不要領域に属するデータの実行ログであるトランザクション識別子と、システムの実行ログとして一番古く関わった最古トランザクションとを比較して、当該不要領域に属するデータが削除可能なタプルデータか否かを判断するタプルデータ有効性判断ステップと、
前記タプルデータ有効性判断ステップにより、前記トランザクション識別子が前記最古トランザクション識別子より古い場合には、前記不要領域に属するデータは、前記削除可能なタプルデータと判断されると共に、当該削除可能なタプルデータに対し削除予約を行うタプルデータ削除予約ステップと、
前記タプルデータ削除予約ステップにより、前記削除可能なタプルデータがある場合には、当該削除可能なタプルデータに割り当てられたインデックスデータの有無を判断するインデックスデータ判断ステップと、
前記インデックス判断ステップにより、前記削除可能なタプルデータに割り当てられた前記インデックスデータが有った場合には、当該インデックスデータを削除するインデックスデータ削除ステップと、を備え、
前記インデックス判断ステップは、前記インデックスデータ削除ステップによって前記インデックスデータが無くなった場合又は前記インデックスデータが前記削除可能なタプルデータに無かった場合には、当該削除可能なタプルデータを解放して空き領域を確保する
ことを特徴とする請求項6記載の不要領域修復処理方法。
The unnecessary area release processing step includes:
Compare the transaction identifier, which is the execution log of the data belonging to the unnecessary area of the page, with the oldest transaction related to the oldest as the system execution log, and determine whether the data belonging to the unnecessary area can be deleted. A tuple data validity determination step for determining whether or not;
If the transaction identifier is older than the oldest transaction identifier in the tuple data validity determination step, the data belonging to the unnecessary area is determined as the deleteable tuple data and the deleteable tuple data Tuple data deletion reservation step for performing deletion reservation for
In the tuple data deletion reservation step, if there is the deleteable tuple data, an index data determination step of determining whether there is index data assigned to the deleteable tuple data;
An index data deletion step of deleting the index data when there is the index data assigned to the tuple data that can be deleted by the index determination step;
The index determining step releases the deleteable tuple data and frees the free space when the index data is lost by the index data deleting step or when the index data is not in the deleteable tuple data. The unnecessary area repair processing method according to claim 6, wherein the unnecessary area is repaired.
前記管理ステップが前記ページを更新することにより、前記データベースに記憶された前記データを更新する場合であって、
更新により前記データベースに新たに追記するタプルデータのレコードを、追記タプルデータ長として算出するタプル長算出ステップ、を更に備え、
前記タプル長算出ステップによって前記追記タプルデータ長が算出されることにより、確保された前記空き領域に、当該追記タプルデータ長の前記タプルデータのレコードを挿入可能な場合には、当該空き領域に挿入すると共に、挿入された当該タプルデータの前記ページを更新し、
算出された前記タプルデータ長の前記タプルデータが前記空き領域に挿入できない場合であって、前記データベースの最終ページに当該タプルデータ長の前記タプルデータを挿入できる場合には、当該最終ページに挿入し、
算出された前記タプルデータ長の前記タプルデータが前記空き領域に挿入できない場合であって、前記データベースの前記最終ページに前記タプルデータ長の前記タプルデータを挿入できない場合には、前記データベースに新規ページを確保して、当該タプルデータ長の前記タプルデータを追記する
ことを特徴とする請求項7記載の不要領域修復処理方法。
The management step is to update the data stored in the database by updating the page;
A tuple length calculation step of calculating a tuple data record to be newly added to the database by update as a postscript tuple data length;
When the recordable tuple data length is calculated by the tuple length calculating step, if the tuple data record of the recordable tuple data length can be inserted in the reserved space area, it is inserted in the space area. And update the page of the inserted tuple data,
When the tuple data having the calculated tuple data length cannot be inserted into the empty area and the tuple data having the tuple data length can be inserted into the last page of the database, the tuple data is inserted into the last page. ,
When the tuple data having the calculated tuple data length cannot be inserted into the empty area and the tuple data having the tuple data length cannot be inserted into the last page of the database, a new page is added to the database. The unnecessary region repair processing method according to claim 7, wherein the tuple data having the tuple data length is additionally recorded.
前記管理ステップが、前記データベース内に生じる前記不要領域を、前記データのテーブル毎に合計しながら管理するテーブル合計管理ステップと、
前記テーブル合計管理ステップが、当該テーブル毎の前記不要領域のサイズを更新しながら記憶するテーブル不要領域記憶ステップと、を更に備え、
前記テーブル合計管理ステップは、
前記テーブル毎の前記不要領域のサイズと、前記テーブルにおける前記不要領域の比率とに基づいて、前記不要領域解放処理ステップを開始する開始閾値、又は前記不要領域解放処理ステップを終了する終了閾値の少なくとも一方を備えると共に、
前記開始閾値又は前記終了閾値によって前記不要領域解放処理ステップを制御する
ことを特徴とする請求項6記載の不要領域修復処理方法。
A table total management step for managing the unnecessary area generated in the database while totaling each data table;
The table total management step further comprises a table unnecessary area storage step for storing the table while updating the size of the unnecessary area for each table,
The table total management step includes:
Based on the size of the unnecessary area for each table and the ratio of the unnecessary area in the table, at least a start threshold value for starting the unnecessary area release processing step or an end threshold value for ending the unnecessary area release processing step With one side,
The unnecessary area repair processing method according to claim 6, wherein the unnecessary area release processing step is controlled by the start threshold or the end threshold.
前記不要領域比率判断ステップは、
前記ページに前記不要領域が発生した場合であって、前記予め設定された閾値を超えた場合には、前記不要領域解放処理ステップを実施するための予約を行う不要領域解放処理予約ステップを更に備え、
前記不要領域解放処理予約ステップは、
前記データベースの処理負荷に基づいて、前記不要領域解放処理ステップを制御する
ことを特徴とする請求項6記載の不要領域修復処理方法。
The unnecessary area ratio determining step includes:
When the unnecessary area occurs in the page and the preset threshold value is exceeded, an unnecessary area release process reservation step for making a reservation for performing the unnecessary area release process step is further provided. ,
The unnecessary area release processing reservation step includes:
The unnecessary area repair processing method according to claim 6, wherein the unnecessary area release processing step is controlled based on a processing load of the database.
データを記憶するデータベースを管理する追記型データベース管理システムにおける不要領域修復プログラムであって、
前記データを更新又は削除することにより前記データベース内に生じる不要領域を、当該データベースの記録単位であるページ毎に更新しながら管理する管理手順と、
前記管理手順が前記ページ毎に管理する前記不要領域から当該不要領域のサイズを算出すると共に、当該不要領域のサイズと、前記データベース内における当該不要領域の位置とを、前記ページ毎に記憶する不要領域記憶手順と、
前記ページに前記不要領域が発生した場合に、前記不要領域記憶手順に記憶された前記不要領域のサイズと、当該ページにおける前記不要領域の比率に基づいて、当該不要領域に属するデータを解放するか否かを判断する不要領域比率判断手順と、を備え、
前記不要領域比率判断手順は、
前記不要領域のサイズと、前記ページにおける前記不要領域の比率とに基づいて、予め設定された閾値を超えた場合には、当該ページの前記不要領域に属するデータを前記不要領域の位置から解放する不要領域解放処理手順を更に備え、
コンピュータに実行させることを特徴とする不要領域修復プログラム。
An unnecessary area repair program in a write-once database management system for managing a database for storing data,
A management procedure for managing unnecessary areas generated in the database by updating or deleting the data while updating each page as a recording unit of the database;
The management procedure calculates the size of the unnecessary area from the unnecessary area managed for each page, and stores the size of the unnecessary area and the position of the unnecessary area in the database for each page. Region storage procedure;
Whether the data belonging to the unnecessary area is released based on the size of the unnecessary area stored in the unnecessary area storing procedure and the ratio of the unnecessary area in the page when the unnecessary area occurs in the page An unnecessary area ratio determination procedure for determining whether or not,
The unnecessary area ratio determining procedure includes:
Based on the size of the unnecessary area and the ratio of the unnecessary area in the page, when a preset threshold is exceeded, the data belonging to the unnecessary area of the page is released from the position of the unnecessary area. It further includes an unnecessary area release processing procedure,
An unnecessary area repair program which is executed by a computer.
前記不要領域解放処理手順は、
前記ページの前記不要領域に属するデータの実行ログであるトランザクション識別子と、システムの実行ログとして一番古く関わった最古トランザクションとを比較して、当該不要領域に属するデータが削除可能なタプルデータか否かを判断するタプルデータ有効性判断手順と、
前記タプルデータ有効性判断手順により、前記トランザクション識別子が前記最古トランザクション識別子より古い場合には、前記不要領域に属するデータは、前記削除可能なタプルデータと判断されると共に、当該削除可能なタプルデータに対し削除予約を行うタプルデータ削除予約手順と、
前記タプルデータ削除予約手順により、前記削除可能なタプルデータがある場合には、当該削除可能なタプルデータに割り当てられたインデックスデータの有無を判断するインデックスデータ判断手順と、
前記インデックス判断手順により、前記削除可能なタプルデータに割り当てられた前記インデックスデータが有った場合には、当該インデックスデータを削除するインデックスデータ削除手順と、を備え、
前記インデックス判断手順は、前記インデックスデータ削除手順によって前記インデックスデータが無くなった場合又は前記インデックスデータが前記削除可能なタプルデータに無かった場合には、当該削除可能なタプルデータを解放して空き領域を確保する
ことをコンピュータに実行させることを特徴とする請求項11記載の不要領域修復プログラム。
The unnecessary area release processing procedure includes:
Compare the transaction identifier, which is the execution log of the data belonging to the unnecessary area of the page, with the oldest transaction related to the oldest as the system execution log, and determine whether the data belonging to the unnecessary area can be deleted. A tuple data validity determination procedure for determining whether or not,
When the transaction identifier is older than the oldest transaction identifier according to the tuple data validity determination procedure, the data belonging to the unnecessary area is determined as the deleteable tuple data and the deleteable tuple data Tuple data deletion reservation procedure for performing deletion reservation for
When there is the tuple data that can be deleted by the tuple data deletion reservation procedure, an index data determination procedure for determining whether there is index data assigned to the deleteable tuple data;
An index data deletion procedure for deleting the index data when there is the index data assigned to the removable tuple data by the index determination procedure;
In the index determination procedure, when the index data is deleted by the index data deletion procedure or when the index data is not in the deleteable tuple data, the deleteable tuple data is released to free up an empty area. The unnecessary area repair program according to claim 11, wherein the computer executes execution of securing.
前記管理手順が前記ページを更新することにより、前記データベースに記憶された前記データを更新する場合であって、
更新により前記データベースに新たに追記するタプルデータのレコードを、追記タプルデータ長として算出するタプル長算出手順、を更に備え、
前記タプル長算出手順によって前記追記タプルデータ長が算出されることにより、確保された前記空き領域に、当該追記タプルデータ長の前記タプルデータのレコードを挿入可能な場合には、当該空き領域に挿入すると共に、挿入された当該タプルデータの前記ページを更新し、
算出された前記タプルデータ長の前記タプルデータが前記空き領域に挿入できない場合であって、前記データベースの最終ページに当該タプルデータ長の前記タプルデータを挿入できる場合には、当該最終ページに挿入し、
算出された前記タプルデータ長の前記タプルデータが前記空き領域に挿入できない場合であって、前記データベースの前記最終ページに前記タプルデータ長の前記タプルデータを挿入できない場合には、前記データベースに新規ページを確保して、当該タプルデータ長の前記タプルデータを追記する
ことをコンピュータに実行させることを特徴とする請求項12記載の不要領域修復プログラム。
The management procedure is to update the data stored in the database by updating the page,
A tuple length calculation procedure for calculating a tuple data record to be newly added to the database as a result of the update, as a tuple data length;
When the recordable tuple data length is calculated by the tuple length calculation procedure, if the tuple data record of the recordable tuple data length can be inserted into the reserved space area, it is inserted into the space area. And update the page of the inserted tuple data,
When the tuple data having the calculated tuple data length cannot be inserted into the empty area and the tuple data having the tuple data length can be inserted into the last page of the database, the tuple data is inserted into the last page. ,
When the tuple data having the calculated tuple data length cannot be inserted into the empty area and the tuple data having the tuple data length cannot be inserted into the last page of the database, a new page is added to the database. 13. The unnecessary area repair program according to claim 12, further comprising: causing the computer to execute the step of securing and adding the tuple data having the tuple data length.
前記管理手順が、前記データベース内に生じる前記不要領域を、前記データのテーブル毎に合計しながら管理するテーブル合計管理手順と、
前記テーブル合計管理手順が、当該テーブル毎の前記不要領域のサイズを更新しながら記憶するテーブル不要領域記憶手順と、を更に備え、
前記テーブル合計管理手順は、
前記テーブル毎の前記不要領域のサイズと、前記テーブルにおける前記不要領域の比率とに基づいて、前記不要領域解放処理手順を開始する開始閾値、又は前記不要領域解放処理手順を終了する終了閾値の少なくとも一方を備えると共に、
前記開始閾値又は前記終了閾値によって前記不要領域解放処理手順を制御する
ことをコンピュータに実行させることを特徴とする請求項11記載の不要領域修復プログラム。
A table total management procedure in which the management procedure manages the unnecessary area generated in the database for each table of the data;
The table total management procedure further comprises a table unnecessary area storage procedure for storing the table while updating the size of the unnecessary area for each table.
The table total management procedure is as follows:
Based on the size of the unnecessary area for each table and the ratio of the unnecessary area in the table, at least a start threshold value for starting the unnecessary area release processing procedure or an end threshold value for ending the unnecessary area release processing procedure With one side,
12. The unnecessary area repair program according to claim 11, which causes a computer to control the unnecessary area release processing procedure according to the start threshold value or the end threshold value.
前記不要領域比率判断手順は、
前記ページに前記不要領域が発生した場合であって、前記予め設定された閾値を超えた場合には、前記不要領域解放処理手順を実施するための予約を行う不要領域解放処理予約手順を更に備え、
前記不要領域解放処理予約手順は、
前記データベースの処理負荷に基づいて、前記不要領域解放処理手順を制御する
ことをコンピュータに実行させることを特徴とする請求項11記載の不要領域修復プログラム。
The unnecessary area ratio determining procedure includes:
When the unnecessary area is generated in the page and the preset threshold is exceeded, an unnecessary area releasing process reservation procedure for performing a reservation for executing the unnecessary area releasing process procedure is further provided. ,
The unnecessary area release processing reservation procedure is:
12. The unnecessary area repair program according to claim 11, which causes a computer to control the unnecessary area release processing procedure based on a processing load of the database.
JP2007013849A 2007-01-24 2007-01-24 Write-once database management system, unnecessary area repair processing method, and unnecessary area repair program Expired - Fee Related JP4623318B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007013849A JP4623318B2 (en) 2007-01-24 2007-01-24 Write-once database management system, unnecessary area repair processing method, and unnecessary area repair program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007013849A JP4623318B2 (en) 2007-01-24 2007-01-24 Write-once database management system, unnecessary area repair processing method, and unnecessary area repair program

Publications (2)

Publication Number Publication Date
JP2008181297A JP2008181297A (en) 2008-08-07
JP4623318B2 true JP4623318B2 (en) 2011-02-02

Family

ID=39725159

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007013849A Expired - Fee Related JP4623318B2 (en) 2007-01-24 2007-01-24 Write-once database management system, unnecessary area repair processing method, and unnecessary area repair program

Country Status (1)

Country Link
JP (1) JP4623318B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101833418B (en) 2010-04-28 2014-12-31 华为终端有限公司 Method and device for adding icon in interface and mobile terminal
WO2014057616A1 (en) * 2012-10-11 2014-04-17 日本電気株式会社 Information processing device
US8601206B1 (en) * 2013-03-14 2013-12-03 DSSD, Inc. Method and system for object-based transactions in a storage system
JP6242711B2 (en) * 2014-02-24 2017-12-06 株式会社東芝 Storage apparatus and data management method
KR101588375B1 (en) * 2014-04-25 2016-01-25 네이버 주식회사 Method and system for managing database

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63121940A (en) * 1986-11-11 1988-05-26 Nec Corp File control system
JPH01237853A (en) * 1988-03-18 1989-09-22 Fujitsu Ltd System for processing degeneration of prime page in hash file
JP2000137639A (en) * 1998-11-04 2000-05-16 Hitachi Ltd Long-term data archive management system using optical disk library
JP2001075832A (en) * 1999-08-31 2001-03-23 Fujitsu Ltd Device and method for system diagnosis and computer- readable recording medium with system diagnostic program recorded thereon
JP2001084259A (en) * 1999-09-13 2001-03-30 Mitsubishi Electric Corp Database system
JP2001243021A (en) * 2000-02-29 2001-09-07 Toshiba Corp Disk control mechanism suitable for random disk write
JP2004303368A (en) * 2003-03-31 2004-10-28 Sharp Corp Recording and reproducing device, control method for recording and reproducing device, control program of recording and reproducing device, and recording medium in which control program of recording and reproducing device is recorded

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63121940A (en) * 1986-11-11 1988-05-26 Nec Corp File control system
JPH01237853A (en) * 1988-03-18 1989-09-22 Fujitsu Ltd System for processing degeneration of prime page in hash file
JP2000137639A (en) * 1998-11-04 2000-05-16 Hitachi Ltd Long-term data archive management system using optical disk library
JP2001075832A (en) * 1999-08-31 2001-03-23 Fujitsu Ltd Device and method for system diagnosis and computer- readable recording medium with system diagnostic program recorded thereon
JP2001084259A (en) * 1999-09-13 2001-03-30 Mitsubishi Electric Corp Database system
JP2001243021A (en) * 2000-02-29 2001-09-07 Toshiba Corp Disk control mechanism suitable for random disk write
JP2004303368A (en) * 2003-03-31 2004-10-28 Sharp Corp Recording and reproducing device, control method for recording and reproducing device, control program of recording and reproducing device, and recording medium in which control program of recording and reproducing device is recorded

Also Published As

Publication number Publication date
JP2008181297A (en) 2008-08-07

Similar Documents

Publication Publication Date Title
US9953051B2 (en) Multi-version concurrency control method in database and database system
US8762333B2 (en) Apparatus and method for read optimized bulk data storage
KR100862661B1 (en) Method for deferred logging and apparatus thereof
US8874515B2 (en) Low level object version tracking using non-volatile memory write generations
US7028022B1 (en) Heuristic-based conditional data indexing
US7587429B2 (en) Method for checkpointing a main-memory database
US8560500B2 (en) Method and system for removing rows from directory tables
US20110035359A1 (en) Database Backup and Restore with Integrated Index Reorganization
US11409616B2 (en) Recovery of in-memory databases after a system crash
CN107111628A (en) Effective maintenance of row repository index on memory optimization table
JP2008225693A (en) Database management method, device, and program
US8954407B2 (en) System and method for partially deferred index maintenance
JP4623318B2 (en) Write-once database management system, unnecessary area repair processing method, and unnecessary area repair program
JP5959592B2 (en) Database management method, program, management system, and database tree structure
US8452730B2 (en) Archiving method and system
CN116595012B (en) Time sequence database log storage method and system based on nonvolatile memory
US11693866B2 (en) Efficient in-memory multi-version concurrency control for a trie data structure based database
JP6459669B2 (en) Column store type database management system
CN111427989A (en) Index processing method, index processing system and storage medium for full-text retrieval
JP2010146113A (en) Database management method, device and program

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20080618

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20100908

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20100908

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20101004

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20101006

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20101019

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20131112

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees