JPS61141036A - Data retrieval system - Google Patents
Data retrieval systemInfo
- Publication number
- JPS61141036A JPS61141036A JP59264070A JP26407084A JPS61141036A JP S61141036 A JPS61141036 A JP S61141036A JP 59264070 A JP59264070 A JP 59264070A JP 26407084 A JP26407084 A JP 26407084A JP S61141036 A JPS61141036 A JP S61141036A
- Authority
- JP
- Japan
- Prior art keywords
- data
- retrieval
- comparison
- abc
- conditions
- 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
Links
Abstract
Description
【発明の詳細な説明】
〔発明の利用分野〕
本発明はデータ検索方式に係り、特に関係データベース
などにおいて、前方一致パターンマツチ比較によりデー
タを検索するのに好適なデータ検索方式に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Application of the Invention] The present invention relates to a data retrieval method, and particularly to a data retrieval method suitable for retrieving data by forward matching pattern match comparison in a relational database or the like.
関係データベースは、第3図に示すように、複数の行(
ロウ)情報と複数の列(カラム)情報の表形式で表現さ
れる。このような関係データベースの検索の一つに、前
方一致のパターンマツチ比較によりデータを検索する方
法がある。これは指定されたーあるいは複数のカラムに
ついて、検索範囲を先頭から所定長の任意文字列に限定
し、該文字列についてパターンマツチ比較を行い、一致
したロウ情報を取り出す方法である。第3図はカラム1
を指定し1条件”ABC%計(ニーで%は0個以上の任
意の文字列)と一致するロウ2,4゜・・・を選択する
例である。゛この場合、従来はパターンマツチ比較をロ
ウ1から順次ロウnまで行い。As shown in Figure 3, a relational database has multiple rows (
It is expressed in a tabular format of row information and multiple column information. One way to search such a relational database is to search for data using a pattern match comparison using a prefix match. This is a method in which the search range is limited to an arbitrary character string of a predetermined length from the beginning of a specified column or multiple columns, a pattern match comparison is performed on the character strings, and matching row information is extracted. Figure 3 is column 1
This is an example of specifying 1 condition and selecting rows 2, 4゜, etc. that match the condition ``ABC% total (% is an arbitrary character string of 0 or more characters).゛In this case, conventionally, pattern match comparison are performed sequentially from row 1 to row n.
条件と一致するロウを選択しており、検索時間がかNる
という問題があった。There was a problem in that the rows that matched the conditions were selected, and the search time was long.
例えば技術雑誌r’b i tJ (Vol、10.N
n2゜p96〜102.1978)に゛アルゴリズムの
話−パターン・マツチングについて一′″と題して紹介
されているように、従来からパターンマツチ処理の効率
向上のために様々のアルゴリズムが考えられている。し
かしlながら、データベースなどにおいて、前方一致の
パターン比較によりデータを検索する場合、対象とな゛
る全データについてパターンマツチを行うことにより検
索時間がかへるという問題を解決することについては考
慮されていない。For example, the technical magazine r'b i tJ (Vol. 10.N
As introduced in ``Algorithms - About Pattern Matching'' in ``Algorithms - About Pattern Matching'', various algorithms have been considered to improve the efficiency of pattern matching processing. However, when searching for data using prefix pattern comparison in a database, etc., consideration must be given to solving the problem that the search time increases by performing pattern matching on all the target data. It has not been.
本発明め目的は、関係データベースの検索などのように
、前方一致パターンマツチをともなうデータ検索におい
て、検索効率の向上を図ることにある。An object of the present invention is to improve search efficiency in a data search that involves a prefix pattern match, such as a search in a relational database.
前方一致のパターンマツチ比較では、被比較文字列が比
較パターン文字列以上で、比較パターン最後の1文字以
外が一致し、最後め1文字がコード5上で比較パターン
の最後の文字の次である文字−列より小さければよい、
従って、パターンマツチ比較条件はデータ値の比較条件
さらにインデスクのキー値条件に変換することができる
1本発明は、この点に着目し、前方一致パターンマツチ
を伴なうデータ検索において、キー値条件により検索デ
ータの範囲を限定し、パターンマツチ比較を行わずにデ
ータ検索処理を行うことを特徴とする。In a pattern match comparison with a forward match, the compared string is greater than or equal to the comparison pattern string, all but the last character of the comparison pattern matches, and the last character has a code of 5 and is next to the last character of the comparison pattern. It only needs to be smaller than the character string.
Therefore, a pattern match comparison condition can be converted into a data value comparison condition and an index key value condition. It is characterized by limiting the range of search data based on conditions and performing data search processing without performing pattern match comparison.
例えばパターンマツチ比較条件を゛′カラムABC%パ
とした場合、該条件は’ABC<カラム値<ABD”な
るデータ値の比較条件に変換できる。For example, if the pattern match comparison condition is ``column ABC% pattern'', the condition can be converted to a data value comparison condition of ``ABC<column value<ABD''.
二へで、”ABC”は比較パターン、”ABD”は比較
パターンの最後の文字11 Cl#より一つ大きい文字
列である。なお、コードはA、B、C,D、E・・・の
順に値、が大きくなるとする。上記データ値の比較条件
はさらに”ABC<キー値<ABD”なるキー値条件に
変換できる。このキー値条件によりインデクステーブル
を参照することにより1.全データに対するパターンマ
ツチ比較を行わずにデータ検索処理を行うことができる
。2, "ABC" is a comparison pattern, and "ABD" is a character string one larger than the last character 11 Cl# of the comparison pattern. It is assumed that the values of the codes increase in the order of A, B, C, D, E, . . . . The above data value comparison condition can be further converted into a key value condition of "ABC<key value<ABD". By referring to the index table using this key value condition, 1. Data search processing can be performed without performing pattern match comparison for all data.
第1図は本発明で対象とするデータ検索システムの全体
ブロック図を示す、第1図において、10は検索条件、
その他の入力に用いられるキーボード等のデータ入力装
置、20は検索条件の変換処理、データ検索処理等を行
う中央処理装置、30は中央処理装置20の処理で必要
とするプログラムが格納されているメモリ(ROM)、
40は入力データ、中間結果、インデクステーブル等の
格納に用いられるメモリ(RAM)、5Gは被検索デー
タベースが格納されているフロッピーディスク等の外部
記憶装置、60は検索結果を出、力するディスプレ仁プ
リンタ等のデータ出力装置である。FIG. 1 shows an overall block diagram of a data retrieval system targeted by the present invention. In FIG. 1, 10 is a search condition;
A data input device such as a keyboard used for other inputs, 20 a central processing unit that performs search condition conversion processing, data search processing, etc., 30 a memory in which programs necessary for processing by the central processing unit 20 are stored. (ROM),
40 is a memory (RAM) used to store input data, intermediate results, index tables, etc., 5G is an external storage device such as a floppy disk in which the database to be searched is stored, and 60 is a display unit that outputs the search results. This is a data output device such as a printer.
第2図は本発明のデータ、検索方式の処理フロー例を示
したもので、これは第1図中の中央処理装置20で実行
され、そのプログラムはメモリ30に格納されている。FIG. 2 shows an example of the processing flow of the data and search method of the present invention, which is executed by the central processing unit 20 in FIG. 1, and its program is stored in the memory 30.
第2図(a)t*パターンマツチ比較条件として゛カラ
ム LIKE ABC%″が指定された場合の処理手
順である。データ入力装置10よりパターンマツチ比較
条件として゛′バカラムLIKE ABC%″が入力
されると、これを中央処理装置20が解析し、ますカラ
ム値に関する比較条件“ABCくカラム値<ABD”を
生成する(ステップ101)、即ち、バカラム LIK
E ABC%″の条件を持つ検索は、辞書順に並べたデ
ータC文字列)の”ABC・・・″から’ABD・・・
″の−っ前までのちのを取り出すことN考えることがで
きるので、ステップ101では1条件パターン文字列か
らパ%″記号を除いた固定文字列”ABC”と、該固定
文字列の最後の文字゛″C”が一つ大きい文字列゛″A
BD”でカラム値に関する比較条件”ABC<カラム値
くABD’7を生成する0次に、中央処理装置20では
、このカラム値に関する比較条件をインデクスのキー値
に関する条件”ABC<キー値<ABD”に変換する(
ステップ102)、これがインデクステーブル41のサ
ーチ条件を示している。中央処理装置20は、このキー
値条件でメモリ40のインデクステーブル41をサーチ
し、被検索データの読出しアドレスを得る(ステップ1
03)。FIG. 2(a) shows the processing procedure when ``Column LIKE ABC%'' is specified as the t* pattern match comparison condition. ``Column LIKE ABC%'' is input as the pattern match comparison condition from the data input device 10. Then, the central processing unit 20 analyzes this and generates a comparison condition "ABC column value <ABD" regarding the column value (step 101), that is, Bacalum LIK
A search with the condition ``E ABC%'' will search from ``ABC...'' to 'ABD...
Since it is possible to think of extracting the following part up to - before ``, in step 101, the fixed character string ``ABC'' obtained by removing the par %'' symbol from the 1-condition pattern string and the last character of the fixed character string are extracted. Character string ``''A'' with ``C'' one larger
Next, in the central processing unit 20, the comparison condition regarding the column value is generated as the condition regarding the key value of the index "ABC < key value <ABD". ” Convert to (
Step 102) indicates the search conditions for the index table 41. The central processing unit 20 searches the index table 41 of the memory 40 under this key value condition and obtains the read address of the searched data (step 1).
03).
インデクステーブル41は例えばトリー構造をとり、テ
ーブルを数段サーチすることによって該当読出しアドレ
スを得るようにする。インデクスを利用する検索それ自
体は周知であるので、こシでは、その詳細は省略する。The index table 41 has a tree structure, for example, and the corresponding read address is obtained by searching the table in several stages. Since the search itself using an index is well known, the details thereof will be omitted here.
次に、中央処理装W20は、インデクスサーチで得られ
た読出しアドレスで外部記憶装置150をアクセスし、
該当するデ−タを読み出す(ステップ104)。この読
み出されたデータが、即ち、パターンマツチ比較条件バ
カラム LIKE ABC%″に合致するデータであ
り、データ出力装置!60によって表示あるいはプリン
トアウトされる。Next, the central processing unit W20 accesses the external storage device 150 using the read address obtained by the index search,
The corresponding data is read out (step 104). This read data is data that matches the pattern match comparison condition "LIKE ABC%" and is displayed or printed out by the data output device !60.
第2図(b)はパターンマツチ比較条件として゛かラム
LIKE ABCXX”が指定された場合の処理手順
である6二−で、記号“′×”は1個の任意の文字を表
わし1条件″’ABCXX’″は、先頭3文字が”AB
C”で、それに続く2文字は任意の、データ長が5であ
るデータの検索を意味する。Figure 2(b) shows the processing procedure when "LIKE ABCXX" is specified as a pattern match comparison condition, where the symbol "'x" represents one arbitrary character, and the symbol "x" represents one arbitrary character. 'ABCXX'" means that the first 3 characters are "AB"
C'' and the following two characters mean searching for arbitrary data with a data length of 5.
第2図(b)において、ステップ201〜2゜4は第2
図(a)のステップ101〜104に対応するが、ステ
ップ201では、カラム値に関する比較条件として、デ
ータ値の範囲に関する条件”ABC≦カラム値<ABD
”の他に、データ長に関する条件”LENGTHCカラ
ム値)=5”を生成する。このうち1条件”ABC≦−
カラム値くABD″をインデクスのキー値に関する条件
“ABC<キー値<ABD”に変換しくステップ202
)。In FIG. 2(b), steps 201 to 2.4 are the second
Corresponding to steps 101 to 104 in FIG.
In addition to ", a condition regarding data length "LENGTHC column value) = 5" is generated. One of these conditions is "ABC≦-
Step 202: Convert the column value "ABD" to the condition "ABC<key value<ABD" regarding the index key value.
).
このキー値条件によるインデクスサーチによって被検索
データの読出しアドレスを得(ステップ203)、該当
するデータを読み出す(ステップ204)。次に、この
読み出されたデータから、ステップ202で生成したデ
ータ長に関する条件”LENGTHCカラム値)=5”
により該当範囲のデータを取り出すと、該データがパタ
ーンマツチ比較条件バカラム LIKE ABCXX”
に合致するデータを示すことになる(ステップ205)
。The read address of the searched data is obtained by index search based on this key value condition (step 203), and the corresponding data is read out (step 204). Next, from this read data, the condition regarding the data length generated in step 202 "LENGTHC column value) = 5"
When data in the corresponding range is retrieved by , the data matches the pattern match comparison condition
(Step 205)
.
以上のように1本発明ではパターンマツチ比較を使わず
に、インデクスサーチだけで、あるいはインデクスサー
チとデータ長のチェックだけで。As described above, the present invention does not use pattern match comparison, but uses only index search, or only index search and data length check.
検索処理を行うことができる。Search processing can be performed.
本発明によれば、前方一致パターンマツチ比較条件を持
つ検索において、パターンマツチ比較条件をデータの大
小比較条件に置きかえることにより、パターンマツチ比
較を行うことなく該当するデータを取出すことができる
ので、データ検索処理効率が向上するという効果がある
。According to the present invention, by replacing the pattern match comparison condition with the data size comparison condition in a search that has a prefix pattern match comparison condition, it is possible to retrieve the corresponding data without performing a pattern match comparison. This has the effect of improving search processing efficiency.
第1図は本発明で対象とするデータ検索シテスムの全体
ブロック図、第2図(a)及び(b)は本発明のデータ
検索方式を説明する処理フロー図。
第3図は関係データベースを説明する図である。
10・・・データ入力装置、 20・・・中央処理装
置。
30・・・メモリ (ROM)、 40・・・メモ
リ (RAM)、 41・・・インデクステーブル
。
50・・・外部記憶装置、 60・・・データ出力装
置。
第1図
第3図FIG. 1 is an overall block diagram of a data search system targeted by the present invention, and FIGS. 2(a) and 2(b) are process flow diagrams illustrating the data search system of the present invention. FIG. 3 is a diagram illustrating a relational database. 10...Data input device, 20...Central processing unit. 30...Memory (ROM), 40...Memory (RAM), 41...Index table. 50... External storage device, 60... Data output device. Figure 1 Figure 3
Claims (1)
索する方式において、パターンマッチ比較の条件をイン
デクスのキー値に関する条件に変換し、該キー値条件に
よりインデクステーブルをサーチし、その結果によって
被検索データより該当データを取り出すことを特徴とす
るデータ検索方式。(1) In a method of searching data using a pattern match comparison of prefix matches, the condition of the pattern match comparison is converted into a condition regarding the key value of the index, the index table is searched according to the key value condition, and the searched data is searched based on the result. A data search method characterized by retrieving more relevant data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP59264070A JPS61141036A (en) | 1984-12-14 | 1984-12-14 | Data retrieval system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP59264070A JPS61141036A (en) | 1984-12-14 | 1984-12-14 | Data retrieval system |
Publications (1)
Publication Number | Publication Date |
---|---|
JPS61141036A true JPS61141036A (en) | 1986-06-28 |
Family
ID=17398097
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP59264070A Pending JPS61141036A (en) | 1984-12-14 | 1984-12-14 | Data retrieval system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPS61141036A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH01180632A (en) * | 1988-01-12 | 1989-07-18 | Nec Corp | Record retrieving system |
JPH01276224A (en) * | 1988-04-27 | 1989-11-06 | Nippon Telegr & Teleph Corp <Ntt> | Data counter |
JPH03198154A (en) * | 1989-12-20 | 1991-08-29 | Northern Telecom Ltd | Character sequence verifying apparatus |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS56137468A (en) * | 1980-03-27 | 1981-10-27 | Sanyo Electric Co Ltd | Retrieval system of information |
JPS5850044A (en) * | 1981-09-10 | 1983-03-24 | Fujitsu Ltd | Retrieval processing system for index record |
-
1984
- 1984-12-14 JP JP59264070A patent/JPS61141036A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS56137468A (en) * | 1980-03-27 | 1981-10-27 | Sanyo Electric Co Ltd | Retrieval system of information |
JPS5850044A (en) * | 1981-09-10 | 1983-03-24 | Fujitsu Ltd | Retrieval processing system for index record |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH01180632A (en) * | 1988-01-12 | 1989-07-18 | Nec Corp | Record retrieving system |
JPH01276224A (en) * | 1988-04-27 | 1989-11-06 | Nippon Telegr & Teleph Corp <Ntt> | Data counter |
JPH03198154A (en) * | 1989-12-20 | 1991-08-29 | Northern Telecom Ltd | Character sequence verifying apparatus |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3672242B2 (en) | PATTERN SEARCH METHOD, PATTERN SEARCH DEVICE, COMPUTER PROGRAM, AND STORAGE MEDIUM | |
US8095526B2 (en) | Efficient retrieval of variable-length character string data | |
JPH09245043A (en) | Information retrieval device | |
CN105404677A (en) | Tree structure based retrieval method | |
JP3258063B2 (en) | Database search system and method | |
US20110137912A1 (en) | System, method and computer program product for documents retrieval | |
JPS61141036A (en) | Data retrieval system | |
JP3151730B2 (en) | Database search system | |
CN105426490A (en) | Tree structure based indexing method | |
KR102613523B1 (en) | In-memory efficient multistep search | |
JPS617936A (en) | Information retrieving system | |
JP2001092841A (en) | Cluster analyzing and processing method and recording medium having cluster analyzing program recorded thereon | |
JP2000322416A (en) | Document retrieving device | |
JP3259781B2 (en) | Database search system and database search method | |
KR20190139227A (en) | System and method for creating a filter for K-match matching | |
JPH05135102A (en) | Document retrieval system | |
JPH06162096A (en) | Record retrieval method | |
JPH0423167A (en) | Command retrieving system | |
JPS60168233A (en) | Word dictionary device | |
JPH0452967A (en) | And operation processing system for set file | |
JPH0546663A (en) | Key word retrieval system | |
JP3104893B2 (en) | Information retrieval method | |
JPH05128154A (en) | Database retrieval system | |
JPH1097542A (en) | Full-text retrieval device and method therefor | |
JPH0232468A (en) | Character string data retrieving system |