JP6215401B1 - Database management apparatus, database management method, and database management program - Google Patents

Database management apparatus, database management method, and database management program Download PDF

Info

Publication number
JP6215401B1
JP6215401B1 JP2016126978A JP2016126978A JP6215401B1 JP 6215401 B1 JP6215401 B1 JP 6215401B1 JP 2016126978 A JP2016126978 A JP 2016126978A JP 2016126978 A JP2016126978 A JP 2016126978A JP 6215401 B1 JP6215401 B1 JP 6215401B1
Authority
JP
Japan
Prior art keywords
data
record
database management
storage device
deletion
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.)
Active
Application number
JP2016126978A
Other languages
Japanese (ja)
Other versions
JP2018005300A (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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2016126978A priority Critical patent/JP6215401B1/en
Application granted granted Critical
Publication of JP6215401B1 publication Critical patent/JP6215401B1/en
Publication of JP2018005300A publication Critical patent/JP2018005300A/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

【課題】複数の分散化されたデータベース管理装置において、無効レコードに関連する処理負荷を抑制することができるデータベース管理装置、データベース管理方法、およびデータベース管理プログラムを提供することである。【解決手段】実施形態のデータベース管理装置は、複数のデータベース管理装置と、前記複数のデータベース管理装置により共有される記憶装置と、を備え、前記複数のデータベース管理装置のそれぞれは、データ管理部と、削除部とを持つ。データ管理部は、クライアントから登録要求のあったデータを前記記憶装置に書き込む。削除部は、前記データ管理部により前記記憶装置に書き込まれたデータの有効期限を認識可能な第1情報に基づいて、前記記憶装置に記憶されたデータのうち、有効期限を徒過したデータを削除する。【選択図】図1To provide a database management apparatus, a database management method, and a database management program capable of suppressing a processing load related to an invalid record in a plurality of distributed database management apparatuses. According to one embodiment, a database management device includes a plurality of database management devices and a storage device shared by the plurality of database management devices, and each of the plurality of database management devices includes a data management unit, , With deletion part. The data management unit writes the data requested by the client to the storage device. The deletion unit, based on the first information that can recognize the expiration date of the data written in the storage device by the data management unit, out of the data stored in the storage device the data that has passed the expiration date delete. [Selection] Figure 1

Description

本発明の実施形態は、データベース管理装置、データベース管理方法、およびデータベース管理プログラムに関する。   Embodiments described herein relate generally to a database management apparatus, a database management method, and a database management program.

データベース管理システム(DataBase Management System,DBMS)では、データベースにレコードを登録する場合に、そのレコードを利用できる有効期限を設定し、有効期限を徒過したレコード(無効レコード)を所定のタイミングで削除する場合がある。無効レコードを削除する手法としては、例えば定期的にテーブル内の全レコードをスキャンし、有効期限を徒過したレコードを削除する手法(ガベージコレクション/オフライン削除)や、アクセス要求のあったレコードにアクセスして、そのレコードの有効期限が徒過していた場合に、レコードの削除を行う手法(インライン削除)がある。しかしながら、従来の技術では、複数の分散化されたシステムにおいて、無効レコードへのアクセス数が増大したり、無効レコードを削除する処理負荷が増大する場合があった。   In the database management system (DataBase Management System, DBMS), when registering a record in the database, an expiration date for using the record is set, and a record that has passed the expiration date (invalid record) is deleted at a predetermined timing. There is a case. Methods for deleting invalid records include, for example, a method that periodically scans all records in the table and deletes records that have passed the expiration date (garbage collection / offline deletion), and accesses records that have been requested to be accessed. Then, there is a method (inline deletion) of deleting a record when the expiration date of the record has passed. However, in the conventional technique, in a plurality of distributed systems, the number of accesses to invalid records may increase or the processing load for deleting invalid records may increase.

特開2005−149348号公報JP 2005-149348 A

本発明が解決しようとする課題は、複数の分散化されたデータベース管理装置において、無効レコードに関連する処理負荷を抑制することができるデータベース管理装置、データベース管理方法、およびデータベース管理プログラムを提供することである。   The problem to be solved by the present invention is to provide a database management device, a database management method, and a database management program capable of suppressing the processing load related to invalid records in a plurality of distributed database management devices. It is.

実施形態のデータベース管理装置は、複数のデータベース管理装置と、前記複数のデータベース管理装置により共有される記憶装置と、を備え、前記複数のデータベース管理装置のそれぞれは、データ管理部と、削除部とを持つ。データ管理部は、クライアントから登録要求のあったデータを前記記憶装置に書き込む。削除部は、前記データ管理部により前記記憶装置に書き込まれたデータの有効期限を認識可能な第1情報に基づいて、前記記憶装置に記憶されたデータのうち、有効期限を徒過したデータを削除する。   The database management device according to the embodiment includes a plurality of database management devices and a storage device shared by the plurality of database management devices, and each of the plurality of database management devices includes a data management unit, a deletion unit, have. The data management unit writes the data requested by the client to the storage device. The deletion unit, based on the first information that can recognize the expiration date of the data written in the storage device by the data management unit, out of the data stored in the storage device the data that has passed the expiration date delete.

本実施形態のデータベース管理装置100を備えるデータベース管理システム1の機能構成例を示す図。The figure which shows the function structural example of the database management system 1 provided with the database management apparatus 100 of this embodiment. データベース管理装置100における登録動作を説明するための図。The figure for demonstrating the registration operation | movement in the database management apparatus 100. FIG. データベース管理装置100におけるデータ登録処理の一例を示すフローチャート。5 is a flowchart showing an example of data registration processing in the database management apparatus 100. 有効期限付きレコードリスト140Aの一例を示す図。The figure which shows an example of the record list 140A with an expiration date. データベース管理装置100におけるレコードアクセス時の動作を説明するための図。The figure for demonstrating the operation | movement at the time of the record access in the database management apparatus 100. FIG. データベース管理装置100におけるレコードアクセス処理の一例を示すフローチャート。5 is a flowchart showing an example of record access processing in the database management apparatus 100. 無効レコードエントリ処理の一例を示すフローチャート。The flowchart which shows an example of an invalid record entry process. 優先削除レコードリスト140Bの一例を示す図。The figure which shows an example of the priority deletion record list 140B. データベース管理装置100における優先削除動作の一例を説明するための図。The figure for demonstrating an example of the priority deletion operation | movement in the database management apparatus 100. FIG. データベース管理装置100における優先削除処理の一例を示すフローチャート。5 is a flowchart showing an example of priority deletion processing in the database management apparatus 100. データベース管理装置100における定周期削除動作の一例を示す図。The figure which shows an example of the fixed period deletion operation | movement in the database management apparatus 100. データベース管理装置100における定周期削除処理の一例を示すフローチャート。5 is a flowchart showing an example of a fixed period deletion process in the database management apparatus 100. 第2の実施例における優先削除レコードリスト140Bの一例を示す図。The figure which shows an example of the priority deletion record list | wrist 140B in a 2nd Example. 第4の実施例における優先削除レコードリスト140Bの一例を示す図。The figure which shows an example of the priority deletion record list | wrist 140B in a 4th Example. 第5の実施例における優先削除レコードリスト140Bの一例を示す図。The figure which shows an example of the priority deletion record list | wrist 140B in a 5th Example. 無効レコード削除に関する処理結果の一例を示す図。The figure which shows an example of the process result regarding an invalid record deletion.

以下、実施形態のデータベース管理装置、データベース管理方法、およびデータベース管理プログラムを、図面を参照して説明する。   Hereinafter, a database management device, a database management method, and a database management program according to embodiments will be described with reference to the drawings.

図1は、本実施形態のデータベース管理装置100を備えるデータベース管理システム1の機能構成例を示す図である。図1に示すデータベース管理システム1は、複数のデータベース管理装置100と、複数のデータベース管理装置により共有される1又は複数の記憶装置200と、データベース管理装置100に指示を送信し、対応する回答を取得するクライアント300とを備える。図1の例では、データベース管理システム1として、2つのデータベース管理装置100−1、100−2と、2つの記憶装置200−1、200−2と、2つのクライアント300−1、300−2とを備えるが、これに限定されるものではない。   FIG. 1 is a diagram illustrating a functional configuration example of a database management system 1 including a database management apparatus 100 according to the present embodiment. The database management system 1 shown in FIG. 1 transmits instructions to a plurality of database management devices 100, one or a plurality of storage devices 200 shared by the plurality of database management devices, and the database management device 100, and sends corresponding responses. The client 300 to acquire is provided. In the example of FIG. 1, as the database management system 1, two database management devices 100-1, 100-2, two storage devices 200-1, 200-2, two clients 300-1, 300-2, However, it is not limited to this.

ここで、データベース管理装置100−1、100−2のそれぞれは、同様の構成を有しているため、いずれのデータベース管理装置であるか区別しないときは、いずれのデータベース管理装置であるかを示すハイフン以降の符号を省略し、「データベース管理装置100」と称して説明する。また同様に、記憶装置200−1、200−2、クライアント300−1、300−2についても、必要に応じてそれぞれ「記憶装置200」、「クライアント300」と称する。なお、データベース管理装置100、記憶装置200、およびクライアント300のそれぞれは、インターネットやLAN(Local Area Network)等を含む通信ネットワークにより、データの送受信が可能な状態で接続されている。   Here, since each of the database management apparatuses 100-1 and 100-2 has the same configuration, when it is not distinguished which database management apparatus it is, which database management apparatus is indicated. Reference numerals after the hyphen are omitted, and the description will be given as “database management apparatus 100”. Similarly, the storage devices 200-1 and 200-2 and the clients 300-1 and 300-2 are also referred to as “storage device 200” and “client 300”, respectively, as necessary. Note that each of the database management device 100, the storage device 200, and the client 300 is connected in a state where data can be transmitted and received by a communication network including the Internet and a LAN (Local Area Network).

データベース管理装置100は、ユーザが使用するクライアント300からの設定情報の入力や、処理を実行するための指示の入力を受け付け、受け付けた内容に基づいて、記憶装置200に対するI/O命令を発行する。   The database management apparatus 100 accepts input of setting information from the client 300 used by the user and an instruction for executing processing, and issues an I / O command to the storage device 200 based on the accepted content. .

データベース管理装置100は、レコード管理部(データ管理部)110と、無効レコード削除部(削除部)120と、通信部130と、記憶部140とを備える。レコード管理部110は、レコード登録部112と、期限徒過判定部114とを備える。無効レコード削除部120は、コスト計算部(評価部)122と、削除実行部124とを備える。これらの構成要素のうち記憶部140を除くものの一部または全部は、例えば、コンピュータにおけるCPU(Central Processing Unit)等のプロセッサが、記憶部140等のプログラムメモリに格納されたプログラム(ソフトウェア)を実行することで実現される。また、これらの機能部のうち一部または全部は、LSI(Large Scale Integration)やASIC(Application Specific Integrated Circuit)、FPGA(Field-Programmable Gate Array)等のハードウェアによって実現されてもよいし、ソフトウェアとハードウェアとの協働により実現されてもよい。また、記憶部140は、RAM(Random Access Memory)やROM(Read Only Memory)、HDD(Hard Disk Drive)、フラッシュメモリ等により実現される。   The database management apparatus 100 includes a record management unit (data management unit) 110, an invalid record deletion unit (deletion unit) 120, a communication unit 130, and a storage unit 140. The record management unit 110 includes a record registration unit 112 and an expiration date determination unit 114. The invalid record deletion unit 120 includes a cost calculation unit (evaluation unit) 122 and a deletion execution unit 124. Some or all of these components excluding the storage unit 140 execute a program (software) stored in a program memory such as the storage unit 140 by a processor such as a CPU (Central Processing Unit) in the computer, for example. It is realized by doing. Some or all of these functional units may be realized by hardware such as LSI (Large Scale Integration), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array), etc. It may be realized by the cooperation of hardware and hardware. The storage unit 140 is realized by a RAM (Random Access Memory), a ROM (Read Only Memory), a HDD (Hard Disk Drive), a flash memory, or the like.

レコード管理部110は、クライアント300から登録要求のあったレコードを記憶装置200に書き込む。ここで、レコードとは、例えばクライアント300が書き込みや読み出しを指定する1単位のデータである。レコードは、例えば、各レコードを識別する識別情報と、それに関連付けられたデータとで構成される。   The record management unit 110 writes the record requested for registration from the client 300 to the storage device 200. Here, the record is, for example, one unit of data that the client 300 designates writing or reading. For example, the record includes identification information for identifying each record and data associated therewith.

レコード管理部110のレコード登録部112は、クライアント300から登録要求のあったデータに対して各データを識別するID(キー)を付与したレコードを記憶装置200に書きこむ。このとき、レコード登録部112は、登録するレコードIDごとにTTL値(Time To Live)を設定する。TTL値は、レコード(データ)の有効期限を認識可能な情報(第1情報の一例)である。TTL値は、例えば、そのレコードがいつまで有効であるかを示す時刻情報である。TTL値は、クライアント300から指定してもよく、データベース管理装置100において設定されてもよい。レコード登録部112は、登録したレコードのレコードIDとTTL値とを無効レコード削除部120に出力する。   The record registration unit 112 of the record management unit 110 writes a record in which an ID (key) for identifying each data is assigned to the data requested for registration from the client 300 in the storage device 200. At this time, the record registration unit 112 sets a TTL value (Time To Live) for each record ID to be registered. The TTL value is information (an example of first information) that can recognize an expiration date of a record (data). The TTL value is time information indicating, for example, how long the record is valid. The TTL value may be specified from the client 300 or may be set in the database management apparatus 100. The record registration unit 112 outputs the record ID and TTL value of the registered record to the invalid record deletion unit 120.

期限徒過判定部114は、記憶装置200に書き込まれたレコードに対して、TTL値を参照し、基準時刻(例えば、現在時刻)がTTL値で設定された時刻を徒過しているか否かを判定する。期限徒過判定部114は、例えば、現在時刻がTTL値を徒過していた場合、そのレコードが無効レコードであると判定し、その旨を無効レコードとなったレコードの識別情報であるレコードIDとともに無効レコード削除部120に出力する。   The expiration date determination unit 114 refers to the TTL value for the record written in the storage device 200, and whether or not the reference time (for example, the current time) exceeds the time set by the TTL value. Determine. For example, if the current time exceeds the TTL value, the expiration date determination unit 114 determines that the record is an invalid record, and records the record ID that is the identification information of the record that has become the invalid record. At the same time, it is output to the invalid record deletion unit 120.

なお、このような仕組みに代えて、レコードの書き込み時刻および有効期間の情報が保持され、期限徒過判定部114が、書き込み時刻からの期間が有効期間を超えたときに、そのレコードを無効レコードと判定する仕組みを採用してもよい。また、期限徒過判定部114は、レコードの書き込み時点で、有効期間に対応する値をカウントダウンさせるタイマを備え、カウントダウンにより有効期間に対応する値が0になった場合に、そのレコードが無効レコードであると判定してもよい。   Instead of such a mechanism, information on the write time and valid period of the record is retained, and when the expiration date determination unit 114 exceeds the valid period, the record is invalidated. You may employ | adopt the mechanism determined as. The expiration date determination unit 114 includes a timer that counts down the value corresponding to the valid period at the time of writing the record. If the value corresponding to the valid period becomes 0 due to the countdown, the record becomes an invalid record. It may be determined that

期限徒過判定部114は、無効レコードとなったレコードのレコードIDと、TTL値が示す時刻と現在時刻との差分値により求められる徒過後の経過時間とを無効レコード削除部120に出力してもよい。上述した徒過後の経過時間は、記憶装置200により記憶されたレコードの保持コストを評価するための情報(第2情報の一例)である。ここで、保持コストとは、そのレコード(データ)を記憶装置200に保持させておくことで生じるコスト(処理負荷、処理時間)に関する情報である。以下、保持コストを、単に「コスト」と称する。   The expiration date determination unit 114 outputs to the invalid record deletion unit 120 the record ID of the record that has become an invalid record, and the elapsed time that is determined by the difference between the time indicated by the TTL value and the current time. Also good. The above-mentioned elapsed time after passing is information (an example of second information) for evaluating the retention cost of the record stored in the storage device 200. Here, the retention cost is information relating to the cost (processing load, processing time) that occurs when the storage device 200 retains the record (data). Hereinafter, the holding cost is simply referred to as “cost”.

無効レコード削除部120は、レコード管理部110により有効期限が設定されたレコードに関する情報(例えば、レコードID、TTL値等)を取得し、これらのレコードをリスト化して管理する。また、無効レコード削除部120は、管理された各レコードのうち、無効レコードをコストに基づく所定の順序で記憶装置200から削除する。   The invalid record deletion unit 120 acquires information (for example, record ID, TTL value, etc.) relating to the record whose expiration date has been set by the record management unit 110, and manages these records in a list. Further, the invalid record deletion unit 120 deletes invalid records from the storage device 200 in a predetermined order based on the cost among the managed records.

例えば、無効レコード削除部120のコスト計算部122は、少なくとも、上述したTTL値、その他の第2情報に基づいて、レコードごとにコスト値を計算し、計算結果からコストを評価する。第2情報は、例えば、徒過後の経過時間、無効レコードに対するアクセス回数(無効アクセス回数)、レコードのサイズ、レコードが所属する領域(ブロック)の空き領域(残りレコード数)、レコードの登録先の記憶装置(レコードが所属する記憶装置)200の種類、および、レコードが所属する記憶装置の劣化度合等のうち、少なくとも1つを含む。   For example, the cost calculation unit 122 of the invalid record deletion unit 120 calculates a cost value for each record based on at least the above-described TTL value and other second information, and evaluates the cost from the calculation result. The second information includes, for example, the elapsed time after passing, the number of accesses to invalid records (number of invalid accesses), the size of the record, the free area (number of remaining records) of the area (block) to which the record belongs, and the record registration destination It includes at least one of the type of storage device (storage device to which the record belongs) 200 and the degree of deterioration of the storage device to which the record belongs.

例えば、コスト計算部122は、例えば、徒過後の経過時間が長くなるほどコスト値が高くなるようにコストを計算する。無効レコードに対するアクセス回数が多いほどコスト値が高くなるようにコストを計算する。また、コスト計算部122は、レコードのサイズが大きいほどコスト値が高くなるようにコストを計算してもよい。また、コスト計算部122は、レコードが登録された所定領域(ブロック)における空き領域が多いほど、コスト値が低くなるようにコストを計算してもよい。また、コスト計算部122は、レコードの登録先の記憶装置の種類に基づいて決定される係数が高い記憶装置200に登録されるレコードほど、コスト値が高くなるようにコストを計算してもよい。
For example, the cost calculation unit 122 calculates the cost such that the cost value increases as the elapsed time after passing increases. The cost is calculated so that the cost value increases as the number of accesses to the invalid record increases. Further, the cost calculation unit 122 may calculate the cost so that the cost value increases as the size of the record increases. In addition, the cost calculation unit 122 may calculate the cost such that the cost value decreases as the free area in the predetermined area (block) in which the record is registered increases. Further, the cost calculation unit 122 may calculate the cost such that the cost value of the record registered in the storage device 200 having a higher coefficient determined based on the type of the storage device to which the record is registered is higher. .

削除実行部124は、コスト計算部122により計算されたコスト値に基づいて優先度(例えば、優先順位)を設定し、設定された優先度に基づいて無効レコードを削除する。例えば、削除実行部124は、優先度の高い順に無効レコードを削除する。   The deletion execution unit 124 sets a priority (for example, priority) based on the cost value calculated by the cost calculation unit 122, and deletes the invalid record based on the set priority. For example, the deletion execution unit 124 deletes invalid records in descending order of priority.

通信部130は、他のデータベース管理装置100、記憶装置200、およびクライアント300のうち、少なくとも1つと通信ネットワークを介してデータの送受信を行う通信インターフェースである。通信ネットワークは、WAN(Wide Area Network)やLAN(Local Area Network)、インターネット等を含む。   The communication unit 130 is a communication interface that transmits / receives data to / from at least one of the other database management device 100, the storage device 200, and the client 300 via a communication network. The communication network includes a WAN (Wide Area Network), a LAN (Local Area Network), the Internet, and the like.

記憶部140は、データベース管理装置100における各種設定情報や、データベース管理に関する各種処理の実行経過または実行結果等により得られる情報、ログ情報、エラー情報等を記憶する。   The storage unit 140 stores various setting information in the database management apparatus 100, information obtained from the execution progress or execution results of various processes related to database management, log information, error information, and the like.

記憶装置200は、例えば複数のデータベース管理装置100により共有されるストレージ装置である。記憶装置200は、例えば、ハードディスク(ディスク装置)、フラッシュメモリ、RAM、および制御回路等を備える。記憶装置200は、キャッシュ領域210と、データ記憶領域220とを備える。キャッシュ領域210は、データ記憶領域220に対するキャッシュ領域として使用される。キャッシュ領域210は、例えば、RAM上に設定される。データ記憶領域220は、レコードを不揮発に保持する。   The storage device 200 is a storage device shared by a plurality of database management devices 100, for example. The storage device 200 includes, for example, a hard disk (disk device), a flash memory, a RAM, a control circuit, and the like. The storage device 200 includes a cache area 210 and a data storage area 220. The cache area 210 is used as a cache area for the data storage area 220. The cache area 210 is set on the RAM, for example. The data storage area 220 holds records in a nonvolatile manner.

クライアント300は、データベース管理装置100にデータの読み書き、削除等を行わせるためのコマンドを出力する。クライアント300は、例えばPC(Personal Computer)やタブレット端末、携帯電話等の情報処理装置である。クライアント300は、データベース管理装置100のユーザによって使用される情報処理装置であってもよく、さらに別の装置から受信したコマンド等に基づいて、データベース管理装置100に各種コマンドを送信する装置であってもよい。また、クライアント300は、内部において情報処理した結果に基づいて、各種コマンドを生成してデータベース管理装置100に送信する装置であってもよい。   The client 300 outputs a command for causing the database management apparatus 100 to read / write / delete data. The client 300 is an information processing apparatus such as a PC (Personal Computer), a tablet terminal, or a mobile phone. The client 300 may be an information processing apparatus used by a user of the database management apparatus 100, and is an apparatus that transmits various commands to the database management apparatus 100 based on a command received from another apparatus. Also good. Further, the client 300 may be a device that generates various commands based on the result of information processing inside and transmits the commands to the database management device 100.

例えば、クライアント300は、データベース管理装置100に対して、所定の処理を実行させるために、データの書き込みを指示するライトコマンド、データの読み出しを指示するリードコマンド、データの削除を指示する削除コマンド等を送信する。以下、リードコマンドによって、あるレコードの読み出しが要求されることを、「アクセス要求」と称する。また、クライアント300は、データベース管理装置100から指示した内容に対する処理結果を取得する。   For example, in order for the client 300 to cause the database management apparatus 100 to execute predetermined processing, a write command for instructing data writing, a read command for instructing data reading, a deletion command for instructing data deletion, etc. Send. Hereinafter, a request for reading a certain record by a read command is referred to as an “access request”. In addition, the client 300 acquires a processing result for the content instructed from the database management apparatus 100.

図1に示すデータベース管理システム1において、記憶装置200およびクライアント300の一方または双方は、データベース管理装置100と統合されてもよい。また、図1の例では、データベース管理装置100を使用する装置として1つのクライアント300が示されているが、複数のクライアント300が1つのデータベース管理装置100を使用してもよい。   In the database management system 1 shown in FIG. 1, one or both of the storage device 200 and the client 300 may be integrated with the database management device 100. In the example of FIG. 1, one client 300 is shown as an apparatus that uses the database management apparatus 100, but a plurality of clients 300 may use one database management apparatus 100.

次に、データベース管理装置100におけるデータベース管理の各種動作について、図を用いて説明する。図2は、データベース管理装置100における登録動作を説明するための図である。図2の例では、クライアント300からのライトコマンド(上書きでないもの)に基づき、対象のデータが含まれるレコードを生成し、生成したレコードを記憶装置200に登録する例を示している。また、図3は、データベース管理装置100におけるデータ登録処理の一例を示すフローチャートである。   Next, various operations of database management in the database management apparatus 100 will be described with reference to the drawings. FIG. 2 is a diagram for explaining a registration operation in the database management apparatus 100. The example of FIG. 2 shows an example in which a record including target data is generated based on a write command (not overwritten) from the client 300 and the generated record is registered in the storage device 200. FIG. 3 is a flowchart illustrating an example of data registration processing in the database management apparatus 100.

図3の例において、データベース管理装置100は、クライアント300からレコードの登録要求を受け付ける(ステップS100、図2に示す(1))。次に、レコード登録部112は、対象レコードを記憶装置200のキャッシュ領域210に登録する(ステップS102、図2に示す(2))。なお、ステップS102の処理では、レコードに対し、必要に応じてTTL値を設定する。設定されるTTL値は、レコードの所定のデータ項目に記憶され、データに関連付けられて登録される。   In the example of FIG. 3, the database management apparatus 100 accepts a record registration request from the client 300 (step S100, (1) shown in FIG. 2). Next, the record registration unit 112 registers the target record in the cache area 210 of the storage device 200 (step S102, (2) shown in FIG. 2). In the process of step S102, a TTL value is set for the record as necessary. The set TTL value is stored in a predetermined data item of the record and registered in association with the data.

次に、レコード登録部112は、登録が成功したか否かを判定する(ステップS104)。登録に成功した場合、レコード登録部112は、登録したレコードにTTLが設定されているか否かを判定する(ステップS106)。TTL値が設定されている場合、レコード登録部112は、登録したレコードに割り当てたレコードIDと、TTL値とを無効レコード削除部120に通知する(ステップS108、図2に示す(3))。通知を受けた無効レコード削除部120は、記憶部140に記憶された有効期限付きレコードリスト(有効期限付きリスト)140Aに、通知されたレコードIDを持つエントリ(登録データ)を作成する(ステップS110)。   Next, the record registration unit 112 determines whether the registration is successful (step S104). If the registration is successful, the record registration unit 112 determines whether TTL is set for the registered record (step S106). When the TTL value is set, the record registration unit 112 notifies the record ID assigned to the registered record and the TTL value to the invalid record deletion unit 120 (step S108, (3) shown in FIG. 2). Upon receiving the notification, the invalid record deleting unit 120 creates an entry (registered data) having the notified record ID in the record list with an expiration date (list with an expiration date) 140A stored in the storage unit 140 (step S110). ).

なお、ステップS108の処理では、登録したレコードに割り当てるレコードIDを、ハッシュを用いて生成してもよい。ハッシュ値を用いることで、例えば文字列検索のように個々のデータが大きい場合、データ全体を比較しながら検索するよりも比較にかかるコストを節約でき、高速に検索することができる。   In the process of step S108, a record ID assigned to the registered record may be generated using a hash. By using a hash value, for example, when individual data is large as in a character string search, the cost for comparison can be saved and the search can be performed at a higher speed than when searching while comparing the entire data.

ステップS106の処理において、TTL値が設定されていない場合、またはステップS108の処理後、レコード管理部110は、レコードの登録が成功したことを示す情報をクライアント300に出力する(ステップS112、図2に示す(4))。また、上述したステップS104の処理において、登録が成功しなかった場合、レコード管理部110は、登録が失敗した原因に対応するエラー情報をクライアント300に出力する(ステップS114、図2に示す(4))。登録が失敗した原因としては、例えば記憶装置200の空き容量不足や排他制御中による書き込みエラー等があるが、これに限定されるものではない。   If the TTL value is not set in the process of step S106, or after the process of step S108, the record management unit 110 outputs information indicating that the record registration is successful to the client 300 (step S112, FIG. 2). (4)). If the registration is not successful in the process of step S104 described above, the record management unit 110 outputs error information corresponding to the cause of the registration failure to the client 300 (step S114, (4 shown in FIG. 2). )). The reasons for the registration failure include, for example, a shortage of free space in the storage device 200 and a write error during exclusive control, but are not limited thereto.

ここで、上述した有効期限付きレコードリスト140Aについて図を用いて説明する。図4は、有効期限付きレコードリスト140Aの一例を示す図である。図4に示す有効期限付きレコードリスト140Aの項目(エントリ構成)としては、例えば「レコードID」、「TTL値」等がある。レコードIDは、レコードを識別するための識別情報であり、IDの内容は、図4の例に示すように文字や数値を用いることができるが、これに限定されるものではない。TTL値は、例えば時刻型の値である。TTL値は、例えば「2016/6/14 10:00」等のように、登録した時点より先の時刻が設定されるが、これに限定されるものではなく、上述した有効期間(例えば、24時間)等の情報であってもよい。例えば、期限徒過判定部114は、現在時刻がTTL値の時刻を超えた場合に、対象のレコードを無効レコードと判定する。   Here, the above-described record list with expiration date 140A will be described with reference to the drawings. FIG. 4 is a diagram illustrating an example of the record list with expiration date 140A. The items (entry structure) in the record list with expiration date 140A shown in FIG. 4 include, for example, “record ID”, “TTL value”, and the like. The record ID is identification information for identifying a record, and the content of the ID can use characters and numerical values as shown in the example of FIG. 4, but is not limited thereto. The TTL value is, for example, a time type value. As the TTL value, for example, “2016/6/14 10:00” or the like, a time before the registered time is set. However, the TTL value is not limited to this, and the above-described effective period (for example, 24 Time) and the like. For example, the expiration date determination unit 114 determines that the target record is an invalid record when the current time exceeds the time of the TTL value.

なお、レコード管理部110は、クライアント300からアクセス要求されたレコードが記憶装置200に存在するとともに、そのレコードが有効期限を徒過していない場合、そのレコードをクライアント300に出力する。ここで、「記憶装置200に存在する」とは、キャッシュ領域210とデータ記憶領域220との双方に存在する場合と、キャッシュ領域210のみ、データ記憶領域220のみに存在する場合とがある。   Note that the record management unit 110 outputs the record requested to be accessed from the client 300 to the client 300 when the record exists in the storage device 200 and the record does not expire. Here, “existing in the storage device 200” may be present in both the cache area 210 and the data storage area 220, or may be present only in the cache area 210 and only in the data storage area 220.

また、アクセス要求されたレコードが記憶装置200に存在しない場合には、すでに削除されたレコードであるため、レコード管理部110は、その旨をクライアント300に通知する。   If the access requested record does not exist in the storage device 200, the record management unit 110 notifies the client 300 to that effect because the record has already been deleted.

次に、クライアント300からのレコードアクセス要求に基づくレコードアクセス(読み出し)時の動作について、図を用いて説明する。図5は、データベース管理装置100におけるレコードアクセス時の動作を説明するための図である。また、図6は、データベース管理装置100におけるレコードアクセス処理の一例を示すフローチャートである。   Next, an operation at the time of record access (reading) based on a record access request from the client 300 will be described with reference to the drawings. FIG. 5 is a diagram for explaining the operation at the time of record access in the database management apparatus 100. FIG. 6 is a flowchart illustrating an example of record access processing in the database management apparatus 100.

図6の例において、データベース管理装置100は、クライアント300からのレコードアクセスコマンド(リードコマンド)を受け付ける(ステップS200、図5に示す(1))。次に、レコード管理部110は、記憶装置200から受け付けたコマンドに対するレコードを取得する処理を行う(ステップS202、図5に示す(2))。   In the example of FIG. 6, the database management apparatus 100 accepts a record access command (read command) from the client 300 (step S200, (1) shown in FIG. 5). Next, the record management unit 110 performs a process of acquiring a record for the command received from the storage device 200 (step S202, (2) shown in FIG. 5).

次に、レコード管理部110は、記憶装置200からレコードを取得できたか否かを判定する(ステップS204、図5に示す(3))。レコードを取得できた場合、レコード管理部110の期限徒過判定部114は、レコードに対応するTTL値を取得し(ステップS206)、現在時刻がTTL値を超えているか否かを判定する(ステップS208)。   Next, the record management unit 110 determines whether or not a record has been acquired from the storage device 200 (step S204, (3) shown in FIG. 5). If the record can be acquired, the expiration date determination unit 114 of the record management unit 110 acquires the TTL value corresponding to the record (step S206), and determines whether the current time exceeds the TTL value (step S206). S208).

現在時刻がTTL値を超えている場合、そのレコードは、有効期限を徒過しているため、期限徒過判定部114は、レコードIDを含む情報を、無効レコード削除部120に通知する(ステップS210、図5に(4))。無効レコード削除部120は、無効レコードエントリ処理を行う(ステップS212、図5に示す(5)、(6))。なお、無効レコードエントリ処理については、後述する。   If the current time exceeds the TTL value, the record has passed the expiration date, so the expiration date determination unit 114 notifies the invalid record deletion unit 120 of information including the record ID (step S1). S210, (4) in FIG. The invalid record deletion unit 120 performs invalid record entry processing (step S212, (5) and (6) shown in FIG. 5). The invalid record entry process will be described later.

次に、レコード管理部110は、対象のレコードが存在しない旨のエラー情報をクライアント300に出力する(ステップS216、図5に示す(7))。また、ステップS208の処理において、現在時刻がTTL値以下である場合、そのレコードは有効期限内であるため、取得したレコードを、クライアント300に出力する(ステップS218、図5に示す(7))。また、ステップS204の処理において、レコードの取得に成功しなかった場合、失敗した原因に基づくエラー情報をクライアント300に出力する(ステップS220、図5に示す(7))。   Next, the record management unit 110 outputs error information indicating that the target record does not exist to the client 300 (step S216, (7) illustrated in FIG. 5). If the current time is less than or equal to the TTL value in the process of step S208, the record is within the expiration date, and thus the acquired record is output to the client 300 (step S218, (7) shown in FIG. 5). . If the record acquisition is not successful in the process of step S204, error information based on the cause of the failure is output to the client 300 (step S220, (7) shown in FIG. 5).

図7は、無効レコードエントリ処理の一例を示すフローチャートである。図7の例において、無効レコード削除部120は、レコード管理部110からアクセスのあった無効レコードのレコードIDを取得し(ステップS300)、取得したレコードIDが、記憶部140に記憶された優先削除レコードリスト(優先削除リスト)140Bに存在するか否かを判定する(ステップS302)。レコードIDが優先削除レコードリスト140Bに存在する場合、コスト計算部122は、レコードIDの該当エントリのコストを計算する(ステップS304)。このタイミングでコスト値を計算することで、無効レコードへのアクセス回数に対応した最新のコスト値を取得することができる。   FIG. 7 is a flowchart illustrating an example of invalid record entry processing. In the example of FIG. 7, the invalid record deletion unit 120 acquires the record ID of the invalid record accessed from the record management unit 110 (step S300), and the priority record stored in the storage unit 140 is the acquired record ID. It is determined whether or not it exists in the record list (priority deletion list) 140B (step S302). When the record ID exists in the priority deletion record list 140B, the cost calculation unit 122 calculates the cost of the corresponding entry of the record ID (step S304). By calculating the cost value at this timing, the latest cost value corresponding to the number of accesses to the invalid record can be acquired.

次に、無効レコード削除部120は、優先削除レコードリスト140Bの各レコードをコスト順(例えば、降順)に並び替える(ステップS306)。これにより、優先削除レコードリスト140Bの各レコードは、例えば優先度順(降順)に整列される。   Next, the invalid record deletion unit 120 rearranges the records in the priority deletion record list 140B in order of cost (eg, descending order) (step S306). Thereby, the records of the priority deletion record list 140B are arranged in order of priority (descending order), for example.

また、取得したレコードIDを持つエントリが優先削除レコードリスト140Bに存在しない場合、有効期限付きレコードリスト140Aから、取得したレコードIDを持つエントリを削除し(ステップS308、図5に示す(5))、優先削除レコードリスト140Bに該当れレコードIDを持つエントリを作成する(ステップS310、図5に示す(6))。ステップS308およびステップS310の処理により、無効レコードのレコードID等の情報を有効期限付きレコードリスト140Aから優先削除レコードリスト140Bに移動させることができる。   If the entry having the acquired record ID does not exist in the priority deletion record list 140B, the entry having the acquired record ID is deleted from the record list with expiration date 140A (step S308, (5) shown in FIG. 5). Then, an entry having a record ID corresponding to the priority deletion record list 140B is created (step S310, (6) shown in FIG. 5). Through the processing in step S308 and step S310, information such as the record ID of the invalid record can be moved from the record list with expiration date 140A to the priority deletion record list 140B.

ここで、上述した優先削除レコードリスト140Bの一例について、図を用いて説明する。図8は、優先削除レコードリスト140Bの一例を示す図である。優先削除レコードリスト140Bの項目(エントリ構成)としては、例えば「レコードID」、「無効アクセス回数」、「TTL値」、「コスト値」等がある。レコードIDおよびTTL値は、いずれも有効期限付きレコードリスト140Aから取得される情報である。また、無効アクセス回数は、有効期限を徒過した後(現在時刻がTTL値を超えた後)に、クライアント300等から、そのレコードにアクセスのあった回数である。   Here, an example of the above-described priority deletion record list 140B will be described with reference to the drawings. FIG. 8 is a diagram illustrating an example of the priority deletion record list 140B. Examples of items (entry configuration) in the priority deletion record list 140B include “record ID”, “invalid access count”, “TTL value”, “cost value”, and the like. The record ID and the TTL value are both information acquired from the record list with expiration date 140A. The invalid access count is the number of times that the record is accessed from the client 300 or the like after the expiration date has passed (after the current time exceeds the TTL value).

例えば、無効レコード削除部120は、期限徒過判定部114から無効アクセスのあったレコードIDの通知があった場合に、そのレコードIDに基づいて優先削除レコードリスト140Bを参照し、抽出されたレコードの無効アクセス回数の値に1を増加する。また、無効レコード削除部120は、そのレコードIDが優先削除レコードリスト140Bに存在しなかった場合、有効期限付きレコードリスト140Aから該当レコードを抽出し、優先削除レコードリスト140Bにエントリする。この場合、無効アクセス回数には、1が設定される。コスト計算部122は、このように更新された優先削除レコードリスト140Bを用いて、優先削除レコードリスト140Bにエントリされたレコードごとに、所定の計算手法でコスト値を計算し、計算結果を優先削除レコードリスト140Bの「コスト値」に格納する。これにより、最新の情報でコスト値を計算することができる。なお、コスト計算部122におけるコスト値の計算手法の具体例については、後述する。   For example, when the invalid record deletion unit 120 is notified of the record ID that has been invalid accessed from the expiration date determination unit 114, the invalid record deletion unit 120 refers to the priority deletion record list 140B based on the record ID and extracts the extracted record 1 is added to the value of the number of invalid accesses. Further, when the record ID does not exist in the priority deletion record list 140B, the invalid record deletion unit 120 extracts the corresponding record from the record list with expiration date 140A and enters the priority deletion record list 140B. In this case, 1 is set as the invalid access count. The cost calculation unit 122 uses the priority deletion record list 140B updated in this way to calculate a cost value for each record entered in the priority deletion record list 140B by a predetermined calculation method, and preferentially deletes the calculation result. Stored in the “cost value” of the record list 140B. Thereby, the cost value can be calculated with the latest information. A specific example of the cost value calculation method in the cost calculation unit 122 will be described later.

なお、上述した有効期限付きレコードリスト140Aと、優先削除レコードリスト140Bとは、別リストとして示しているが、一体に構成されていてもよい。また、上述した有効期限付きレコードリスト140Aおよび優先削除レコードリスト140Bは、上述したデータ構造を規定するものではない。例えば、上述した各リストの実現のために、例えば配列、キュー、ヒープ、二分木等を用いたデータ構造でもよい。   Note that the record list with expiration date 140A and the priority deletion record list 140B described above are shown as separate lists, but may be configured integrally. Moreover, the record list with expiration date 140A and the priority deletion record list 140B described above do not define the data structure described above. For example, a data structure using, for example, an array, a queue, a heap, a binary tree, or the like may be used to realize each list described above.

次に、優先削除実行時の動作例について、図を用いて説明する。図9は、データベース管理装置100における優先削除動作の一例を説明するための図である。また、図10は、データベース管理装置100における優先削除処理の一例を示すフローチャートである。なお、優先削除処理は、例えば、所定の周期、無効レコードへのアクセス回数が所定数以上となった場合、データベース管理装置100のユーザ(管理者)が指示したタイミングで実行される。   Next, an example of operation when executing priority deletion will be described with reference to the drawings. FIG. 9 is a diagram for explaining an example of the priority deletion operation in the database management apparatus 100. FIG. 10 is a flowchart showing an example of priority deletion processing in the database management apparatus 100. For example, when the number of accesses to invalid records exceeds a predetermined number in a predetermined cycle, the priority deletion process is executed at a timing instructed by the user (administrator) of the database management apparatus 100.

図10の例において、無効レコード削除部120は、優先削除レコードリスト140Bにエントリがあるか否かを判定する(ステップS400)。優先削除レコードリスト140Bにエントリがある場合、削除実行部124は、優先削除レコードリスト140Bの先頭のレコードIDを取得する(ステップS402、図9に示す(1))。ここで、先頭のレコードIDとは、上述したステップS306の処理で、優先削除レコードリスト140Bの各レコードIDをコスト値に基づき降順に並び替えている場合、各レコードIDのうち、最も優先度の高いレコードIDである。次に、削除実行部124は、レコードIDに対応するレコードを記憶装置200のキャッシュ領域210から抽出し、抽出されたレコードを削除し(ステップS404、図9に示す(2))、優先削除レコードリスト140Bのエントリを削除する(ステップS406、図9に示す(3))。なお、レコードを削除する場合に、削除実行部124は、キャッシュ領域210に存在するレコードIDに対応するレコードを削除してもよく、データ記憶領域220に記憶されたレコードIDに対応するレコードを削除してもよい。   In the example of FIG. 10, the invalid record deletion unit 120 determines whether there is an entry in the priority deletion record list 140B (step S400). If there is an entry in the priority deletion record list 140B, the deletion execution unit 124 acquires the first record ID of the priority deletion record list 140B (step S402, (1) shown in FIG. 9). Here, the top record ID is the highest priority among the record IDs when the record IDs of the priority deletion record list 140B are rearranged in descending order based on the cost value in the process of step S306 described above. High record ID. Next, the deletion execution unit 124 extracts the record corresponding to the record ID from the cache area 210 of the storage device 200, deletes the extracted record (step S404, (2) shown in FIG. 9), and the priority deletion record The entry in the list 140B is deleted (step S406, (3) shown in FIG. 9). When deleting a record, the deletion execution unit 124 may delete the record corresponding to the record ID existing in the cache area 210, or delete the record corresponding to the record ID stored in the data storage area 220. May be.

次に、削除実行部124は、最大削除数に達したか否かを判定する(ステップS408)。最大削除数とは、1回のレコード削除処理において、削除が可能な無効レコードの最大数である。最大削除数を設定しておくことで、無効レコードの削除処理に要する時間または負荷を管理することができる。最大削除数に達していない場合、削除実行部124は、ステップS400の処理に戻る。また、最大削除数に達した場合、または、優先削除レコードリスト140Bにエントリがない場合、本フローチャートを終了する。   Next, the deletion execution unit 124 determines whether the maximum number of deletions has been reached (step S408). The maximum number of deletions is the maximum number of invalid records that can be deleted in one record deletion process. By setting the maximum number of deletions, it is possible to manage the time or load required to delete invalid records. If the maximum number of deletions has not been reached, the deletion execution unit 124 returns to the process of step S400. If the maximum number of deletions has been reached, or if there is no entry in the priority deletion record list 140B, this flowchart is terminated.

次に、データベース管理装置100における定周期削除動作について、図を用いて説明する。図11は、データベース管理装置100における定周期削除動作の一例を示す図である。また、図12は、データベース管理装置100における定周期削除処理の一例を示すフローチャートである。定周期削除処理は、例えば上述した優先削除処理において削除しきれなかった無効レコードを削除するための処理であり、例えば優先削除処理が実行される周期やタイミングよりも長い周期で定期的に実行される。   Next, the fixed period deletion operation in the database management apparatus 100 will be described with reference to the drawings. FIG. 11 is a diagram illustrating an example of a fixed period deletion operation in the database management apparatus 100. FIG. 12 is a flowchart illustrating an example of a fixed period deletion process in the database management apparatus 100. The periodic deletion process is a process for deleting invalid records that could not be deleted in the above-described priority deletion process, for example, and is periodically executed at a period longer than the period or timing at which the priority deletion process is executed. The

図12の例において、無効レコード削除部120は、優先削除レコードリスト140Bにエントリがあるか否かを判定する(ステップS500)。優先削除レコードリスト140Bにエントリがある場合、削除実行部124は、優先削除レコードリスト140Bの先頭のエントリを取得する(ステップS502)。   In the example of FIG. 12, the invalid record deletion unit 120 determines whether there is an entry in the priority deletion record list 140B (step S500). If there is an entry in the priority deletion record list 140B, the deletion execution unit 124 acquires the first entry in the priority deletion record list 140B (step S502).

また、優先削除レコードリスト140Bにエントリがない場合、無効レコード削除部120は、有効期限付きレコードリスト140Aにエントリがあるか否かを判定する(ステップS504)。有効期限付きレコードリスト140Aにエントリがある場合、削除実行部124は、有効期限付きレコードリスト140Aの中で、TTL値が最小のエントリを取得する(ステップS506)。   If there is no entry in the priority deletion record list 140B, the invalid record deletion unit 120 determines whether there is an entry in the record list with expiration date 140A (step S504). When there is an entry in the record list with expiration date 140A, the deletion execution unit 124 acquires the entry with the smallest TTL value in the record list with expiration date 140A (step S506).

次に、削除実行部124は、エントリ内のレコードのTTL値と、現在時刻とを比較し、エントリ内のレコードがすでに無効か否かを判定する(ステップS508)。なお、ステップS508の処理では、例えば現在時刻がTTL値を超えている場合に、そのレコードが無効であると判定することができる。エントリ内のレコードがすでに無効である場合、またステップS502の処理後、取得したレコードIDに対応するレコードを削除し(ステップS510)、優先削除レコードリスト140Bのエントリを削除する(ステップS512)。   Next, the deletion execution unit 124 compares the TTL value of the record in the entry with the current time, and determines whether or not the record in the entry is already invalid (step S508). In the process of step S508, for example, when the current time exceeds the TTL value, it can be determined that the record is invalid. If the record in the entry is already invalid, or after the processing in step S502, the record corresponding to the acquired record ID is deleted (step S510), and the entry in the priority deletion record list 140B is deleted (step S512).

次に、無効レコード削除部120は、最大削除数に達したか否かを判定する(ステップS514)。最大削除数に達している場合、無効レコード削除部120は、有効期限付きレコードリスト140Aにある削除されていないレコードID等を優先削除レコードリスト140Bに移動(エントリ)し(ステップS516)、本フローチャートの処理を終了する。なお、削除されていないレコードID等がすでに優先削除レコードリスト140Bにある場合には、ステップS516の処理を行わなくてもよい。   Next, the invalid record deletion unit 120 determines whether the maximum number of deletions has been reached (step S514). When the maximum number of deletions has been reached, the invalid record deletion unit 120 moves (entries) an undeleted record ID or the like in the record list with expiration date 140A to the priority deletion record list 140B (step S516), and this flowchart Terminate the process. If a record ID or the like that has not been deleted is already in the priority deletion record list 140B, the process of step S516 may not be performed.

また、エントリ内のレコードが無効でない場合、または、最大削除数に達していない場合、無効レコード削除部120は、全てのエントリに対して削除判定を行ったか否かを判定する(ステップS518)。全てのエントリに対して削除判定を行った場合、本フローチャートの処理を終了する。また、全てのエントリに対して削除判定を行っていない場合、ステップS500の処理に戻り、他のエントリに対する処理を行う。   If the record in the entry is not invalid or if the maximum number of deletions has not been reached, the invalid record deletion unit 120 determines whether deletion determination has been performed for all entries (step S518). When deletion determination is performed for all entries, the processing of this flowchart is terminated. If deletion determination has not been performed for all entries, the process returns to step S500 to perform processing for other entries.

次に、コスト計算部122におけるコスト計算の具体例について説明する。
(第1の実施例)
コスト計算の第1の実施例では、評価の対象となる無効レコードの無効アクセス回数と、TTL値からの経過時間とに基づいて、コスト値を計算する。第1の実施例では、上述した図8に示す優先削除レコードリスト140Bを用いる。
Next, a specific example of cost calculation in the cost calculation unit 122 will be described.
(First embodiment)
In the first embodiment of cost calculation, the cost value is calculated based on the invalid access count of the invalid record to be evaluated and the elapsed time from the TTL value. In the first embodiment, the above-described priority deletion record list 140B shown in FIG. 8 is used.

例えば、第1の実施例として、100件の有効レコード、10000件の無効レコードがある状況からスタートし、データベース管理装置100は、毎秒100件の無効レコードを削除する処理を想定する。また、クライアント300は、10秒後、最近の1000件のレコードを2回スキャンする。なお、2回のスキャンの間は10秒間の間隔を空けるものとする。   For example, as a first embodiment, the database management apparatus 100 is assumed to start from a situation where there are 100 valid records and 10000 invalid records, and the database management apparatus 100 assumes a process of deleting 100 invalid records per second. Further, the client 300 scans the latest 1000 records twice after 10 seconds. It is assumed that an interval of 10 seconds is provided between the two scans.

また、計算の便宜上、10秒間で有効レコードの有効期限は切れないものとする。また、1件のレコードアクセスは200μsとし、1件のレコード存在確認には100μs、1件のレコード削除には1msの時間がかかるものとする。   For convenience of calculation, it is assumed that the valid record does not expire in 10 seconds. In addition, it is assumed that one record access is 200 μs, one record existence confirmation is 100 μs, and one record deletion takes 1 ms.

上述の条件において、コスト計算部122は、例えば「コスト値=レコードの無効アクセス回数×100−(現在時刻−レコードのTTL値)」としてコスト値を計算する。例えば、無効アクセスが1回あった場合、10秒前に有効期限切れになったレコードのコスト値は、1×100−10=90となる。なお、コスト値には、経過時間について負の相関、無効アクセス回数について正の相関を持たせてもよい。また、第1の実施例では、コスト値が大きいほど、削除する優先度が高くなるが、これに限定されるものではなく、例えばコスト値が小さいほど、優先度が高くなるようなコストの評価を行ってもよい。   Under the above conditions, the cost calculation unit 122 calculates the cost value as, for example, “cost value = number of invalid access times of record × 100− (current time−TTL value of record)”. For example, if there is one invalid access, the cost value of a record that has expired 10 seconds ago is 1 × 100−10 = 90. The cost value may have a negative correlation with respect to elapsed time and a positive correlation with respect to the number of invalid accesses. Further, in the first embodiment, the priority for deletion increases as the cost value increases. However, the priority is not limited to this. For example, the cost evaluation is such that the priority increases as the cost value decreases. May be performed.

また、無効アクセスが発生した最近有効期限切れになったレコードは、またアクセスされる可能性が高いため、できる限り即座に削除することが好ましい。したがって、第1の実施例では、同じ無効アクセス回数のレコードがあった場合に、経過時間が少ないものほど優先度が高くなる計算式となっている。また、第1の実施例では、無効アクセス回数がコスト値を大きく引き上げるように計算式を定めている。なお、無効アクセスが0回の場合、対象レコードは、有効期限付きレコードリスト140Aから優先削除レコードリスト140Bに移動されないため、コスト値が設定されない。   Further, since a record that has expired recently and has been invalidated is likely to be accessed again, it is preferable to delete it as soon as possible. Therefore, in the first embodiment, when there are records having the same number of invalid accesses, the calculation formula is such that the priority becomes higher as the elapsed time is shorter. In the first embodiment, the calculation formula is determined so that the number of invalid accesses greatly increases the cost value. If the invalid access is 0 times, the target record is not moved from the record list with expiration date 140A to the priority deletion record list 140B, and thus no cost value is set.

上述したように、第1の実施例によれば、削除実行部124は、優先削除レコードリスト140Bにある無効アクセス回数の多い無効レコードを優先して削除しておくことで無効レコードへのアクセスや削除処理等の処理負荷を抑制することができる。なお、第1の実施例のコスト計算に基づく優先削除処理において、1回に削除可能なレコードの数(最大削除数)を超え、削除されない無効レコードが残った場合でも、上述した定周期削除処理により、残りのレコードを削除することができる。   As described above, according to the first embodiment, the deletion executing unit 124 preferentially deletes invalid records with a large number of invalid accesses in the priority deletion record list 140B to access invalid records. Processing load such as deletion processing can be suppressed. In the priority deletion process based on the cost calculation of the first embodiment, even if the number of records that can be deleted at one time (maximum number of deletions) exceeds the number of records that cannot be deleted, the above-described periodic deletion process The remaining records can be deleted.

(第2の実施例)
次に、コスト計算部122におけるコスト計算手法の第2の実施例について説明する。第2の実施例において、コスト計算部122は、評価の対象となる無効レコードの容量(レコードサイズ)に基づいて、コスト計算を行う。レコードサイズは、例えば無効レコードアクセス時にレコード管理部110により通知される。第2の実施例によれば、レコードサイズの大きい無効レコードを先に削除することで、効率的に記憶装置200の空き容量を増やすことができる。
(Second embodiment)
Next, a second embodiment of the cost calculation method in the cost calculation unit 122 will be described. In the second embodiment, the cost calculation unit 122 performs cost calculation based on the capacity (record size) of an invalid record to be evaluated. The record size is notified by the record management unit 110 when, for example, an invalid record is accessed. According to the second embodiment, it is possible to efficiently increase the free capacity of the storage device 200 by deleting the invalid record having the large record size first.

第2の実施例において、コスト計算部122は、例えば「コスト値=レコードの大きさ(KB単位)−(現在時刻−レコードのTTL値)/2」としてコスト値を計算する。また、上述したコスト値の計算結果から、コスト値が大きいレコードほど、削除する優先度が高くなる。この計算式によれば、例えば10秒前に有効期限切れになった10KBの大きさのレコードのコスト値が5、10秒前に有効期限切れになった100KBの大きさのレコードのコスト値が95、および100秒前に有効期限切れになった100KBの大きさのレコードのコスト値が50と計算できる。   In the second embodiment, the cost calculation unit 122 calculates the cost value as, for example, “cost value = record size (KB unit) − (current time−record TTL value) / 2”. Further, from the calculation result of the cost value described above, the higher the cost value, the higher the priority for deletion. According to this calculation formula, for example, the cost value of a record having a size of 10 KB expired 10 seconds ago is 5 and the cost value of a record of 100 KB size expired 10 seconds ago is 95. And the cost value of a record of 100 KB size expired 100 seconds ago can be calculated as 50.

また、第2の実施例においてコスト値等を計算する場合には、「無効アクセス回数」は、優先削除レコードリスト140Bに格納しなくてもよい。ここで、図13は、第2の実施例における優先削除レコードリスト140Bの一例を示す図である。図13に示すように、第2の実施例における優先削除レコードリスト140Bの項目(エントリ構成)としては、例えば「レコードID」、「TTL値」、「コスト値」等がある。レコードIDは、削除する無効レコードのIDである。TTL値は、有効期限の判定のために用いられる。コスト値は、TTL値およびレコードサイズから計算したコストである。なお、第2の実施例において、優先削除レコードリスト140Bにレコードサイズを格納してもよく、またレコードサイズが固定値である場合には省略してもよい。   Further, when calculating the cost value or the like in the second embodiment, the “number of invalid accesses” may not be stored in the priority deletion record list 140B. Here, FIG. 13 is a diagram illustrating an example of the priority deletion record list 140B in the second embodiment. As shown in FIG. 13, the items (entry configuration) of the priority deletion record list 140B in the second embodiment include, for example, “record ID”, “TTL value”, “cost value”, and the like. The record ID is an ID of an invalid record to be deleted. The TTL value is used for determining the expiration date. The cost value is a cost calculated from the TTL value and the record size. In the second embodiment, the record size may be stored in the priority deletion record list 140B, and may be omitted when the record size is a fixed value.

上述したように、第2の実施例によれば、削除実行部124は、新しく有効期限切れになったものを優先して削除するとともに、その中でもレコードサイズが大きい無効レコードを優先的に削除することができる。なお、レコードサイズの小さいレコードは、優先度が低くなるため、優先削除レコードリスト140B内に残る可能性があるが、上述した定周期削除処理で削除される。   As described above, according to the second embodiment, the deletion execution unit 124 preferentially deletes a newly expired one and deletes an invalid record having a large record size among them. Can do. A record having a small record size has a low priority and may remain in the priority deletion record list 140B. However, the record is deleted by the above-described periodic deletion process.

(第3の実施例)
次に、コスト計算部122におけるコスト計算手法の第3の実施例について説明する。第3の実施例では、評価の対象となるレコードの所属する所定領域(例えば、ブロック)の空き容量(例えば、残りレコード数等の使用容量でもよい)等を用いてコスト値を計算する。例えば、記憶装置200におけるデータベースは、I/O効率を高めるために、複数のレコードをまとめてブロック単位で管理していることが多い場合がある。また、同じブロックには同じようなTTL値を有するレコードが集まりやすい場合がある。したがって、第3の実施例では、レコードが所属するブロックの情報を基準にコスト値を計算することで、例えばブロック内のレコードが全て無効レコードになった場合に、そのレコードを優先的に削除して、そのブロックを早期に空にすることができ、そのブロックを再利用することができる。
(Third embodiment)
Next, a third embodiment of the cost calculation method in the cost calculation unit 122 will be described. In the third embodiment, the cost value is calculated using the free capacity (for example, the used capacity such as the number of remaining records) of a predetermined area (for example, block) to which the record to be evaluated belongs. For example, in many cases, a database in the storage device 200 often manages a plurality of records in units of blocks in order to increase I / O efficiency. Also, there are cases where records having similar TTL values are likely to gather in the same block. Therefore, in the third embodiment, by calculating the cost value based on the information of the block to which the record belongs, for example, when all the records in the block become invalid records, the record is preferentially deleted. Thus, the block can be emptied early and the block can be reused.

第3の実施例において、コスト計算部122は、例えば「コスト値=レコードが所属するブロックにおける残りのレコード数」としてコスト値を計算する。所属するブロックの残りのレコード数は、例えば無効レコードアクセス時にレコード管理部110により通知される。また、レコードを削除する優先度とコスト値との関係は、「優先度=1/コスト値」となる。つまり、コスト値が大きくなるほど、優先度は低くなる。例えば、ある有効期限切れになったレコードが所属するブロックに、他に10レコードがある場合、コスト値=10となり、優先度は、0.1となる。   In the third embodiment, the cost calculation unit 122 calculates the cost value as, for example, “cost value = the number of remaining records in the block to which the record belongs”. The record management unit 110 notifies the number of remaining records of the block to which the record belongs, for example, when an invalid record is accessed. The relationship between the priority for deleting records and the cost value is “priority = 1 / cost value”. That is, the higher the cost value, the lower the priority. For example, if there are 10 other records in a block to which a certain expired record belongs, the cost value = 10 and the priority is 0.1.

ここで、第3の実施例における優先削除レコードリスト140Bのエントリ構成は、上述した図13と同じ構成を用いることができる。なお、第3の実施例の場合、「レコードID」および「TTL値」は、上述した第2の実施例と同様であるが、「コスト値」には、所属ブロックの残りレコード数から計算したコストが格納される。   Here, the entry structure of the priority deletion record list 140B in the third embodiment can use the same structure as that of FIG. In the case of the third embodiment, the “record ID” and the “TTL value” are the same as those in the second embodiment described above, but the “cost value” is calculated from the number of remaining records of the belonging block. The cost is stored.

上述したように、第3の実施例によれば、残りレコード数が少ないブロックに所属する無効レコードが優先的に削除される。したがって、従来手法よりブロックが空になるのが早くなるため、ブロック単位での再利用を効率的に行うことができる。   As described above, according to the third embodiment, invalid records belonging to blocks with a small number of remaining records are preferentially deleted. Accordingly, since the block is emptied faster than in the conventional method, the reuse in units of blocks can be performed efficiently.

(第4の実施例)
次に、コスト計算部122におけるコスト計算手法の第4の実施例について説明する。第4の実施例では、評価の対象となるレコードが所属する記憶装置200の種類に応じてコストを設定する。例えば、データベース管理装置100が、記憶装置200に記憶されるレコードを複数のストレージに分割して保持している場合、より高速な記憶装置200をなるべく空けておきたい場合がある。そのため、第4の実施例では、例えばHDDとSSD(Solid State Drive)とを備える記憶装置200において、SSDに記憶されたレコードが、HDDに記憶されたレコードよりも優先して削除されるようにする。この場合、コスト計算部122は、例えば「コスト値=レコードの大きさ(KB)×ストレージ係数」としてコストを計算する。ここで、ストレージ係数とは、レコードが記憶された記憶装置(ストレージ)200の種類に基づいて設定される値であり、例えばHDDである場合にストレージ係数を1とし、SSDであるの場合にストレージ係数を10とする。無効レコードが記憶された記憶装置200の種類は、その無効レコードがアクセスされた時に、レコード管理部110により通知される。例えば、100KBのレコードがHDDにある場合、コスト値=100×1=100となり、100KBのレコードがSSDにある場合、コスト値=100×10=1000となる。第4の実施例の場合、コスト値が大きいほど、優先度は高くなる。
(Fourth embodiment)
Next, a fourth embodiment of the cost calculation method in the cost calculation unit 122 will be described. In the fourth embodiment, the cost is set according to the type of the storage device 200 to which the record to be evaluated belongs. For example, when the database management apparatus 100 divides and holds records stored in the storage device 200 into a plurality of storages, there is a case where a higher-speed storage device 200 is desired to be freed as much as possible. Therefore, in the fourth embodiment, for example, in a storage device 200 including an HDD and an SSD (Solid State Drive), a record stored in the SSD is deleted with priority over a record stored in the HDD. To do. In this case, the cost calculation unit 122 calculates the cost as, for example, “cost value = record size (KB) × storage coefficient”. Here, the storage coefficient is a value that is set based on the type of the storage device (storage) 200 in which the record is stored. For example, the storage coefficient is 1 for an HDD and the storage coefficient is an SSD. The coefficient is 10. The type of the storage device 200 in which the invalid record is stored is notified by the record management unit 110 when the invalid record is accessed. For example, if a 100 KB record is in the HDD, the cost value = 100 × 1 = 100, and if a 100 KB record is in the SSD, the cost value = 100 × 10 = 1000. In the case of the fourth embodiment, the higher the cost value, the higher the priority.

ここで、図14は、第4の実施例における優先削除レコードリスト140Bの一例を示す図である。図14に示すように、第4の実施例における優先削除レコードリスト140Bの項目(エントリ構成)としては、「レコードID」および「コスト値」等がある。レコードIDは、削除するレコードのIDである。TTL値は、有効期限の判定のために用いられる。コスト値は、レコードの大きさおよびストレージ係数から計算したコストである。第4の実施例において、優先削除レコードリスト140Bのエントリ構成は、無効レコードの所属ストレージが変わることは想定しにくい。そのため、コスト計算部122は、コスト計算を一度行えばよい。   Here, FIG. 14 is a diagram showing an example of the priority deletion record list 140B in the fourth embodiment. As shown in FIG. 14, the items (entry structure) of the priority deletion record list 140B in the fourth embodiment include “record ID” and “cost value”. The record ID is the ID of the record to be deleted. The TTL value is used for determining the expiration date. The cost value is a cost calculated from the size of the record and the storage coefficient. In the fourth embodiment, the entry structure of the priority deletion record list 140B is unlikely to change the storage belonging to the invalid record. Therefore, the cost calculation unit 122 may perform cost calculation once.

上述したように、第4の実施例によれば、より高速なストレージにある無効レコードを優先的に削除することができる。これにより、高速ストレージの領域を早期に再利用することができる。   As described above, according to the fourth embodiment, it is possible to preferentially delete invalid records in faster storage. Thereby, the high-speed storage area can be reused at an early stage.

(第5の実施例)
次に、コスト計算部122におけるコスト計算手法の第5の実施例について説明する。第5の実施例では、例えば記憶装置200に記憶される各レコードが複数のSSD等に分割して保持されている場合に、劣化しているSSDに対する無効レコードの削除処理を減らして、なるべく上書き処理を行うようにする。無効レコードは、上述した削除処理により記憶領域から削除するだけでなく、そのレコードを他のレコードで上書きすることで削除してもよい。
(Fifth embodiment)
Next, a fifth embodiment of the cost calculation method in the cost calculation unit 122 will be described. In the fifth embodiment, for example, when each record stored in the storage device 200 is divided and held in a plurality of SSDs or the like, the deletion process of invalid records for a degraded SSD is reduced and overwritten as much as possible. Do processing. The invalid record may be deleted not only by deleting from the storage area by the above-described deletion process but also by overwriting the record with another record.

第5の実施例において、コスト計算部122は、例えば「コスト値=レコードの所属するストレージの劣化係数(劣化度合)」としてコスト値を計算する。また、レコードを削除する優先度とコスト値との関係は、逆相関の関係となる。つまり、第5の実施例では、コスト値が大きいほど、優先度は低くなる。   In the fifth embodiment, the cost calculation unit 122 calculates the cost value as, for example, “cost value = deterioration coefficient (degradation degree) of the storage to which the record belongs”. Further, the relationship between the priority for deleting records and the cost value is an inverse correlation. That is, in the fifth embodiment, the higher the cost value, the lower the priority.

なお、上述した劣化係数は、例えばS.M.A.R.T.(Self-Monitoring, Analysis and Reporting Technology)情報より取得することができる。S.M.A.R.T.情報とは、記憶装置200の内部で管理することができるモニタリング情報等である。S.M.A.R.T.情報は、データベース管理装置100で管理されていてもよく、記憶装置200で管理されていてもよい。S.M.A.R.T.情報としては、例えば、使用済み予備ブロック数、不良ブロック数、および消去失敗回数等がある。これらの情報が得られた場合、コスト計算部122は、例えば「劣化係数=使用済み予備ブロック数+不良ブロック数+消去失敗回数」として劣化係数を計算する。なお、計算手法については、これに限定されるものではない。例えば、第5の実施例において、使用済み予備ブロック数を10とし、不良ブロック数を100とし、消去失敗回数を0とした場合のSSDに所属するレコードのコスト値は110となる。したがって、優先度は、−110となる。   The above-described deterioration coefficient can be acquired from, for example, S.M.A.R.T. (Self-Monitoring, Analysis and Reporting Technology) information. The S.M.A.R.T. information is monitoring information that can be managed inside the storage device 200. The S.M.A.R.T. information may be managed by the database management device 100 or may be managed by the storage device 200. Examples of S.M.A.R.T. information include the number of used spare blocks, the number of defective blocks, and the number of erasure failures. When these pieces of information are obtained, the cost calculation unit 122 calculates the deterioration coefficient as, for example, “deterioration coefficient = number of used spare blocks + number of defective blocks + number of erasure failures”. Note that the calculation method is not limited to this. For example, in the fifth embodiment, the cost value of the record belonging to the SSD is 110 when the number of used spare blocks is 10, the number of defective blocks is 100, and the number of erasure failures is 0. Therefore, the priority is −110.

ここで、図15は、第5の実施例における優先削除レコードリスト140Bの一例を示す図である。図15に示すように、第5の実施例における優先削除レコードリスト140Bの項目(エントリ構成)としては、「レコードID」、「所属ストレージ」、「最終コスト更新時間」、「コスト値」等がある。レコードIDは、削除する無効レコードのIDである。所属ストレージは、所属する記憶装置(ストレージ)200のIDである。最終コスト更新時間は、最後にコスト値を更新した時刻である。この時刻は、S.M.A.R.T.情報の新しさを示すものである。また、コスト値は、ストレージの劣化係数から計算したコストである。   Here, FIG. 15 is a diagram illustrating an example of the priority deletion record list 140B in the fifth embodiment. As shown in FIG. 15, items (entry structure) of the priority deletion record list 140B in the fifth embodiment include “record ID”, “affiliation storage”, “final cost update time”, “cost value”, and the like. is there. The record ID is an ID of an invalid record to be deleted. The affiliated storage is an ID of the storage device (storage) 200 to which the affiliated storage belongs. The last cost update time is the time when the cost value was last updated. This time indicates the newness of the S.M.A.R.T. information. The cost value is a cost calculated from a storage degradation coefficient.

また、第5の実施例において、優先削除レコードリスト140Bのエントリ構成において、コスト値はS.M.A.R.T.情報を取得するごとに更新される可能性がある。そのため、コスト計算部122は、S.M.A.R.T.情報を取得した後に、無効レコードのアクセスがあった場合に、コスト値を再計算する。   In the fifth embodiment, in the entry structure of the priority deletion record list 140B, the cost value may be updated every time S.M.A.R.T. information is acquired. Therefore, the cost calculation unit 122 recalculates the cost value when an invalid record is accessed after acquiring the S.M.A.R.T. information.

上述したように、第5の実施例によれば、劣化したSSDの有効期限切れレコードの削除を抑制することができる。なお、コスト計算部122におけるコスト計算は、上述した第1〜第5の各実施例の一部または全部を組み合わせてもよい。   As described above, according to the fifth embodiment, it is possible to suppress the deletion of the expired record of the deteriorated SSD. The cost calculation in the cost calculation unit 122 may be a combination of some or all of the first to fifth embodiments described above.

次に、記憶装置200内の無効レコードの削除に関する処理結果の一例について、図を用いて説明する。図16は、無効レコード削除に関する処理結果の一例を示す図である。図16の例では、横軸に無効レコード削除のための記憶装置200のスキャン回数を示し、縦軸に上記スキャンの所要時間を示す。また、図16の例では、従来手法と本実施形態とにおける処理結果を比較している。従来手法としては、ガベージコレクションを用いてレコードを削除する手法(ガベージコレクション方式)と、インライン削除においてレコードを削除する手法(インライン削除方式)を用いる。ガベージコレクション方式は、定期的(例えば、1日に1回)の周期で記憶装置200内の全レコードをスキャンし、TTL値が現在時刻を超えているレコードを削除する。また、インライン削除方式は、レコードアクセス時にそのレコードを削除する。   Next, an example of processing results related to deletion of invalid records in the storage device 200 will be described with reference to the drawings. FIG. 16 is a diagram illustrating an example of a processing result related to invalid record deletion. In the example of FIG. 16, the horizontal axis indicates the number of scans of the storage device 200 for deleting invalid records, and the vertical axis indicates the time required for the scan. In the example of FIG. 16, the processing results in the conventional method and this embodiment are compared. As a conventional method, a method of deleting records using garbage collection (garbage collection method) and a method of deleting records in inline deletion (inline deletion method) are used. In the garbage collection method, all records in the storage device 200 are scanned at a regular cycle (for example, once a day), and records whose TTL values exceed the current time are deleted. The inline deletion method deletes the record when accessing the record.

また、図16の例では、便宜的に、1件のレコードアクセスを200μsとし、1件のレコード存在確認時間を100μsとし、1件のレコード削除時間1msとする。また、クライアント300から送信されるレコードを記憶装置200内のテーブルで管理するものとする。また、テーブルには、毎秒100件のレコードを、TTL値を1日として登録するものとする。また、テーブルには、常に864万件の有効レコードがある状態とする。   In the example of FIG. 16, for convenience, one record access is set to 200 μs, one record existence confirmation time is set to 100 μs, and one record deletion time is set to 1 ms. Also, records transmitted from the client 300 are managed by a table in the storage device 200. In the table, 100 records per second are registered with a TTL value of 1 day. The table always has 8.64 million valid records.

図16に示す例では、(A)がガベージコレクション方式による処理結果を示し、(B)がインライン削除方式による処理結果を示し、(C)が本実施形態における処理結果を示している。図16に示すように、本実施形態は、従来手法と比較して、スキャンの所要時間を短縮することができ、無効レコードの削除処理における処理負荷を抑制することができる。   In the example shown in FIG. 16, (A) shows the processing result by the garbage collection method, (B) shows the processing result by the inline deletion method, and (C) shows the processing result in this embodiment. As shown in FIG. 16, this embodiment can shorten the time required for scanning compared to the conventional method, and can suppress the processing load in the invalid record deletion processing.

以上説明した少なくとも一つの実施形態によれば、複数のデータベース管理装置100と、複数のデータベース管理装置100により共有される記憶装置200とを備え、複数のデータベース管理装置100のそれぞれは、クライアントから登録要求のあったデータを記憶装置200に書き込むデータ管理部(レコード管理部110)と、データ管理部により、記憶装置200に書き込まれたデータに関連付けられる情報に基づいて、記憶装置200に記憶されたデータのうち、有効期限を徒過したデータを削除する削除部(無効レコード削除部120)と、を持つことにより、複数の分散化されたデータベース管理装置において、無効レコードに関連する処理負荷を抑制することができる。   According to at least one embodiment described above, a plurality of database management devices 100 and a storage device 200 shared by the plurality of database management devices 100 are provided, and each of the plurality of database management devices 100 is registered from a client. A data management unit (record management unit 110) that writes the requested data to the storage device 200 and a data management unit that stores the requested data in the storage device 200 based on information associated with the data written in the storage device 200. By having a deletion unit (invalid record deletion unit 120) that deletes data whose expiration date has passed among data, the processing load related to invalid records is suppressed in a plurality of distributed database management devices can do.

具体的には、少なくとも一つの実施形態によれば、例えば多数のクライアント300がデータベース管理装置100を用いて記憶装置200へデータの書き込みを行い、そのデータの分析を行うためのアクセス(読み出し)を行う場合であっても、無効レコードへのアクセスを低く抑えることができるため、無効レコードによるスループットやレイテンシの低下を抑制することができる。また、無効レコードを優先的に削除するため、記憶装置200内の全てのデータをスキャンする時間を減らすことができ、処理時間の短縮および処理の効率化を図ることができる。   Specifically, according to at least one embodiment, for example, a large number of clients 300 write data to the storage device 200 using the database management apparatus 100 and perform access (read) for analyzing the data. Even if it is performed, since access to invalid records can be kept low, it is possible to suppress a decrease in throughput and latency due to invalid records. In addition, since invalid records are deleted preferentially, the time for scanning all data in the storage device 200 can be reduced, and the processing time can be shortened and the processing efficiency can be improved.

なお、上述したデータベース管理システム1は、複数の分散化されたデータベース管理装置100を備えているが、単体のデータベース管理装置100で構成されていたとしても、上述した各種処理と同様の処理を行うことができる。   The database management system 1 described above includes a plurality of distributed database management apparatuses 100. Even if the database management system 1 is configured as a single database management apparatus 100, the same processes as the various processes described above are performed. be able to.

本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これら実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や要旨に含まれると同様に、特許請求の範囲に記載された発明とその均等の範囲に含まれるものである。   Although several embodiments of the present invention have been described, these embodiments are presented by way of example and are not intended to limit the scope of the invention. These embodiments can be implemented in various other forms, and various omissions, replacements, and changes can be made without departing from the spirit of the invention. These embodiments and their modifications are included in the scope and gist of the invention, and are also included in the invention described in the claims and the equivalents thereof.

1…データベース管理システム、100…データベース管理装置、110…レコード管理部(データ管理部)、112…レコード登録部、114…期限徒過判定部、120…無効レコード削除部(削除部)、122…コスト計算部(評価部)、124…削除実行部、130…通信部、140…記憶部、200…記憶装置、300…クライアント DESCRIPTION OF SYMBOLS 1 ... Database management system, 100 ... Database management apparatus, 110 ... Record management part (data management part), 112 ... Record registration part, 114 ... Deadline passing judgment part, 120 ... Invalid record deletion part (deletion part), 122 ... Cost calculation unit (evaluation unit), 124 ... deletion execution unit, 130 ... communication unit, 140 ... storage unit, 200 ... storage device, 300 ... client

Claims (9)

複数のデータベース管理装置と、
前記複数のデータベース管理装置により共有される記憶装置と、を備え、
前記複数のデータベース管理装置のそれぞれは、
クライアントから登録要求のあったデータを前記記憶装置に書き込むデータ管理部と、
前記データ管理部により前記記憶装置に書き込まれたデータの有効期限を認識可能な第1情報に基づいて、前記記憶装置に記憶されたデータのうち、有効期限を徒過したデータを削除する削除部と、
を備え
前記削除部は、前記記憶装置により記憶されたデータの保持コストを評価するための第2情報に基づいて、前記データごとに保持コストを評価する評価部であって、前記第2情報に含まれる前記データの有効期限を徒過した後のアクセス回数が多いほど、前記保持コストを高くする評価部と、
前記評価部により前記保持コストが高いと評価されたデータを優先して、前記記憶装置から削除する削除実行部と、を更に備える、
データベース管理装置。
A plurality of database management devices;
A storage device shared by the plurality of database management devices,
Each of the plurality of database management devices includes:
A data management unit that writes data requested by a client to the storage device;
A deletion unit that deletes data that has passed the expiration date from the data stored in the storage device based on the first information that can recognize the expiration date of the data written to the storage device by the data management unit When,
Equipped with a,
The deletion unit is an evaluation unit that evaluates a retention cost for each piece of data based on second information for evaluating a retention cost of data stored in the storage device, and is included in the second information. The more the number of accesses after passing the expiration date of the data, the higher the evaluation unit that increases the retention cost,
A deletion execution unit that preferentially deletes the data evaluated by the evaluation unit as having a high retention cost and deletes the data from the storage device;
Database management device.
前記第2情報は、前記データのサイズを含み、
前記評価部は、前記データのサイズが大きいほど、前記保持コストを高くする、
請求項に記載のデータベース管理装置。
The second information includes a size of the data,
The evaluation unit increases the retention cost as the size of the data increases.
The database management device according to claim 1 .
前記第2情報は、前記保持コストの評価の対象となるデータが格納された所定領域における空き領域を含み、
前記評価部は、前記空き領域が多いほど、前記保持コストを低くする、
請求項1または2に記載のデータベース管理装置。
The second information includes a free area in a predetermined area in which data to be evaluated for the holding cost is stored,
The evaluation unit lowers the holding cost as the free space increases.
The database management apparatus according to claim 1 or 2 .
前記第2情報は、前記データの登録先の記憶装置の種類に基づいて決定される係数を含み、
前記評価部は、前記係数が高い記憶装置に登録されるデータほど、前記保持コストを高くする、
請求項1から3のうち、いずれか1項に記載のデータベース管理装置。
The second information includes a coefficient determined based on the type of storage device to which the data is registered,
The evaluation unit increases the retention cost for data registered in a storage device having a high coefficient,
The database management device according to any one of claims 1 to 3 .
前記第2情報は、前記データの登録先の記憶装置ごとに決定される劣化度合を含み、
前記評価部は、前記劣化度合が高い記憶装置に登録されるデータほど、前記保持コストを低くする、
請求項1から4のうち、いずれか1項に記載のデータベース管理装置。
The second information includes a degree of deterioration determined for each storage device to which the data is registered,
The evaluation unit lowers the retention cost for data registered in a storage device having a high degree of deterioration.
The database management device according to any one of claims 1 to 4 .
前記削除部は、前記評価部により得られる保持コストに対応した優先度順に、削除するデータが整列された優先削除リストを生成し、生成した優先削除リストに基づいて、前記データを削除する、
請求項1から5のうち、いずれか1項に記載のデータベース管理装置。
The deletion unit generates a priority deletion list in which data to be deleted are arranged in order of priority corresponding to the holding cost obtained by the evaluation unit, and deletes the data based on the generated priority deletion list.
The database management device according to any one of claims 1 to 5 .
前記データ管理部は、前記記憶装置にデータを記憶する場合に、有効期限が設定されたデータを有効期限付きリストに登録し、
前記評価部は、前記有効期限付きリストに登録されたデータごとに前記保持コストを評価し、評価したデータを評価結果とともに、前記優先削除リストに移動する、
請求項に記載のデータベース管理装置。
The data management unit, when storing data in the storage device, registers data with an expiration date registered in a list with an expiration date,
The evaluation unit evaluates the retention cost for each data registered in the list with an expiration date, and moves the evaluated data together with the evaluation result to the priority deletion list.
The database management apparatus according to claim 6 .
複数のデータベース管理装置と、前記複数のデータベース管理装置により共有される記憶装置と、を備えたデータベース管理システムにおける前記複数のデータベース管理装置のそれぞれのコンピュータが、
クライアントから登録要求のあったデータを前記記憶装置に書き込み、
前記記憶装置に書き込まれたデータの有効期限を認識可能な第1情報に基づいて、前記記憶装置に記憶されたデータのうち、有効期限を徒過したデータを削除し、
更に前記記憶装置により記憶されたデータの保持コストを評価するための第2情報に基づいて、前記データごとに保持コストを評価し、前記第2情報に含まれる前記データの有効期限を徒過した後のアクセス回数が多いほど、前記保持コストを高くし、
前記保持コストが高いと評価されたデータを優先して、前記記憶装置から削除する、
データベース管理方法。
Each computer of the plurality of database management devices in a database management system comprising a plurality of database management devices and a storage device shared by the plurality of database management devices,
Write the data requested by the client to the storage device,
Based on the first information capable of recognizing the expiration date of the data written in the storage device, the data that has passed the expiration date is deleted from the data stored in the storage device ,
Further, based on the second information for evaluating the retention cost of the data stored in the storage device, the retention cost is evaluated for each data, and the expiration date of the data included in the second information is passed The higher the number of subsequent accesses, the higher the retention cost,
Giving priority to data evaluated as having a high retention cost, and deleting it from the storage device;
Database management method.
複数のデータベース管理装置と、前記複数のデータベース管理装置により共有される記憶装置と、を備えたデータベース管理システムにおける前記複数のデータベース管理装置のそれぞれのコンピュータに、
クライアントから登録要求のあったデータを前記記憶装置に書き込ませ、
前記記憶装置に書き込まれたデータの有効期限を認識可能な第1情報に基づいて、前記記憶装置に記憶されたデータのうち、有効期限を徒過したデータを削除させ、
更に前記記憶装置により記憶されたデータの保持コストを評価するための第2情報に基づいて、前記データごとに保持コストを評価し、前記第2情報に含まれる前記データの有効期限を徒過した後のアクセス回数が多いほど、前記保持コストを高くさせ、
前記保持コストが高いと評価されたデータを優先して、前記記憶装置から削除させる、
データベース管理プログラム。
In each computer of the plurality of database management devices in a database management system comprising a plurality of database management devices and a storage device shared by the plurality of database management devices,
Write the data requested by the client to the storage device,
Based on the first information capable of recognizing the expiration date of the data written in the storage device, among the data stored in the storage device, delete the data that has passed the expiration date,
Further, based on the second information for evaluating the retention cost of the data stored in the storage device, the retention cost is evaluated for each data, and the expiration date of the data included in the second information is passed The later the number of accesses, the higher the retention cost,
Giving priority to data evaluated as having a high retention cost, and deleting it from the storage device;
Database management program.
JP2016126978A 2016-06-27 2016-06-27 Database management apparatus, database management method, and database management program Active JP6215401B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016126978A JP6215401B1 (en) 2016-06-27 2016-06-27 Database management apparatus, database management method, and database management program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016126978A JP6215401B1 (en) 2016-06-27 2016-06-27 Database management apparatus, database management method, and database management program

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2017152711A Division JP6325728B2 (en) 2017-08-07 2017-08-07 Database management apparatus, database management method, and database management program

Publications (2)

Publication Number Publication Date
JP6215401B1 true JP6215401B1 (en) 2017-10-18
JP2018005300A JP2018005300A (en) 2018-01-11

Family

ID=60107339

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016126978A Active JP6215401B1 (en) 2016-06-27 2016-06-27 Database management apparatus, database management method, and database management program

Country Status (1)

Country Link
JP (1) JP6215401B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110750522A (en) * 2018-07-23 2020-02-04 发那科株式会社 Data management device, data management program, and data management method

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2021061858A (en) * 2021-01-18 2021-04-22 株式会社東亜産業 cartridge

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11120138A (en) * 1997-10-13 1999-04-30 Meidensha Corp Data management system
JP2010049522A (en) * 2008-08-22 2010-03-04 Hitachi Ltd Computer system and method for managing logical volumes
JP2010267028A (en) * 2009-05-13 2010-11-25 Brother Ind Ltd Management device, management processing program, node device, node processing program, and expired record determination method
JP2012168815A (en) * 2011-02-15 2012-09-06 Fujitsu Ltd Management device, management program and management method
JP2013214201A (en) * 2012-04-02 2013-10-17 Nippon Telegr & Teleph Corp <Ntt> Garbage collection execution device, garbage collection execution method and garbage collection execution program
US20150113206A1 (en) * 2013-10-18 2015-04-23 Sandisk Enterprise Ip Llc Biasing for Wear Leveling in Storage Systems

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11120138A (en) * 1997-10-13 1999-04-30 Meidensha Corp Data management system
JP2010049522A (en) * 2008-08-22 2010-03-04 Hitachi Ltd Computer system and method for managing logical volumes
JP2010267028A (en) * 2009-05-13 2010-11-25 Brother Ind Ltd Management device, management processing program, node device, node processing program, and expired record determination method
JP2012168815A (en) * 2011-02-15 2012-09-06 Fujitsu Ltd Management device, management program and management method
JP2013214201A (en) * 2012-04-02 2013-10-17 Nippon Telegr & Teleph Corp <Ntt> Garbage collection execution device, garbage collection execution method and garbage collection execution program
US20150113206A1 (en) * 2013-10-18 2015-04-23 Sandisk Enterprise Ip Llc Biasing for Wear Leveling in Storage Systems

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110750522A (en) * 2018-07-23 2020-02-04 发那科株式会社 Data management device, data management program, and data management method
CN110750522B (en) * 2018-07-23 2023-08-08 发那科株式会社 Data management device, storage medium, and data management method

Also Published As

Publication number Publication date
JP2018005300A (en) 2018-01-11

Similar Documents

Publication Publication Date Title
US8996810B2 (en) System and method of detecting cache inconsistencies
US20120159099A1 (en) Distributed Storage System
CN108509501B (en) Query processing method, server and computer readable storage medium
CN107943718B (en) Method and device for cleaning cache file
CN106021445A (en) Cached data loading method and apparatus
JP6189488B1 (en) Database management apparatus, database management method, and database management program
US9665612B2 (en) Run-time decision of bulk insert for massive data loading
CN108563697B (en) Data processing method, device and storage medium
US20140351628A1 (en) Information processing device, control circuit, computer-readable recording medium for control program, and control method
JP6215401B1 (en) Database management apparatus, database management method, and database management program
US11347646B2 (en) Method, device and computer program product for managing cache based on matching API
CN110910249B (en) Data processing method and device, node equipment and storage medium
US11080239B2 (en) Key value store using generation markers
JP6325728B2 (en) Database management apparatus, database management method, and database management program
US9851925B2 (en) Data allocation control apparatus and data allocation control method
JP5956064B2 (en) Computer system, data management method, and computer
CN109189696B (en) SSD (solid State disk) caching system and caching method
CN116775646A (en) Database data management method, device, computer equipment and storage medium
CN110955682A (en) Method and device for deleting cache data, data cache and reading cache data
JP2018511131A (en) Hierarchical cost-based caching for online media
CN110968267B (en) Data management method, device, server and system
US11455556B2 (en) Framework for measuring telemetry data variability for confidence evaluation of a machine learning estimator
EP4365751A1 (en) Dynamic data retention policies for iot platforms
KR102613930B1 (en) Naval combat system integrated diagnosis platform system and method for managing operation data thereof
US20230385297A1 (en) Information management apparatus, information management method, and recording medium

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170807

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170920

R151 Written notification of patent or utility model registration

Ref document number: 6215401

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151