JPS63253431A - Retrieving system for data base of inverted structure - Google Patents

Retrieving system for data base of inverted structure

Info

Publication number
JPS63253431A
JPS63253431A JP62088297A JP8829787A JPS63253431A JP S63253431 A JPS63253431 A JP S63253431A JP 62088297 A JP62088297 A JP 62088297A JP 8829787 A JP8829787 A JP 8829787A JP S63253431 A JPS63253431 A JP S63253431A
Authority
JP
Japan
Prior art keywords
block
record
blocks
pool
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
JP62088297A
Other languages
Japanese (ja)
Inventor
Isamu Fujiwara
勇 藤原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Solution Innovators Ltd
Original Assignee
NEC Solution Innovators Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Solution Innovators Ltd filed Critical NEC Solution Innovators Ltd
Priority to JP62088297A priority Critical patent/JPS63253431A/en
Publication of JPS63253431A publication Critical patent/JPS63253431A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To improve the processing speed with the titled retrieving system by providing plural blocks into a block pool in a main memory. CONSTITUTION:The record numbers are extracted out of the index records read out after retrieving an index part of a data base 1 and converted into the block numbers within a block pool 2 and the bit numbers in the blocks. When the same blocks are included in the pool 2, the bit shown by the corresponding bit numbers is turned on and the next record number is processed. If the same blocks are not included in the pool 2, the corresponding bit is turned on as long as an idle block exists in the pool 2 and the next record number is processed. If no idle block is available, one block is selected out of the pool 2 and written to the corresponding block in the file 3. At the same time, it is checked whether the file 3 includes the same blocks or not. If so, these relevant blocks are read out. The bit of the read block is turned on an the next record number is processed. In such a way, the number of times of input/output is decreased, and the processing speed is improved with a data base retrieving system.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、インバーテツド構造のデータベース検索方式
に関し、特に主メモリと外部メモリとのデータの入出力
回数を減じて処理速度を向上させたインバーテツド構造
のデータベース検索方式に関する。
[Detailed Description of the Invention] [Field of Industrial Application] The present invention relates to a database search method with an inverted structure, and in particular, an inverted structure that improves processing speed by reducing the number of data inputs and outputs between main memory and external memory. Concerning database search methods.

〔従来の技術〕[Conventional technology]

この種の処理方式は、インバーテツド構造のデータベー
ス11を検索する場合に使用される。インバーテツド構
造とは第3図に示すように、データレコードを識別する
索引とそれが抽出されたデータのレコード番号からなる
索引部をもつ構造のことを言い、検索処理を行う場合に
はレコード番号とデータからなるデータ部を検索するの
でなく、この索引部を検索することでデータベース11
へのアクセスを局所化させることが可能になる。
This type of processing method is used when searching the database 11 having an inverted structure. As shown in Figure 3, an inverted structure is a structure that has an index part that consists of an index that identifies data records and the record number of the extracted data. By searching this index section instead of searching the data section consisting of data, the database 11
It becomes possible to localize access to.

第2図をもとに、索引がIn以上の値をもつデータレコ
ードを検索する場合の動作について説明する。
Based on FIG. 2, the operation when searching for a data record whose index has a value of In or more will be described.

まず、データベース11の索引部を検索してInを見つ
け、その索引レコードを読み出す。読み出した索引レコ
ードからレコード番号を取り出し、(外部メモリに格納
される)ファイル13のブロックに対応させたブロック
番号とブロック内のビット番号に変換する。(この変換
は、あらがしめ定められた方法で行われるが、例えば上
位N桁下値M桁のレコード番号のうち、上位N桁をファ
イル中のブロック番号に、下位M桁をブロック内のピッ
l一番号とするときもある)そして、中央処理装置内の
主メモリに格納されるカレントブロック12のビット番
号で示すビットをオンに設定する。これを、読み出した
索引レコード内の全てのレコード番号について行う。こ
のとき、ブロック番号の異なるレコードを検出した場合
には、それまでのカレントブロック12の内容をブロッ
ク番号で示すファイル13の位置に書き出した後に設定
する。
First, the index section of the database 11 is searched to find In, and the index record is read. The record number is extracted from the read index record and converted into a block number and a bit number within the block that correspond to the block of the file 13 (stored in the external memory). (This conversion is performed according to a predetermined method, but for example, of a record number with the upper N digits and the lower value M digits, the upper N digits are the block number in the file, and the lower M digits are the block number in the block. 1 number)) Then, the bit indicated by the bit number of the current block 12 stored in the main memory in the central processing unit is set on. This is done for all record numbers in the read index records. At this time, if a record with a different block number is detected, the contents of the current block 12 up to that point are written to the position of the file 13 indicated by the block number and then set.

以上の処理を、索引がIn以上の値をもつ索引レコード
全てに対して行う、ただし、索引レコードの2個目以後
については、異なるブロック番号をもつレコード番号を
検出すると、カレントブロック12を書き出すとともに
既にファイル13にそのブロックが書き出されているか
否かを調べ、書き出されているならそのブロックを読み
出した後に設定処理を行う。
The above process is performed for all index records whose index has a value of In or more. However, for the second and subsequent index records, when a record number with a different block number is detected, the current block 12 is written out and It is checked whether the block has already been written to the file 13, and if it has been written, the setting process is performed after reading the block.

最後にカレントブロック12をファイル13に書き出し
て検索処理が完了し、検索されたデータレコードはファ
イル上にビットの集合として格納されていることになる
。このビット集合から実際のデータレコードを得るには
、今までと逆の処理を行う。ファイルからブロックを読
み、オンビットをみつけ、そのビットの位置を示す番号
とブロック番号とからレコード番号に変換して第3図で
示すデータ部にアクセスすればよい。
Finally, the current block 12 is written to the file 13 to complete the search process, and the searched data records are stored as a set of bits on the file. To obtain the actual data record from this bit set, the process is reversed. All you have to do is read the block from the file, find the on bit, convert the number indicating the position of the bit and the block number into a record number, and access the data section shown in FIG. 3.

従って、レコード番号がファイル内の異ったブロックに
対応するごとに、カレントブロックの内容が外部メモリ
中のファイルに転送される。
Thus, each time the record number corresponds to a different block within the file, the contents of the current block are transferred to the file in external memory.

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

上述した従来のインバーテツド構造のデータベース検索
方式の問題点は、読み出された索引レコードのレコード
番号がファイル内の異ったブロックに対応するごとに主
メモリ内のカレントブロックの内容が外部メモリ中のフ
ァイルに転送されるので、処理時間が長いすなわち処理
速度が遅いという点にある。
The problem with the conventional inverted structure database search method described above is that each time the record number of the read index record corresponds to a different block in the file, the contents of the current block in main memory are transferred to the external memory. Since the data is transferred to a file, the processing time is long, that is, the processing speed is slow.

本発明の目的は、上記欠点を解決したインバーテツド構
造のデータベース検索方式を提供することにある。
SUMMARY OF THE INVENTION An object of the present invention is to provide a database search method with an inverted structure that solves the above-mentioned drawbacks.

〔問題点を解決するための手段〕[Means for solving problems]

本発明のインバーテツド構造のデータベース検索方式は
、 インバーテツド構造のデータベースと、前記データベー
スから索引レコードを呼出してそのレコード番号を格納
する主メモリ装置内に格納されるブロック番号の定まら
ない複数個の第一のブロックを有するブロックブールと
、外部メモリ内に前記索引レコードのレコード番号に従
って格納されるブロック番号の定まった複数個の第二の
ブロックを有するファイルとを備え、 呼出された前記索引レコードのレコード番号と同一のブ
ロック番号を有するレコード番号が格納されている第一
のブロックの一つに格納し、前記索引レコードのレコー
ド番号と同一のブロック番号を有するレコード番号が格
納されている第一のブロックのないときは空いている第
一のブロックにレコード番号を格納し、 前記索引レコードのレコード番号と同一のブロツク番号
を有するレコード番号が格納されている第一のブロック
がなくかつ空いている第一のブロックがないときは、い
ずれか一つの第一のブロックをファイル内の該当する第
二のブロックに書き込み前記レコード番号を格納すべき
第二のブロックに格納されている内容を読み出して空い
ている第一のブロックに書き込むと共に前記レコード番
号を書き込むことを含んで構成される。
The database search method with an inverted structure of the present invention includes a database with an inverted structure, and a plurality of first index records with undefined block numbers stored in a main memory device that retrieves index records from the database and stores the record numbers. a block boolean having a block, and a file having a plurality of second blocks each having a predetermined block number stored in an external memory according to the record number of the index record, the record number of the called index record; A record number having the same block number is stored in one of the first blocks, and a record number having the same block number as the index record is stored in one of the first blocks. If the record number is stored in the first empty block, and there is no first block storing a record number having the same block number as the record number of the index record, and the first block is empty. If there is no available block, write one of the first blocks to the corresponding second block in the file, read the contents stored in the second block that should store the record number, and write the first block to the first free block. and writing the record number.

〔実施例〕〔Example〕

次に、本発明について図面を参照して説明する。 Next, the present invention will be explained with reference to the drawings.

第1図は本発明の一実施例の構成を示すブロック図であ
る。
FIG. 1 is a block diagram showing the configuration of an embodiment of the present invention.

まず、本実施例の概要を述べる。本実施例の従来例との
構造上の違いはレコード番号を変換してビットを設定す
るブロックを1個から複数個に増やしたことである。こ
れによる動作の違いは、従来の場合であると、カレント
ブロックのブロック番号と異なるレコード番号を検出す
るごとにファイルとのデータの入出力を必要とするが、
本発明の場合は、中央処理装置内の主メモリに格納され
るブロックプール中の複数個のブロック番号と異なるレ
コード番号が現われるまで、ファイルとのデータの入出
力かを行なわない点である。本実施例はデータベース1
と、ブロックプール2と、ファイル3とを備えている。
First, an outline of this embodiment will be described. The structural difference between this embodiment and the conventional example is that the number of blocks in which record numbers are converted and bits are set is increased from one to a plurality of blocks. The difference in operation due to this is that in the conventional case, data input/output with the file is required every time a record number different from the block number of the current block is detected.
In the case of the present invention, data input/output to/from a file is not performed until a record number different from a plurality of block numbers in a block pool stored in a main memory in a central processing unit appears. In this example, database 1
, a block pool 2, and a file 3.

第1図をもとに、〔従来の技術〕と同様に索引がIn以
上の値をもつデータレコードを検索する動作について説
明する。
Based on FIG. 1, the operation of searching for a data record whose index has a value of In or more will be described in the same way as in the [prior art].

まず、データベース1の索引部を検索してInを見つけ
、その索引レコードを読み出す。読み出した索引レコー
ドからレコード番号を取り出し、ブロックプール2内で
のブロック番号とブロック内のビット番号とに変換(こ
の方法は従来の技術と同様である)する。そして、ブロ
ックプール中に同一のブロックが存在しているが否かを
調べる。見つかったなら、そのブロックの該当ビット番
号で示すビットをオン(Oを1にする)にしてつぎのレ
コード番号の処理を行う。見っからながった場合には、
プール中に空ブロックがあるがどうかを調べ、存在した
ならこのブロックの該当ビット番号で示すビットをオン
にしてつぎのレコード番号の処理を行う。存在しなかっ
た場合(ブロックプール2のブロックは全て使用中であ
る)には、ブロックプール2から任意の1つのブロック
を運び、ファイル3上の対応するブロックに書き出すと
ともに、今度はファイル3に同一のブロックが格納され
ているかを調べ、格納されていたならそのブロックを読
み出し、ブロックプール2の空いたブロックに戻す。そ
して、このブロックのビットをオンにしてつぎのレコー
ド番号の処理を行う。
First, the index section of database 1 is searched to find In, and the index record is read. The record number is extracted from the read index record and converted into a block number within the block pool 2 and a bit number within the block (this method is similar to the conventional technique). Then, it is checked whether the same block exists in the block pool. If found, the bit indicated by the corresponding bit number of that block is turned on (O is set to 1) and the next record number is processed. If it turns out to be strange,
Check whether there is an empty block in the pool, and if it does, turn on the bit indicated by the corresponding bit number of this block and process the next record number. If it does not exist (all blocks in block pool 2 are in use), carry any one block from block pool 2, write it to the corresponding block on file 3, and write the same block to file 3. Check whether the block is stored, and if so, read that block and return it to a free block in block pool 2. Then, the bit of this block is turned on to process the next record number.

以上について、索引がIn以上の値をもつ索引レコード
全てに対して行った後、ブロックプール2中で使用され
ているブロックをファイル3の対応するブロックに書き
出して検索処理を完了する。これにより、検索されたデ
ータレコードはファイル3上のビットの集合として得ら
れることになる。
After the above is performed for all index records whose indexes have a value of In or more, the blocks used in the block pool 2 are written to the corresponding blocks of the file 3, and the search process is completed. As a result, the retrieved data record will be obtained as a set of bits on file 3.

例えば索引Inのレコード番号が1と100万、I n
+1もまた同じであるという極端な場合でも、従来のカ
レントブロックが10万単位のレコード番号を収容でき
るとすると、検索処理が完了するまでに従来の技術では
ファイルへのデータの入出力が6回、本発明の一実施例
ではファイルへのデータの入出力が2回で済むことにな
る。
For example, if the record numbers of index In are 1 and 1 million, I n
Even in the extreme case where +1 is also the same, assuming that the conventional current block can accommodate record numbers in units of 100,000, conventional technology requires data input and output to the file 6 times before the search process is completed. , one embodiment of the present invention requires only two inputs and outputs of data to the file.

また、ブロックブール2内のブロックを複数個設けたこ
とにより、検索完了までにブロックプール2とファイル
3との間に、ブロックの書込みと読込みを行うデータの
入出力の回数が従来の技術に比し減少する。そして、ブ
ロックブール2内のブロックがファイル3内のブロック
に対応して存在すれば、データの入出力の回数は1回で
済むことになる。
In addition, by providing multiple blocks in block Boolean 2, the number of data inputs and outputs for writing and reading blocks between block pool 2 and file 3 until the search is completed is reduced compared to conventional technology. and decrease. If a block in block Boolean 2 exists corresponding to a block in file 3, data input/output only needs to be performed once.

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

以上説明したように本発明は、 主メモリ内のブロックプール内のブロックを複数個設け
たことにより、検索完了までにブロックプールと外部メ
モリ内のファイルとの間にブロックの書込みと読込みを
行うデータの入出力の回数が減少し、処理速度が向上で
きるという効果がある。
As explained above, by providing a plurality of blocks in the block pool in the main memory, the present invention allows data to be written and read between the block pool and the file in the external memory until the search is completed. This has the effect of reducing the number of input/output operations and improving processing speed.

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

第1図は本発明の一実施例の構成を示すブロック図、第
2図は従来の技術による構成の一例を示すブロック図、
第3図はデータベースのインバーテツド構造を示す説明
図。 1・・・データベース、2・・・ブロックプール、3・
・・ファイル。
FIG. 1 is a block diagram showing the configuration of an embodiment of the present invention, FIG. 2 is a block diagram showing an example of the configuration according to the conventional technology,
FIG. 3 is an explanatory diagram showing the inverted structure of the database. 1...Database, 2...Block pool, 3.
··File.

Claims (1)

【特許請求の範囲】 インバーテッド構造のデータベースと、前記データベー
スから索引レコードを呼出してそのレコード番号を格納
する主メモリ装置内に格納されるブロック番号の定まら
ない複数個の第一のブロックを有するブロックプールと
、外部メモリ内に前記索引レコードのレコード番号に従
って格納されるブロック番号の定まった複数個の第二の
ブロックを有するファイルとを備え、 呼出された前記索引レコードのレコード番号と同一のブ
ロック番号を有するレコード番号が格納されている第一
のブロックの一つに格納し、前記索引レコードのレコー
ド番号と同一のブロック番号を有するレコード番号が格
納されている第一のブロックのないときは空いている第
一のブロックにレコード番号を格納し、 前記索引レコードのレコード番号と同一のブロック番号
を有するレコード番号が格納されている第一のブロック
がなくかつ空いている第一のブロックがないときは、い
ずれか一つの第一のブロックをファイル内の該当する第
二のブロックに書き込み前記レコード番号を格納すべき
第二のブロックに格納されている内容を読み出して空い
ている第一のブロックに書き込むと共に前記レコード番
号を書き込むことを特徴とするインバーテッド構造のデ
ータベース検索方式。
[Scope of Claims] A block having an inverted structure database and a plurality of first blocks with undetermined block numbers stored in a main memory device that reads an index record from the database and stores the record number. a file having a plurality of second blocks each having a fixed block number stored in an external memory according to the record number of the index record, the block number being the same as the record number of the called index record; is stored in one of the first blocks storing a record number having the same block number as the record number of the index record, and is empty when there is no first block storing a record number having the same block number as the record number of the index record. If there is no first block storing a record number with the same block number as the record number of the index record and there is no empty first block, , write one of the first blocks to the corresponding second block in the file, read the contents stored in the second block that should store the record number, and write it to the empty first block. A database search method with an inverted structure, characterized in that the record number is written together with the record number.
JP62088297A 1987-04-09 1987-04-09 Retrieving system for data base of inverted structure Pending JPS63253431A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62088297A JPS63253431A (en) 1987-04-09 1987-04-09 Retrieving system for data base of inverted structure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62088297A JPS63253431A (en) 1987-04-09 1987-04-09 Retrieving system for data base of inverted structure

Publications (1)

Publication Number Publication Date
JPS63253431A true JPS63253431A (en) 1988-10-20

Family

ID=13938986

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62088297A Pending JPS63253431A (en) 1987-04-09 1987-04-09 Retrieving system for data base of inverted structure

Country Status (1)

Country Link
JP (1) JPS63253431A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000298668A (en) * 1999-04-12 2000-10-24 Ntt Data Corp Device and method for storing information of information retrieval system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000298668A (en) * 1999-04-12 2000-10-24 Ntt Data Corp Device and method for storing information of information retrieval system

Similar Documents

Publication Publication Date Title
US5293616A (en) Method and apparatus for representing and interrogating an index in a digital memory
JPS63253431A (en) Retrieving system for data base of inverted structure
JP2923952B2 (en) Merge processing method
JPS6143338A (en) Searching of thin data base using association technology
JP2604787B2 (en) Two-dimensional data storage method
JPS59220838A (en) Associative memory device
JP2596332B2 (en) Data combination extraction method and apparatus
JPH07101382B2 (en) Margin processing device
JP2507399B2 (en) Database equipment
JPH048816B2 (en)
JPS63118958A (en) Index file memory device
JPH0272481A (en) Character string retrieving device by logical expression and control system for such device
JPH02127742A (en) Idle area retrieving system
JPH0145648B2 (en)
JPH09330322A (en) Data retrieval device
JPS6373327A (en) Processor for data content retrieval
JPH0291725A (en) Merging processing system
JPH04145579A (en) Content retrieving device
JPH02206829A (en) Method for sorting record group
JPH03226829A (en) Information processor
JPH02120982A (en) Data base control device
JPS6339029A (en) Production of data base
JPH05165891A (en) Data registration/retrieval system of data base
JPS6319052A (en) High speed label accessing system
JPH0467660B2 (en)