JPS61145658A - Index order editing file device - Google Patents

Index order editing file device

Info

Publication number
JPS61145658A
JPS61145658A JP59267210A JP26721084A JPS61145658A JP S61145658 A JPS61145658 A JP S61145658A JP 59267210 A JP59267210 A JP 59267210A JP 26721084 A JP26721084 A JP 26721084A JP S61145658 A JPS61145658 A JP S61145658A
Authority
JP
Japan
Prior art keywords
record
records
deleted
additional
file
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
JP59267210A
Other languages
Japanese (ja)
Inventor
Isao Kawase
川瀬 勲
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.)
TOKYO SHIYOSEKI INSATSU KK
Original Assignee
TOKYO SHIYOSEKI INSATSU KK
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 TOKYO SHIYOSEKI INSATSU KK filed Critical TOKYO SHIYOSEKI INSATSU KK
Priority to JP59267210A priority Critical patent/JPS61145658A/en
Publication of JPS61145658A publication Critical patent/JPS61145658A/en
Pending legal-status Critical Current

Links

Landscapes

  • Indexing, Searching, Synchronizing, And The Amount Of Synchronization Travel Of Record Carriers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

PURPOSE:To prevent overflow of a normal record to the utmost by writing an added record while deleting a record to be deleted and compressing it when the added record is generated. CONSTITUTION:When an additional record A1 to be inserted at a position next to a record Rj of a block Bi is generated, records after the record D1 to be deleted are shifted to the right by one each, the record A1 is written in a location where the record D1 to be deleted existed, a record Dp to be deleted overflowed from the right end of the block Bi is deleted and compressed. When the additional record A2 to be inserted between the records R1 and R2 is produced, records after the record R2 are shifted to the right by one, the additional record A2 is inserted to the vacant location and a record Dp-1 to be deleted is deleted. Every time the additional record is generated, a record Dk to be deleted is deleted and compressed and the additional record is written.

Description

【発明の詳細な説明】 〔産業上の利用分野コ この発明は、アクセス時間の短縮化とファイル再編成の
頻度減少とを図った索引順編成ファイル装置に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to an indexed sequential file device that aims to shorten access time and reduce the frequency of file reorganization.

〔従来の技術] 周知のとおシ、磁気ディスク装置等の直接アクセス装置
においては、レコードをキーの順番に処理することもで
き 【順次アクセス)、かつキーを指定して特定レコー
ドだけを直接処理するCランダムアクセス)こともでき
る索引順編成ファイルが広く用いられている。
[Prior Art] As is well known, in a direct access device such as a magnetic disk device, records can be processed in the order of keys [sequential access], and C that directly processes only a specific record by specifying a key. Indexed sequential files, which can also be accessed (randomly accessed), are widely used.

第4図(イ)は、従来の索引順編成ファイルの構成例を
示す概念図である。この図において、1はファイル名を
示すファイルラベル、2はレコードを検索する九めのイ
ンデックス領域、3はブロック阻 (1=1.2・・・
m)からなり、レコードを格納するデータ領域S4はデ
ータ領域3からあふれ出たレコードを収納するためのオ
ーバーフロー領域である。ここで上記ブロックB1 は
、一般に、第4図←)に示すように制御部Cと、実際に
データを格納するレコードRj  (j=1 * 2・
・・n)と、空き領域Sとから構成されている。iた、
各レコードRj にはキーが割シ嶺てられ、各レコード
FIG. 4(a) is a conceptual diagram showing an example of the structure of a conventional index sequential organization file. In this figure, 1 is the file label indicating the file name, 2 is the ninth index area for searching records, and 3 is the block block (1=1.2...
m), and the data area S4 for storing records is an overflow area for storing records overflowing from the data area 3. Here, the block B1 generally includes a control unit C and a record Rj (j=1 * 2) that actually stores data, as shown in FIG.
...n) and a free area S. It was,
A key is assigned to each record Rj.

Rjはキーの昇順にデータ領域3に格納されている。そ
して、各ブロックの最後に格納されたレコードのキーが
インデックス領域2に記録され、索引を構成している。
Rj is stored in the data area 3 in ascending order of keys. The key of the record stored last in each block is recorded in the index area 2, forming an index.

このよつな構成において、追加レコードが発生すると、
次のようELL、て追加レコードの挿入が行われる。
In this typical configuration, when an additional record occurs,
Additional records are inserted using ELL as follows.

■ インデックス領域を検索し、追加を行うべき゛ブロ
ックB1 を検索する。
■ Search the index area and search for block B1 to be added.

■ 該轟ブロックBi 内のレコードのキーが昇1@に
保たれるような挿入位置をさがし、挿入位置以降のレコ
ードを右方ヘ一つずつ書き移して、空き領域を作)、上
記追加レコードを書き込む。
■ Find an insertion position where the key of the record in the Todoroki block Bi is kept at Ascension 1@, and write the records after the insertion position one by one to the right to create a free space), and write the above additional records. Write.

■ 追加レコード挿入の結果、ブロックB1の右端から
あふれたレコードが空き領域Sあるいは削除フロー)(
これについては後述する)であれば、そのレコードを消
滅させる。
■ As a result of inserting additional records, the records overflowing from the right end of block B1 are moved to free space S or deletion flow) (
(This will be discussed later), the record is deleted.

■ あふれ九レコードが通常のレコードであれば、′ 
オーバーフロー領域4に収容する。
■ If the overflow nine records are normal records, ′
It is accommodated in the overflow area 4.

こうして、索引順編成ファイルにおいては、常に、キー
の昇順にレコードが格納されるから、順次アクセス、ラ
ンダムアクセスがともに可能となシ、能率のよいファイ
ル管理を行うことができる。
In this way, in an indexed sequential file, records are always stored in ascending order of keys, allowing both sequential and random access, and efficient file management.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

ところで、上述し次従来の索引順編成ファイルにおいて
は、データ領域3とオーツく−フロー領域4とは独立し
た場所にとられるのが普通である。
By the way, in the above-mentioned conventional indexed sequential file, the data area 3 and the automatic flow area 4 are usually located at independent locations.

このため、オーバーフロー領域4内のレコードが増加す
るに従って、データ領域3とオーツ5−フロー領域4と
を交互にアクセスする回数が増え、余分なシーク時間の
増加を来し、アクセス時間が増してしまうという問題が
あった。また、オーツ(−フロー領域4内にあるレコー
ドはブロック化されておらず、リンクによって関係付け
られているため、これも処理を遅らせる一因となってい
た。
Therefore, as the number of records in the overflow area 4 increases, the number of alternate accesses between the data area 3 and the oats 5-flow area 4 increases, resulting in an increase in extra seek time and an increase in access time. There was a problem. Furthermore, the records in the flow area 4 are not blocked, but are related by links, which also causes delays in processing.

このような処理速度の低下を防ぐためには、ファイルの
再編成を行い、各フローVがキーの昇順に並ぶように、
データ領域3へ移し替えなければならない。しかしなが
ら、このファイルの再編成特番こは、ファイルへの登録
は勿論のこと、ファイルの参照、出力などが全くできな
(なってしまうため、ファイル編成の頻度はなるぺ〈少
なくしなければならないという問題があった。
In order to prevent such a decrease in processing speed, reorganize the file so that each flow V is arranged in ascending order of keys.
It must be moved to data area 3. However, with this special file reorganization program, not only can you register in the file, but you can't reference or output the file at all. There was a problem.

これらの問題を回避するためには、空き領域やダミーレ
コードを予め多量に確保しておく方法がとられているが
、これら薯こは次の欠点があつ九。
In order to avoid these problems, methods are used to reserve a large amount of free space or dummy records in advance, but these methods have the following drawbacks.

(11空き領域Sは、一般に、全ブロックBl〜BnJ
こ共通に確保されるので、追加レコードが集中し易い場
所にのみ多くとるという訳番こはいかない。この結果、
追加レコードの少いブロックでは空き領域Sが未使用の
まま残シ、ブロック内の使用効率が低下してしまう。
(No. 11 free area S is generally all blocks Bl to BnJ
Since this is commonly reserved, it is not possible to reserve more records only in places where additional records are likely to be concentrated. As a result,
In a block with few additional records, the free area S remains unused and the usage efficiency within the block decreases.

(2)ダミーレコード(すなわち、有意味なデータを含
まないレコード)を確保しておく方法では、ダミーレコ
ードが読み出し時に通常のレコードと同様に扱われるこ
とから、処理プログラムに読み込まれ次レコードがダミ
ーレコードか否かを判定して処理しなければならず、処
理が煩雑になってしまう。
(2) In the method of securing dummy records (that is, records that do not contain meaningful data), the dummy records are treated in the same way as normal records when read, so the next record is read by the processing program and the next record is a dummy record. It is necessary to determine whether or not it is a record before processing, which makes the processing complicated.

この他にも、第5図に示すように、既存レコード用ファ
イルと、追加レコード用ファイルとを別個に備え、所定
の周期でこれらを合併して祈念な既存レコード用ファイ
ルとする方法や、第6図に示すように、索引順編成ファ
イルから直接編成ファイルのような他のファイルに変更
し、それらを別々に管理するなどの方法が考えられる。
In addition, as shown in Figure 5, there is a method of separately preparing an existing record file and an additional record file, and merging them at a predetermined period to create a prayerful existing record file. As shown in Figure 6, a possible method is to change from an index sequential file to another file such as a direct file and manage them separately.

しかし表から、前者の方法では、一元的なファイル管理
が難しく、後者の方法では索引順編成ファイルの特徴で
あるランダムアクセスや順次アクセスが制約されてしま
うという問題があった。
However, as shown in the table, the former method has problems in that centralized file management is difficult, and the latter method restricts random access and sequential access, which are characteristics of indexed sequential files.

この発明は上述した問題点、特にアクセス時間の増加と
、ファイル再編成の頻度増加とを解消しようとするもの
である。
This invention attempts to solve the above-mentioned problems, particularly the increase in access time and the increase in the frequency of file reorganization.

c問題点を解決するための手段〕 上記問題点を解決するために、この発明は、読み出し時
に読み飛ばされ、かつ追加レコード挿入時には削除、圧
縮される削除レコードを、追加レコードが集中すると予
想されるデータ領域に予め確保したことを特徴とする。
Means for Solving Problem c] In order to solve the above problem, the present invention eliminates deleted records that are skipped during reading and are deleted and compressed when inserting additional records, which are expected to be concentrated in additional records. The feature is that the data area is reserved in advance.

〔作用〕[Effect]

上記手段によれば、追加レコードが発生したときに、削
除レコードが削除、圧縮されて追加レコードが書き込ま
れるから、通常レコーードのオーバーフローを極力防止
することができる。また、削除レコードは読み出し時に
読み飛ばされ、処理プログラムに読み込まれることがな
いから、ダミーレコードのように頻雑な処理をしな(て
も済む。
According to the above means, when an additional record is generated, the deleted record is deleted and compressed and the additional record is written, so that overflow of normal records can be prevented as much as possible. Furthermore, since deleted records are skipped when read and are not read into the processing program, they do not need to be processed as frequently as dummy records.

〔実施例〕〔Example〕

以下、図面を参照して本発明の詳細な説明する。 Hereinafter, the present invention will be described in detail with reference to the drawings.

第1図は、本発明の一実抱例の構成を示す基本構成図で
ある。この図において、11は磁気ディスク等の記憶装
置、12は書込手段、13は読出手段である。上記記憶
装置11には、第4図に示すものと同様の各領域が確保
され、ブロックBi内のレコードRjは、第2図に示す
ように、フラグ部Fと、キー部にと、データ部DTとか
ら構成されている。このフラグ部Fには、レコードが削
除レコードのときにFF(1g進表示)が記入され、他
のレコードと区別されるようIこなっている。
FIG. 1 is a basic configuration diagram showing the configuration of one practical example of the present invention. In this figure, 11 is a storage device such as a magnetic disk, 12 is a writing means, and 13 is a reading means. Each area similar to that shown in FIG. 4 is secured in the storage device 11, and the record Rj in block Bi has a flag section F, a key section, and a data section, as shown in FIG. It is composed of DT. In this flag section F, when the record is a deleted record, FF (1g notation) is written, and it is marked I to distinguish it from other records.

そして、追加レコードが集中すると予想されるブロック
B1には、第3v!J(イ)lこ示すような削除レコー
ドDk  (k=1.2−”’El)がレコードRjの
後に予め確保されている。なお、本実施例のブロックB
1ζこは空き領域はとられていない。
Then, in block B1 where additional records are expected to be concentrated, the 3rd v! J(a)l A deletion record Dk (k=1.2-"'El) as shown is secured in advance after record Rj. Note that block B of this embodiment
1ζ No free space is taken.

このような構成において、ブロックB1のレコードRj
の次の位置に挿入すべき追加レコードAIが発生したと
すると、削除レコードR2以降のレコードが右方へ1つ
ずつ書き移され、削除レコードDIのあった場所に追加
レコードA1が書き込まれ、ブロックB1の右端からあ
ふれ九削除レコードDXIは削除、圧縮されるC第3図
←))。
In such a configuration, record Rj of block B1
If an additional record AI to be inserted at the next position occurs, the records after deleted record R2 are written one by one to the right, and additional record A1 is written at the location where the deleted record DI was, and the block The nine deleted records DXI overflowing from the right end of B1 are deleted and compressed (Figure 3).

また次に、レコードR1とR2との間に挿入すべき追加
レコードA2が生じたとすると、レコードR2以降のレ
コードが右方へ1つずつ書き移され、空いた場所(レコ
ードR2が格納されていた場所]に追加レコードA2が
挿入されるとともfこ削除レコードDp−□が消滅され
る(第3図(9)。こうして、追加レコードが発生する
毎に削除レコードDkが削除、圧縮され、追加レコード
の書き込みが行われる。従って、削除レコードD0〜D
pすべてが削除、圧縮されるまで、ブロックB1からあ
ふれてオーバーフロー領域4へ書き移されるレコード°
は生じないことになる。
Next, if an additional record A2 is to be inserted between records R1 and R2, the records after record R2 are written one by one to the right, leaving the empty space (where record R2 was stored). When the additional record A2 is inserted in the location], the deleted record Dp-□ is deleted (Fig. 3 (9)).In this way, each time an additional record is generated, the deleted record Dk is deleted and compressed, and the deleted record Dk is deleted and compressed. Records are written. Therefore, deletion records D0 to D
Records that overflow from block B1 and are transferred to overflow area 4 until all p are deleted and compressed.
will not occur.

上述のようをこして書き込まれた追加データは、。Additional data written as described above.

従来と同様に読み出すことができる。また、残っり削除
レコードは、フラグFによって判定されて読み飛ばされ
るので、処理プログラム上に読み込まれることはない。
It can be read out in the same way as before. Further, the remaining deletion records are skipped as determined by the flag F, and are therefore not read into the processing program.

そして、相当量の追加レコードが書き込まれた後、ファ
イルの再編成が行われると、残った削除レコードは消去
され、他のレコードがキーの昇順にデータ領域2に格納
される。
When the file is reorganized after a considerable amount of additional records have been written, the remaining deleted records are deleted and other records are stored in the data area 2 in ascending order of keys.

本実施例によれば、削除レコードDkがある限りオーバ
ーフローが生じないので、オーバーフロー領域4へのレ
コード書き替えを抑制することができる。従って、アク
セス時間の増大を防止することができるとともに、ファ
イル再編成の頻度を減少させることができる。この結果
、ファイルの利用効率の向上を図ることができる。
According to this embodiment, overflow does not occur as long as there are deletion records Dk, so it is possible to suppress record rewriting to the overflow area 4. Therefore, it is possible to prevent an increase in access time and to reduce the frequency of file reorganization. As a result, file usage efficiency can be improved.

また、削除レコードD1〜Dp はキーを操作すること
によシ任意のブロックB1に任意の数(ftだしn以下
)だけ確保できるので、空き領域のときよ)も無駄にな
る領域が少な(て済む。
In addition, any number of deletion records D1 to Dp (in ft and less than n) can be secured in any block B1 by key operation, so less space is wasted (when the area is free). It's over.

さらに、削除レコードはダミーレコードと違って処理プ
ログラムに読み込まれることがないので、ダミーレコー
ドか否かなどの判断が不要となシ、その分処理が簡単と
なる利点が得られる。
Furthermore, unlike dummy records, deleted records are not read into the processing program, so there is no need to judge whether or not they are dummy records, which has the advantage of simplifying processing.

〔発明の効果〕〔Effect of the invention〕

以上説明したように、この発明は、読み出し時に読み飛
ばされ、かつ追加レコード挿入時には削除、圧縮される
削除レコードを、追加レコードが集中すると予想される
データ領域に予め確保し念ので、以下の効果を奏するこ
とができる。
As explained above, the present invention secures in advance deleted records that are skipped when reading and deleted and compressed when inserting additional records in a data area where additional records are expected to be concentrated, thereby achieving the following effects. can be played.

(11レコードの追加によるアクセス時間の増加を抑制
することができる。
(It is possible to suppress the increase in access time due to the addition of 11 records.

(2)空き領域を確保する方法と比ベファイルのバツキ
7グ効率を高めることができる。
(2) The method of securing free space and the efficiency of file batching can be improved.

(3)ファイル再編成の頻度を減少させることができる
(3) The frequency of file reorganization can be reduced.

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

第1図は、本発明の一実施例の構成を示す基本構成図、
第2図は同実施例におけるブロックとレコードの構成を
示す概念図、第3図は追加レコードの挿入状態を示す概
念図、第4図は従来の索引順編成ファイルの構成を示す
概念図、第5図、第6図は従来のファイル構成を説明す
るための図である。 3・・・・・・7″−ツタ領域 4・・・・・・オーバーフロー領域 11・・・・・・記憶装置 12・・・・・・書込手段 13・・・・・・読出手段 AI 、A2・・・・・・追加レコードBi(1=1.
2・・・m)・・・・・・ブロックDk(k=1.2・
・・p)・・・用削除レコードK・・・・・・キー部 Rj(j=1.2・・・n)・・・・・・レコードS・
・・・・・空き領域。 (4)       第4図
FIG. 1 is a basic configuration diagram showing the configuration of an embodiment of the present invention;
FIG. 2 is a conceptual diagram showing the structure of blocks and records in the same embodiment; FIG. 3 is a conceptual diagram showing the insertion state of additional records; FIG. 4 is a conceptual diagram showing the structure of a conventional indexed sequential file; 5 and 6 are diagrams for explaining the conventional file structure. 3...7''-vine area 4...overflow area 11...storage device 12...writing means 13...reading means AI , A2...Additional record Bi (1=1.
2...m)...Block Dk (k=1.2・
...p)...Delete record K...Key part Rj (j=1.2...n)...Record S...
·····Free space. (4) Figure 4

Claims (1)

【特許請求の範囲】[Claims] 複数のブロックからなるデータ領域およびオーバーフロ
ー領域を有する記憶装置と、キーの付されたレコードを
キー番号順に前記ブロックに書き込むとともに、前記書
き込み時に前記ブロックからあふれ出たレコードを前記
オーバーフロー領域に書き込む書込手段と、前記キーを
索引として所望のレコードを順次あるいはランダムに読
み出す読出手段とを具備してなる索引順編成ファイル装
置において、前記読出手段が読み飛ばし、かつ前記書込
手段が削除・圧縮する削除レコードを、追加レコードが
集中すると予想されるデータ領域に予め確保したことを
特徴とする索引順編成ファイル装置。
A storage device having a data area and an overflow area consisting of a plurality of blocks, and a write function that writes records to which keys are attached to the blocks in the order of key numbers, and writes records that overflow from the blocks during the write operation to the overflow area. and reading means for sequentially or randomly reading desired records using the key as an index, wherein the reading means skips reading and the writing means deletes/compresses. An indexed sequential file device characterized in that records are secured in advance in a data area where additional records are expected to be concentrated.
JP59267210A 1984-12-18 1984-12-18 Index order editing file device Pending JPS61145658A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59267210A JPS61145658A (en) 1984-12-18 1984-12-18 Index order editing file device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59267210A JPS61145658A (en) 1984-12-18 1984-12-18 Index order editing file device

Publications (1)

Publication Number Publication Date
JPS61145658A true JPS61145658A (en) 1986-07-03

Family

ID=17441661

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59267210A Pending JPS61145658A (en) 1984-12-18 1984-12-18 Index order editing file device

Country Status (1)

Country Link
JP (1) JPS61145658A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04353941A (en) * 1991-05-30 1992-12-08 Nec Corp Data base re-formation device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04353941A (en) * 1991-05-30 1992-12-08 Nec Corp Data base re-formation device

Similar Documents

Publication Publication Date Title
CA2013154C (en) Apparatus and method for digital data management
JPS5942897B2 (en) Text data content transfer device
JPS6051731B2 (en) Two-tier file system
US4198681A (en) Segmented storage logging and controlling for partial entity selection and condensing
JPS61145658A (en) Index order editing file device
JPS5942895B2 (en) Recording method
JPS593567A (en) Buffer number setting system of tree structure
JP3061385B2 (en) Data management device and data management method
JPH0477938A (en) Data storage method
US7693920B2 (en) Recycle-free directory entry system and method
JP2679761B2 (en) Data management system
JPH08272654A (en) File management device
JPH05113922A (en) Data storage device
JPH04287140A (en) File managing system for dividing into plural physical files
JPH0452737A (en) File control system
JPH0652019A (en) File controller
JPH05173871A (en) Memory card file management method
JPS6128148A (en) Text data storage device
JPS63303399A (en) Voice information storage apparatus
JPH06131221A (en) Data addition and deletion system for file
JPH0452494B2 (en)
JPH0668088A (en) Text management system in distributed processing editer
JPH07210451A (en) Data memory storing method
JPH07182215A (en) Data managing device
JPS62257520A (en) Buffer area managing system