JPH0695936A - Method for managing buffer - Google Patents

Method for managing buffer

Info

Publication number
JPH0695936A
JPH0695936A JP4246097A JP24609792A JPH0695936A JP H0695936 A JPH0695936 A JP H0695936A JP 4246097 A JP4246097 A JP 4246097A JP 24609792 A JP24609792 A JP 24609792A JP H0695936 A JPH0695936 A JP H0695936A
Authority
JP
Japan
Prior art keywords
priority
buffer
transaction
data
execution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP4246097A
Other languages
Japanese (ja)
Inventor
Tetsuji Sato
哲司 佐藤
Ushio Inoue
潮 井上
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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone 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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP4246097A priority Critical patent/JPH0695936A/en
Publication of JPH0695936A publication Critical patent/JPH0695936A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To provide a priority-added buffer managing method for detecting a data access type inherent in each transaction previously or at the time of execution, determining the priority of buffer substitution and executing buffer allocation and substitution based upon the priority. CONSTITUTION:In the case of mixedly executing on-line transactions 1 for retrieving or updating an objective line in a table by means of an index and a batch transaction 2 for searching and retrieving or updating an objective line by sequentially reading out respective lines in the table and judging conditions, the buffer managing method is characterized by detecting an access characteristic inherent in any one of the transactions 1, 2 and determining priority for buffering based upon the detected access characteristic.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、ディスク装置等の2次
記憶装置に格納された関係データベースの表およびイン
デックス等を、高速かつ小容量の半導体メモリ等の1次
記憶装置にバッファリングして処理するデータ処理装置
におけるバッファ管理方法に関し、特に、トランザクシ
ョンのアクセス特性および該アクセス特性とトランザク
ションの実行優先度あるいは表やインデックス等のデー
タ属性の違いに基づいてバッファ管理の優先度を決定す
るようにした優先度付きバッファ管理方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention buffers tables and indexes of a relational database stored in a secondary storage device such as a disk device into a primary storage device such as a high speed and small capacity semiconductor memory. More specifically, the present invention relates to a buffer management method in a data processing device for processing, and in particular, to determine the priority of buffer management based on the access characteristics of a transaction and the execution priority of the transaction or the difference in data attributes such as tables and indexes. And a buffer management method with priority.

【0002】[0002]

【従来の技術】データベースは、金融システム,チケッ
ト予約システム,在庫管理システム,人事管理システム
等、多くのビジネスアプリケーションで利用され、大規
模なデータベースシステムが実現されている。これらの
システムの大部分は、オンライントランザクションが更
新したデータベースに対して、バッチトランザクション
が統計処理を行い、販売戦略を作成するような使用方法
になっている。ここで、一般に、オンライントランザク
ションは、インデックスを活用して表(テーブル)の特定
の行(タプル)を検索・更新するのに対して、バッチトラ
ンザクションは、表全体のフルスキャンやジョイン等を
必要とし、処理時間が長大化する傾向にある。このた
め、従来のデータベース管理システム(DBMS)では、
オンライントランザクションとバッチトランザクション
を走行させる時間帯を分ける使い方(例えば、昼間はオ
ンライン、夜間はバッチ)をしていた。金融システムを
例にとると、個々の個人口座の預金残高は、預金・引出
し操作に伴ってオンラインで更新されなければならない
し、支店毎の総預金残高の変動は、日単位で集計されな
ければならない。
2. Description of the Related Art Databases are used in many business applications such as financial systems, ticket reservation systems, inventory management systems, personnel management systems, etc., and large-scale database systems have been realized. Most of these systems are used in such a way that a batch transaction performs statistical processing on a database updated by an online transaction to create a sales strategy. Here, in general, an online transaction utilizes an index to search and update a specific row (tuple) of a table (batch table), whereas a batch transaction requires a full scan or join of the entire table. , The processing time tends to be lengthened. Therefore, in the conventional database management system (DBMS),
I used to use separate time zones for running online transactions and batch transactions (for example, online at daytime and batch at night). Taking the financial system as an example, the deposit balance of each individual account must be updated online with the deposit / withdrawal operation, and the fluctuation of the total deposit balance at each branch must be aggregated on a daily basis. I won't.

【0003】上述の前者はオンライントランザクション
の典型例、後者はバッチトランザクションの典型例であ
り、従来は、オンラインが終了した夜間に、バッチを処
理していた。しかし、24時間サービスを提供する大規模
なネットワーク管理や、世界規模での取引を行うシステ
ムでは、1日24時間サービスを停止できないため、上述
の如き時間帯を分けた使い方が困難となり、統計処理等
を行うバッチトランザクションを、オンライントランザ
クションと並行して実行することが要求される。上述の
データベース管理システムが処理の対象とする表および
該表から生成したインデックスは、極めて大量のデータ
の集合であり、かつ、高い信頼性をもって永続的に格納
する必要があることから、磁気ディスク装置等の2次記
憶装置に格納される。また、磁気ディスク装置はアクセ
ス速度が遅いことから、一般に、データベース処理装置
では、磁気ディスク装置等に格納されたデータベースの
一部を、高速アクセスが可能な半導体記憶装置等の1次
記憶装置にバッファリングして処理している。
The former is a typical example of online transaction, and the latter is a typical example of batch transaction. Conventionally, the batch was processed at night when the online was finished. However, in a large-scale network management system that provides 24-hour service and a system that conducts transactions on a global scale, it is not possible to stop the 24-hour service a day, making it difficult to use the above-mentioned time zones separately, and statistical processing It is required to execute a batch transaction for performing the above and the like in parallel with the online transaction. The table to be processed by the database management system and the index generated from the table are a collection of an extremely large amount of data, and must be stored permanently with high reliability. Etc. are stored in the secondary storage device. In addition, since a magnetic disk device has a low access speed, generally, in a database processing device, a part of the database stored in the magnetic disk device is buffered in a primary storage device such as a semiconductor storage device that can be accessed at high speed. Ring and process.

【0004】図3は、バッファ管理機構を備えた、従来
のDBMSの構成例を示すものである。図中、1はオン
ライントランザクション、2はバッチトランザクショ
ン、3はデータベースの表やインデックス等を格納する
磁気ディスク装置、31はデータベース管理システム
(DBMS)を示している。ここでは、DBMS31は、
上述のオンライントランザクション1とバッチトランザ
クション2を矛盾なく実行するための実行制御部32
と、磁気ディスク装置3に格納された表やインデックス
等のデータをバッファリングするバッファサブシステム
33から構成されている。更に、バッファサブシステム
33は、磁気ディスク3に格納されたデータを一時的に
保持するための半導体記憶装置36と、該半導体記憶装
置36が現在保持しているデータを管理するためのバッ
ファ管理表35と、バッファの割当ておよび置換を制御
するバッファ制御部34から構成されている。DBMS
31に入力されたトランザクション1あるいは2は、実
行制御部32が処理内容を解読して実行プランを作成
し、実行プランに従ってバッファサブシステム33に必
要なデータの読み出しを要求する。また、データの更新
を伴うトランザクションであれば、読み出したデータを
更新し、あるいは、新規のデータの追加格納をバッファ
サブシステム33に対して要求する。
FIG. 3 shows a configuration example of a conventional DBMS having a buffer management mechanism. In the figure, 1 is an online transaction, 2 is a batch transaction, 3 is a magnetic disk device for storing database tables and indexes, and 31 is a database management system.
(DBMS) is shown. Here, the DBMS 31 is
Execution control unit 32 for consistently executing the online transaction 1 and the batch transaction 2 described above
And a buffer subsystem 33 for buffering data such as tables and indexes stored in the magnetic disk device 3. Further, the buffer subsystem 33 includes a semiconductor memory device 36 for temporarily holding the data stored in the magnetic disk 3, and a buffer management table for managing the data currently held by the semiconductor memory device 36. 35, and a buffer control unit 34 for controlling buffer allocation and replacement. DBMS
The transaction 1 or 2 input to 31 is decoded by the execution control unit 32 to create an execution plan, and the buffer subsystem 33 is requested to read necessary data according to the execution plan. If the transaction involves data update, the read data is updated or new storage of new data is requested to the buffer subsystem 33.

【0005】バッファサブシステム33は、要求された
データが既に半導体記憶装置36にバッファリングされ
ていればそのデータを、また、バッファリングされてい
なければ磁気ディスク装置3から半導体記憶装置36の
空き領域に、要求されたデータを読み込んでそのデータ
を、実行制御部32に返却する。その際、半導体記憶装
置36に空き領域が存在しなければ、半導体記憶装置3
6にバッファリングされているいずれかのデータを追い
出して、空き領域を作成し、バッファを起換しなければ
ならない。従って、バッファ管理の課題は、ヒット率が
高いバッファの割当てと置換を実現することである。デ
ータベース処理装置における従来のバッファ管理方法
が、W.Effelsberg and T.Hearder著"Principles o
f Database Buffer Management",ACM Trans.o
n Database Systems,Vol.9,No.4,pp.560-595,D
ec.1984で整理されている。
The buffer subsystem 33 stores the requested data if the requested data has already been buffered in the semiconductor memory device 36, or the free space of the semiconductor memory device 36 from the magnetic disk device 3 if not buffered. Then, the requested data is read and the data is returned to the execution control unit 32. At that time, if there is no free area in the semiconductor memory device 36, the semiconductor memory device 3
Any data buffered in 6 must be evicted to create free space and replace the buffer. Therefore, the challenge of buffer management is to achieve allocation and replacement of buffers with high hit rates. A conventional buffer management method in a database processor is described in "Principles o" by W. Effelsberg and T. Hearder.
f Database Base Management ", ACM Trans.o
n Database Systems, Vol.9, No.4, pp.560-595, D
ec. Organized in 1984.

【0006】上記文献では、バッファの置換アルゴリズ
ムとして、FIFO(First In First Out),LRU
(Least Recentry Used),LFU(Least Frequentl
y Used)等があることが示されている。これら従来の置
換アルゴリズムは、過去のアクセス経緯から、次にアク
セスされるであろうデータをできるだけ高い確率でバッ
ファに保持するように置換する方法で、バッファ管理部
内で得られる情報、例えば、アクセスの順序や頻度、デ
ータ属性を用いて制御していた。このため、バッファ管
理を独立したサブシステムとして構成できる特徴を持つ
が、オンライントランザクション1とバッチトランザク
ション2を混在実行する場合には、以下の如き問題が生
ずる。 (1)バッチ処理でスキャンが完了したページは、その後
使用される可能性が低いにもかかわらず、LRUでは、
バッファ内に高い確率で存在してしまうこと。 (2)バッチで生成される中間結果は、頻繁に利用される
データではないので、FIFO,LFUアルゴリズムで
は、早い段階でバッファから追い出されてしまうこと。
[0006] In the above literature, as a buffer replacement algorithm, FIFO (First In First Out), LRU is used.
(Least Recent Used), LFU (Least Frequentl)
y Used) etc. are shown. These conventional replacement algorithms are methods of replacing the data that will be accessed next with a high probability of being retained in the buffer based on the past access history. It was controlled using order, frequency, and data attributes. Therefore, although the buffer management has a feature that it can be configured as an independent subsystem, the following problems occur when the online transaction 1 and the batch transaction 2 are executed in a mixed manner. (1) Pages that have been scanned by batch processing are unlikely to be used afterwards, but with LRU,
Existence in the buffer with a high probability. (2) Since the intermediate result generated in the batch is not the data that is frequently used, the FIFO and LFU algorithms must be expelled from the buffer at an early stage.

【0007】[0007]

【発明が解決しようとする課題】上述の問題に対して
は、バッファ管理に優先度を導入する手法が、M.J.C
arey,R.Jauhari and M.Livny著"Priority in D
BMS Resource Scheduling",15th Int'l Conf.
on Very Varge Data Bases,Amsterdam,1989に示
されている。ここでは、リアルタイムデータベース処理
を対象として、トランザクションに与えられた実行優先
度をバッファ管理の優先度として継承する方法が示され
ている。バッファ管理部は、アクセス要求があったデー
タを、優先度毎にLRUリストに登録して管理し、低い
優先度を先に追い出すようにバッファの置き換えを制御
することで、高い優先度で実行するトランザクションが
使用するデータが不用意に追い出されないようにしてい
る。しかしながら、オンライントランザクションとバッ
チトランザクション等の異なる種類のトランザクション
を混在して実行する際に、従来のバッファ管理方法を適
用したのでは、複数のオンラインユーザのためにバッフ
ァが細分化されて分割損が生ずるという問題や、バッチ
トランザクションに大量のバッファが割当てられてオン
ラインの性能が低下するという問題が生ずる。
With respect to the above problems, the method of introducing the priority into the buffer management is MJC.
arey, R. Jauhari and M. Livny "Priority in D"
BMS Resource Scheduling ", 15th Int'l Conf.
on Very Vartage Data Bases, Amsterdam, 1989. Here, a method of inheriting the execution priority given to a transaction as the priority of buffer management is shown for real-time database processing. The buffer management unit registers the data requested for access in the LRU list for each priority, manages the data, and controls the replacement of the buffer so as to expel the low priority first, thereby executing the data with high priority. The data used by the transaction is prevented from being accidentally ejected. However, when different types of transactions such as online transactions and batch transactions are mixedly executed, if the conventional buffer management method is applied, the buffer is subdivided for a plurality of online users, resulting in division loss. Or a problem that a large amount of buffer is allocated to the batch transaction and online performance is degraded.

【0008】また、バッチトランザクションを混在実行
することによってオンライントランザクションが頻繁に
アクセスするページがバッファから追い出されると、オ
ンライントランザクションは再読み込みを行う必要が生
ずるために演算量が増大し、かつ、ディスクアクセス待
ちが生ずるために応答性能が低下するという問題も生ず
る。一方、トランザクションに与えられた実行優先度を
バッファ管理の優先度として継承することで、バッファ
の入れ替え順序にトランザクションの優先度を反映する
従来法を、オンライントランザクションとバッチトラン
ザクションを混在実行する場合に適用すると、オンライ
ンとバッチの2段階の優先度しか存在しないので、十分
な優先度分けができないという問題や、更に、高い優先
度のトランザクションが使用を完了して近い将来には使
用いないことが明らかなデータであっても、バッファか
ら追い出されないという問題が生ずる。本発明は上記事
情に鑑みてなされたもので、その目的とするところは、
従来の技術における上述の如き諸問題を解消し、トラン
ザクションに固有のデータアクセスタイプを予め、ある
いは、実行時に検出してバッファ置換の優先度を決定し
て、優先度に基づくバッファの割当てと置換を行うよう
にした優先度付きバッファ管理方法を提供することにあ
る。
When a page frequently accessed by an online transaction is evicted from the buffer by executing batch transactions in a mixed manner, the online transaction needs to be re-read, which increases the amount of calculation and disk access. There is also a problem that the response performance deteriorates due to the waiting. On the other hand, by inheriting the execution priority given to the transaction as the priority of buffer management, the conventional method that reflects the transaction priority in the buffer replacement order is applied when executing online transactions and batch transactions together. Then, since there are only two levels of priority, online and batch, it is clear that there is a problem that sufficient priority classification is not possible, and that high-priority transactions are completed and will not be used in the near future. A problem arises that even data is not flushed from the buffer. The present invention has been made in view of the above circumstances, and its object is to:
The above-mentioned problems in the prior art are solved, the data access type unique to the transaction is detected in advance or at the time of execution, the priority of the buffer replacement is determined, and the buffer allocation and replacement based on the priority are performed. It is to provide a buffer management method with priority that is performed.

【0009】[0009]

【課題を解決するための手段】本発明の上述の目的は、
データベースの表および該表から作成したインデックス
を格納する2次記憶手段と、該2次記憶手段より高速ア
クセスが可能な1次記憶手段と、複数のトランザクショ
ンを矛盾なく実行するための実行制御手段とを有し、前
記2次記憶手段に格納された表およびインデックスの一
部分を前記1次記憶手段にバッファリングして処理する
データベース処理装置におけるバッファ管理方法であっ
て、前記インデックスを用いて前記表中の目的とする行
を検索あるいは更新するオンライントランザクション
と、前記表内の各行を逐次的に読み出して条件判定を行
うことで、対象とする行を探索し検索あるいは更新する
バッチトランザクションとを混在させて実行する際に、
前記オンライントランザクションとバッチトランザクシ
ョンに固有のアクセス特性を検出し、該検出したアクセ
ス特性に基づいてバッファリング時の優先度を決定する
ことを特徴とするバッファ管理方法によって達成され
る。
The above objects of the present invention are as follows:
A secondary storage means for storing a database table and an index created from the table; a primary storage means that can be accessed faster than the secondary storage means; and an execution control means for executing a plurality of transactions without contradiction. And a buffer management method in a database processing device for buffering and processing a part of a table and an index stored in the secondary storage means in the primary storage means. The online transaction for retrieving or updating the target row and the batch transaction for retrieving or retrieving or retrieving the target row are mixed by sequentially reading each row in the table and performing the condition determination. When running
This is achieved by a buffer management method characterized by detecting an access characteristic unique to the online transaction and the batch transaction and determining a priority for buffering based on the detected access characteristic.

【0010】[0010]

【作用】本発明に係る優先度付きバッファ管理方法にお
いては、上記実行制御手段が、トランザクションの実行
プランを作成することから、バッファサブシステムに対
するデータアクセスの順序と、一旦、アクセスしたデー
タが近い将来にデータベース管理システム内で処理して
いる自トランザクションあるいは他のトランザクション
によって使用される可能性を容易に検出することができ
る。例えば、オンライントランザクションが使用したイ
ンデックスデータであれば、他のオンライントランザク
ションによって近い将来に使用される確率が高い。一
方、バッチトランザクションが条件検索でスキャンした
表データは、少なくとも、自トランザクションが使用す
ることはないし、他のトランザクションが使用する確率
も低いと言える。これに対して、バッチトランザクショ
ンが検索した結果を一時表としてバッファに格納する中
間結果データは、自トランザクション内の後続する処理
で必ず1回は使用されると言える。また、ジュイン等の
ために生成した中間結果も、近い将来に必ず再使用され
ることが保証できる。上述の如く、実行制御手段におい
て、各トランザクションのアクセス特性を検出すること
は極めて容易であり、簡単な回路でアクセス特性検出手
段を実現できる。そこで、このアクセス特性検出手段で
検出したアクセス特性に基づいてバッファ管理の優先度
を判定し、アクセス特性検出手段で近い将来高い確率で
使用されると判断したインデックスやある種の中間結果
には高い優先度を割当て、そうでない場合は低い優先度
を割当てて、バッファ管理を行う。すなわち、バッファ
リングされたデータを低い優先度のデータほど先に追い
出すようにバッファを制御することで、バッファの利用
効率を向上させることができる。
In the buffer management method with priority according to the present invention, since the execution control means creates an execution plan for a transaction, the order of data access to the buffer subsystem and the data once accessed will be in the near future. Moreover, it is possible to easily detect the possibility of being used by the own transaction or another transaction processing in the database management system. For example, if the index data is used by an online transaction, it has a high probability of being used by another online transaction in the near future. On the other hand, it can be said that the table data scanned by the conditional search by the batch transaction is not used by at least the own transaction, and has a low probability of being used by other transactions. On the other hand, it can be said that the intermediate result data in which the result retrieved by the batch transaction is stored in the buffer as a temporary table is always used once in the subsequent processing in the own transaction. It can also be guaranteed that the intermediate results generated for joins etc. will be reused in the near future. As described above, it is extremely easy for the execution control unit to detect the access characteristic of each transaction, and the access characteristic detection unit can be realized with a simple circuit. Therefore, the priority of the buffer management is determined based on the access characteristic detected by the access characteristic detecting means, and the index or some intermediate result determined to be used by the access characteristic detecting means with a high probability in the near future is high. Buffer management is performed by assigning a priority, otherwise assigning a low priority. That is, it is possible to improve the utilization efficiency of the buffer by controlling the buffer so that the buffered data is pushed out earlier as the data having lower priority.

【0011】[0011]

【実施例】以下、本発明の実施例を図面に基づいて詳細
に説明する。図1は、本発明の一実施例に係るデータベ
ース管理システム(DBMS)の構成図である。図中の記
号1〜3は、図3に示したと同じ構成要素を示してお
り、また、11はDBMSを示している。DBMS11
は、前述のオンライントランザクション1とバッチトラ
ンザクション2を矛盾なく実行するための実行制御部1
2と、磁気ディスク装置3に格納された表やインデック
ス等のデータをバッファリングするためのバッファサブ
システム14とから構成されている。実行制御部12
は、DBMS11に入力されたトランザクションの処理
内容を解読して実行プランを作成し、該実行プランに従
ってバッファサブシステム14に必要なデータの読み出
しを要求すると同時に、アクセス特性判定部13におい
て、バッファサブシステム14に要求するデータのアク
セス順序および再利用の可能性に基づいてアクセスの優
先度を判定する。
Embodiments of the present invention will now be described in detail with reference to the drawings. FIG. 1 is a configuration diagram of a database management system (DBMS) according to an embodiment of the present invention. Symbols 1 to 3 in the figure indicate the same components as those shown in FIG. 3, and 11 indicates a DBMS. DBMS11
Is an execution control unit 1 for executing the above-mentioned online transaction 1 and batch transaction 2 without contradiction.
2 and a buffer subsystem 14 for buffering data such as tables and indexes stored in the magnetic disk device 3. Execution control unit 12
Reads the processing contents of the transaction input to the DBMS 11 to create an execution plan, requests the buffer subsystem 14 to read out necessary data according to the execution plan, and at the same time, causes the access characteristic determination unit 13 to read the buffer subsystem. The access priority is determined based on the access order of the data requested to 14 and the possibility of reuse.

【0012】バッファサブシステム14は、磁気ディス
ク装置3に格納されたデータを一時的に保持する半導体
記憶装置18と、該半導体記憶装置18が現在保持して
いるデータを管理するバッファ管理表16と、該データ
の属性を判定するデータ属性判定部17と、該データ属
性判定部17で得られたデータ属性に基づく優先度と上
述のアクセス特性判定部13で得られたアクセス特性に
基づく優先度とから、バッファ管理の優先度を決定し、
該優先度に基づいてバッファの割当ておよび入れ替えを
行う優先度制御部15から構成されている。図2は、図
1に示した実施例におけるバッファ管理の手順を説明す
る動作フロー図である。以下、両図に基づいて、実施例
の動作を説明する。 ステップ21:DBMS11に入力されたオンライントラ
ンザクション1およびバッチトランザクション2の処理
内容を、実行制御部12において解読し、実行プランを
作成する。 ステップ22:作成した実行プランに従って、バッファサ
ブシステム14に必要なデータの読み出しを要求する。
また、データを更新する場合には、更新の対象とするデ
ータの読み出し、あるいは、新規データの追加格納をバ
ッファサブシステムに要求する。
The buffer subsystem 14 includes a semiconductor memory device 18 for temporarily holding the data stored in the magnetic disk device 3, and a buffer management table 16 for managing the data currently held by the semiconductor memory device 18. A data attribute determination unit 17 for determining the attribute of the data, a priority based on the data attribute obtained by the data attribute determination unit 17, and a priority based on the access characteristic obtained by the access characteristic determination unit 13 described above. The buffer management priority from
It is composed of a priority control unit 15 which allocates and swaps buffers based on the priority. FIG. 2 is an operation flow chart for explaining the buffer management procedure in the embodiment shown in FIG. The operation of the embodiment will be described below with reference to both drawings. Step 21: The execution control unit 12 decodes the processing contents of the online transaction 1 and the batch transaction 2 input to the DBMS 11 to create an execution plan. Step 22: The buffer subsystem 14 is requested to read necessary data according to the created execution plan.
Further, when updating the data, the buffer subsystem is requested to read out the data to be updated or additionally store new data.

【0013】ステップ23:バッファサブシステム14
は、要求されたデータが既に半導体記憶装置18にバッ
ファリングされているか否かを判定する。バッファリン
グされていれば、該データを使用して後述するデータベ
ース処理を行う。バッファリングされていない場合に
は、次のデータ読み込み操作に移る。 ステップ24:半導体記憶装置18上に実現したバッファ
に、未使用領域が存在するか否かを判定する。未使用領
域が存在すれば、ステップ26のデータ読み込み操作を行
い、未使用領域が存在しなければ、次のバッファ入れ替
え操作に移る。 ステップ25:バッファがすべて使用され、余裕がない場
合には、バッファリングしているデータのいずれかを追
い出して空き領域を作成する。このとき、バッファ管理
表16を参照して、最も優先度が低く、しかも、最も最
近使用されていないデータを追い出す。従って、バッフ
ァ管理表16には、バッファしている各データに対して
少なくとも優先度と使用された順序を判定するための情
報を登録しておく。このためのバッファ管理表16は、
各優先度毎にLRUリストを構成することで容易に実現
することができる。
Step 23: Buffer subsystem 14
Determines whether the requested data is already buffered in the semiconductor memory device 18. If the data is buffered, the data is used for database processing described later. If not, the next data read operation is performed. Step 24: It is judged whether or not there is an unused area in the buffer realized on the semiconductor memory device 18. If there is an unused area, the data reading operation of step 26 is performed, and if there is no unused area, the next buffer exchange operation is performed. Step 25: If all the buffers are used and there is not enough space, one of the buffered data is evicted to create a free area. At this time, referring to the buffer management table 16, the data having the lowest priority and the least recently used is expelled. Therefore, in the buffer management table 16, information for determining at least the priority and the order in which the data is buffered is registered. The buffer management table 16 for this is
This can be easily realized by configuring the LRU list for each priority.

【0014】ステップ26:以上の操作によって、バッフ
ァ上には空き領域が存在するので、要求されたデータを
読み込む。同時に、読み込んだデータを識別するための
情報をバッファ管理表16に登録する ステップ27:ここでは、バッファ管理の優先度を決定す
るステップ28の操作で使用する独立した優先度の値を求
める。 ステップ27-1:実行制御部12はバッファリングされた
データのデータ属性を使用して、実行プランに基づく処
理を行う。その際、アクセス特性判定部13において、
アクセス特性に基づく優先度を判定する。このとき、作
用の項に示した如く、オンライントランザクションとバ
ッチトランザクションはデータアクセスの順序や偏り等
のアクセス特性に応じて、一旦アクセスしたデータが再
利用される確率が明らかに異なることから、優先度を付
与することができる。 ステップ27-2:トランザクションに付与された優先度を
バッファ管理で使用する優先度に変換する。トランザク
ションを発行するユーザは、個々のトランザクションの
実行に際して、それぞれ、実行の優先度として期待する
値を設定するので、ユーザ間のばらつきを除き、実行優
先度を統一して割当てる操作を行う。すなわち、通常、
DBMSを共用する複数のユーザ間には、ユーザ毎に操
作できる権限が制限されていたり、トランザクションを
発行する際の優先度が与えられている。DBMSを維持
管理をしている管理者には多くの権限と高い実行優先度
が与えられており、初心者ユーザには、限られた権限と
低い実行優先度が与えられている。ここでは、このユー
ザ毎に与えられた実行優先度を、トランザクションの実
行に反映する役割を持つ。
Step 26: As a result of the above operation, since there is a free area in the buffer, the requested data is read. At the same time, information for identifying the read data is registered in the buffer management table 16. Step 27: Here, an independent priority value used in the operation of step 28 of determining the priority of buffer management is obtained. Step 27-1: The execution control unit 12 uses the data attributes of the buffered data to perform processing based on the execution plan. At that time, in the access characteristic determination unit 13,
Determine priority based on access characteristics. At this time, as shown in the section of action, the probability that the once accessed data will be reused is obviously different between the online transaction and the batch transaction depending on the access characteristics such as the order of data access and the bias, so the priority is Can be given. Step 27-2: Convert the priority given to the transaction into a priority used in buffer management. The user who issues a transaction sets an expected value as the execution priority when executing each transaction, so that the execution priorities are uniformly assigned and operations are performed, except for variations among users. That is, normally
Among a plurality of users who share a DBMS, the authority to operate for each user is limited, and a priority when issuing a transaction is given. A large number of authorities and high execution priority are given to the administrator who maintains and manages the DBMS, and a beginner user is given limited authority and low execution priority. Here, it has a role of reflecting the execution priority given to each user in the execution of the transaction.

【0015】ステップ27-3:一方、バッファリングした
データ属性に基づいて、バッファ管理の優先度を決定す
る。一般に、(インデックスの容量)<(表の容量)である
ことから、インデックスに高い優先度を付与することが
できる。更に、データベースの格納状況を管理するスキ
ーマ情報をバッファリングする場合や、構造を持つイン
デックスを細分化して個々のデータ項目に対して優先度
を割当てることもできる。優先度を付与する基本原則と
して、容量が小さく、多くのトランザクションから頻繁
にアクセスされるデータ属性ほど高い優先度を与えると
すると、バッファのヒット率を向上することができる。 ステップ28:上記ステップ27-1,27-2,27-3で決定した
アクセス特性に基づく優先度,トランザクションの実行
優先度に基づく優先度と、データ属性に基づく優先度を
統合してバッファ管理の優先度を決定する。当該データ
が既にバッファリングされている場合は、バッファ管理
表16に所定の値が設定されているので、この設定され
ている値と上で求めた3種類の優先度とで新しい優先度
を決定して、バッファ管理表16の優先度値を更新す
る。前述のステップ25のバッファ追い出しは、このバッ
ファ管理表16に登録された優先度の値を使用して制御
する。
Step 27-3: On the other hand, the priority of buffer management is determined based on the buffered data attribute. In general, since (capacity of index) <(capacity of table), high priority can be given to the index. Furthermore, it is possible to buffer the schema information for managing the storage status of the database, or to divide the structured index into subdivided priorities for individual data items. As a basic principle of giving a priority, if a data attribute that has a small capacity and is frequently accessed by many transactions is given a higher priority, the hit ratio of the buffer can be improved. Step 28: The priority based on the access characteristics, the priority based on the execution priority of the transaction, and the priority based on the data attribute determined in steps 27-1, 27-2 and 27-3 are integrated to manage the buffer. Determine the priority. If the data is already buffered, a predetermined value is set in the buffer management table 16, so a new priority is determined by the set value and the three types of priority obtained above. Then, the priority value of the buffer management table 16 is updated. The buffer eviction in step 25 is controlled by using the priority value registered in the buffer management table 16.

【0016】なお、優先度を如何に統合するかによっ
て、DBMSの性書が決定される。例えば、データ属性
に基づく優先度を重視するシステムは、従来法に示した
データ属性別管理法に類似したバッファ管理となる。一
般的には、トランザクションの実行優先度pT1,pT2,・・
・・、データ属性による優先度pD1,pD2,・・・・、アクセス
特性による優先度pA1,pA2,・・・・が与えられたとき、こ
れらの組み合わせが(pT1,pD1,pA1)>(pT1,pD1,pA
2)>・・・・>(pT1,pD2,pA1)>(pT1,pD2,pA2)>・・・・
>(pT2,pD1,pA1)>(pT2,pD1,pA2)>・・・・となるよ
うに、トランザクションの実行優先度を重視した統合が
考えられる。 ステップ29:以上のステップ22から28の操作を、トラン
ザクション処理が終了するまで繰り返す。
It should be noted that the DBMS specifications are determined by how the priority levels are integrated. For example, a system that emphasizes priority based on data attributes has buffer management similar to the data attribute-based management method shown in the conventional method. In general, the transaction execution priority pT1, pT2, ...
.. When the priorities pD1, pD2, ... by the data attribute and the priorities pA1, pA2, .. by the access characteristic are given, the combination of these is (pT1, pD1, pA1)> (pT1 , pD1, pA
2) > ・ ・ ・ ・ > (pT1, pD2, pA1) > (pT1, pD2, pA2) > ・ ・ ・
> (PT2, pD1, pA1)> (pT2, pD1, pA2)> ... Step 29: The above operations of Steps 22 to 28 are repeated until the transaction processing is completed.

【0017】上記実施例によれば、データアクセス特性
に基づいてバッファ管理の優先度を決定することによ
り、バッチトランザクションを実行することによってオ
ンライントランザクションが必要とするデータが不用意
に追い出されてしまうことを防止し、また、バッチトラ
ンザクションが生成する中間結果をデータベースのバッ
ファサブシステムを用いて保持することが可能になる。
これにより、例えば、指定された条件でデータベースを
検索して結果を1件ずつ返却するバッチトランザクショ
ンを、検索するプロセスと結果を返却するプロセスで処
理する場合に、2つのプロセス間で受け渡す検索結果を
バッファサブシステムを用いて保持することができるた
め、結果受け渡し専用に新たなバッファ機構を設ける必
要がなくなる利点がある。また、大量の中間結果を保持
しなければならない結合処理においても、バッファサブ
システムを用いてバケット毎にバッファリングの優先度
を制御できるために、少ないバッファ容量であっても、
有効に利用することができる。
According to the above embodiment, by determining the buffer management priority based on the data access characteristic, the data required by the online transaction is inadvertently ejected by executing the batch transaction. In addition, the buffer subsystem of the database can be used to hold intermediate results generated by batch transactions.
As a result, for example, when a batch transaction that searches the database under the specified conditions and returns the results one by one is processed by the process for searching and the process for returning the results, the search results passed between the two processes Can be held by using the buffer subsystem, which has the advantage of eliminating the need to provide a new buffer mechanism exclusively for passing results. Further, even in a join process in which a large amount of intermediate results must be held, the buffer subsystem can be used to control the priority of buffering for each bucket, so that even with a small buffer capacity,
It can be used effectively.

【0018】なお、上記実施例は本発明の一例を示した
ものであり、本発明はこれに限定されるべきものではな
いことは言うまでもないことである。例えば、上記実施
例においては、データアクセス特性とデータ属性に基づ
いてバッファ管理の優先度を決定する方法を説明した
が、データアクセス特性だけを用いてバッファ管理の優
先度を決定することもできる。更に、トランザクション
自体に実行優先度を指定できる場合、例えば、オンライ
ントランザクションはバッチトランザクションに優先し
て処理を実行するように設定された場合にも、データア
クセス特性に基づく優先度とトランザクションに与えら
れた優先度を統合した優先度を用いてバッファ管理を行
うこともできる。上述の説明では、バッファ管理表の構
成については詳細に説明しなかったが、一例として示し
た優先度別のLRUリスト以外にも、アクセス頻度に基
づくLFUリスト等他の構成であっても、優先度とアク
セスの順序関係を保持できれば、バッファ管理表の構成
に依存せずに実現することができる。また、オンライン
トランザクションとバッチトランザクションの混在実行
以外の場合であっても、種類が異なるトランザクション
を混在させて実行する場合であり、かつ、各トランザク
ションのアクセス特性が予め、あるいは、実行時に判別
できる場合は、本発明に係るアクセス特性を用いた優先
度付きバッファ管理方法を適用できる。
It is needless to say that the above embodiment shows an example of the present invention and the present invention should not be limited to this. For example, in the above embodiment, the method of determining the priority of the buffer management based on the data access characteristic and the data attribute has been described, but the priority of the buffer management can be determined using only the data access characteristic. Further, when the execution priority can be specified for the transaction itself, for example, even when the online transaction is set to execute the processing in preference to the batch transaction, the priority and the transaction based on the data access characteristic are given to the transaction. It is also possible to manage the buffer by using the priority in which the priority is integrated. Although the structure of the buffer management table has not been described in detail in the above description, priority may be given to other structures such as an LFU list based on access frequency other than the LRU list for each priority shown as an example. If the relationship between the degree and the order of access can be maintained, it can be realized without depending on the configuration of the buffer management table. In addition, even in cases other than mixed execution of online transactions and batch transactions, when transactions of different types are mixed and executed, and the access characteristics of each transaction can be determined in advance or at the time of execution The buffer management method with priority using access characteristics according to the present invention can be applied.

【0019】[0019]

【発明の効果】以上、詳細に説明した如く、本発明によ
れば、トランザクションに固有のデータアクセスタイプ
を予め、あるいは、実行時に検出してバッファ置換の優
先度を決定して、優先度に基づくバッファの割当てと置
換を行うようにした優先度付きバッファ管理方法を実現
できるという顕著な効果を奏するものである。
As described above in detail, according to the present invention, the data access type peculiar to a transaction is detected in advance or at the time of execution to determine the priority of the buffer replacement, and the priority is based on the priority. This has the remarkable effect of realizing a buffer management method with priorities that allocates and replaces buffers.

【0020】[0020]

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

【図1】本発明の一実施例に係るデータベース管理シス
テムの構成図である。
FIG. 1 is a configuration diagram of a database management system according to an embodiment of the present invention.

【図2】図1に示した実施例における、バッファ管理の
手順を説明する動作フロー図である。
FIG. 2 is an operation flow diagram for explaining a buffer management procedure in the embodiment shown in FIG.

【図3】従来のバッファ管理を用いたデータベース管理
システムの構成図である。
FIG. 3 is a configuration diagram of a conventional database management system using buffer management.

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

1:オンライントランザクション、2:バッチトランザ
クション、3:磁気ディスク装置、11:DBMS、1
2:実行制御部、13:アクセス特性判定部、14:バ
ッファサブシステム、15:優先度制御部、16:バッ
ファ管理表、17:データ属性判定部、18:半導体記
憶装置。
1: Online transaction, 2: Batch transaction, 3: Magnetic disk device, 11: DBMS, 1
2: execution control unit, 13: access characteristic determination unit, 14: buffer subsystem, 15: priority control unit, 16: buffer management table, 17: data attribute determination unit, 18: semiconductor memory device.

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 データベースの表および該表から作成し
たインデックスを格納する2次記憶手段と、該2次記憶
手段より高速アクセスが可能な1次記憶手段と、複数の
トランザクションを矛盾なく実行するための実行制御手
段とを有し、前記2次記憶手段に格納された表およびイ
ンデックスの一部分を前記1次記憶手段にバッファリン
グして処理するデータベース処理装置におけるバッファ
管理方法であって、前記インデックスを用いて前記表中
の目的とする行を検索あるいは更新するオンライントラ
ンザクションと、前記表内の各行を逐次的に読み出して
条件判定を行うことで、対象とする行を探索し検索ある
いは更新するバッチトランザクションとを混在させて実
行する際に、前記オンライントランザクションとバッチ
トランザクションに固有のアクセス特性を検出し、該検
出したアクセス特性に基づいてバッファリング時の優先
度を決定することを特徴とするバッファ管理方法。
1. A secondary storage means for storing a table of a database and an index created from the table, a primary storage means capable of high-speed access from the secondary storage means, and a plurality of transactions for consistent execution. And a buffer management method in a database processing device for buffering and processing a part of the table and the index stored in the secondary storage means in the primary storage means. An online transaction that retrieves or updates a target row in the table by using it, and a batch transaction that searches for and retrieves or updates the target row by sequentially reading each row in the table and performing condition determination When executing a mixture of A buffer management method comprising detecting a unique access characteristic and determining a priority at the time of buffering based on the detected access characteristic.
【請求項2】 前記混在させて実行するオンライントラ
ンザクションとバッチトランザクションの各々に対して
実行時の優先度を指定し、該指定された実行優先度と前
記アクセス特性とに基づいてバッファリング時の優先度
を決定することを特徴とする請求項1記載のバッファ管
理方法。
2. A priority at the time of execution is specified for each of the online transaction and the batch transaction executed in a mixed manner, and a priority at the time of buffering is specified based on the specified execution priority and the access characteristic. The buffer management method according to claim 1, wherein the degree is determined.
【請求項3】 前記二次記憶装置に格納された表および
インデックスのデータ属性と前記アクセス特性とに基づ
いてバッファリング時の優先度を決定することを特徴と
する請求項1または2記載のバッファ管理方法。
3. The buffer according to claim 1, wherein the priority at the time of buffering is determined based on the data attribute of the table and index stored in the secondary storage device and the access characteristic. Management method.
JP4246097A 1992-09-16 1992-09-16 Method for managing buffer Pending JPH0695936A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4246097A JPH0695936A (en) 1992-09-16 1992-09-16 Method for managing buffer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4246097A JPH0695936A (en) 1992-09-16 1992-09-16 Method for managing buffer

Publications (1)

Publication Number Publication Date
JPH0695936A true JPH0695936A (en) 1994-04-08

Family

ID=17143449

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4246097A Pending JPH0695936A (en) 1992-09-16 1992-09-16 Method for managing buffer

Country Status (1)

Country Link
JP (1) JPH0695936A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004362459A (en) * 2003-06-06 2004-12-24 Nec Corp Network information recording device
US7962674B2 (en) 2007-11-27 2011-06-14 Panasonic Corporation Buffer management device, buffer management method, and integrated circuit for buffer management
JP2015046164A (en) * 2013-08-28 2015-03-12 バイオセンス・ウエブスター・(イスラエル)・リミテッドBiosense Webster (Israel), Ltd. Double buffering with atomic transactions for persistent storage of real-time data flow
WO2018070011A1 (en) * 2016-10-13 2018-04-19 富士通株式会社 Job specification program, job specification method and job specification device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004362459A (en) * 2003-06-06 2004-12-24 Nec Corp Network information recording device
US7962674B2 (en) 2007-11-27 2011-06-14 Panasonic Corporation Buffer management device, buffer management method, and integrated circuit for buffer management
JP2015046164A (en) * 2013-08-28 2015-03-12 バイオセンス・ウエブスター・(イスラエル)・リミテッドBiosense Webster (Israel), Ltd. Double buffering with atomic transactions for persistent storage of real-time data flow
US10684986B2 (en) 2013-08-28 2020-06-16 Biosense Webster (Israel) Ltd. Double buffering with atomic transactions for the persistent storage of real-time data flows
WO2018070011A1 (en) * 2016-10-13 2018-04-19 富士通株式会社 Job specification program, job specification method and job specification device

Similar Documents

Publication Publication Date Title
US8386463B2 (en) Method and apparatus for dynamically associating different query execution strategies with selective portions of a database table
US8566333B2 (en) Multiple sparse index intelligent table organization
US7680784B2 (en) Query processing system of a database using multi-operation processing utilizing a synthetic relational operation in consideration of improvement in a processing capability of a join operation
US7113957B1 (en) Row hash match scan join using summary contexts for a partitioned database system
US6105033A (en) Method and apparatus for detecting and removing obsolete cache entries for enhancing cache system operation
US8224813B2 (en) Cost based analysis of direct I/O access
US20090210445A1 (en) Method and system for optimizing data access in a database using multi-class objects
US7698253B2 (en) Method and system for reducing host variable impact on access path selection
US20080071755A1 (en) Re-allocation of resources for query execution in partitions
US9996594B2 (en) Method, article and system for time dependent search
US20030093647A1 (en) Storage system having means for acquiring execution information of database management system
US5845113A (en) Method for external sorting in shared-nothing parallel architectures
US6457097B1 (en) Information processing system and recording medium recording a program to cause a computer to execute steps
US6230243B1 (en) Method, system and program products for managing changed data of castout classes
US7080072B1 (en) Row hash match scan in a partitioned database system
US20070073655A1 (en) Enhancing tables and SQL interaction with queue semantics
JPWO2004036432A1 (en) Database accelerator
JPH0695936A (en) Method for managing buffer
US20120198456A1 (en) Reducing the number of operations performed by a persistence manager against a persistent store of data items
Schöning et al. Cluster mechanisms supporting the dynamic construction of complex objects
CN114168306B (en) Scheduling method and scheduling device
US11874830B2 (en) Efficient job writing for database member
US9411838B2 (en) Table organization using one or more queries
EA005269B1 (en) Organising data in a database
Nanopoulos et al. Memory-adaptive association rules mining