JPH07244602A - Data base retrieval processing system - Google Patents

Data base retrieval processing system

Info

Publication number
JPH07244602A
JPH07244602A JP6035574A JP3557494A JPH07244602A JP H07244602 A JPH07244602 A JP H07244602A JP 6035574 A JP6035574 A JP 6035574A JP 3557494 A JP3557494 A JP 3557494A JP H07244602 A JPH07244602 A JP H07244602A
Authority
JP
Japan
Prior art keywords
search condition
expression
conversion means
search
tree
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.)
Granted
Application number
JP6035574A
Other languages
Japanese (ja)
Other versions
JP3322749B2 (en
Inventor
Shinichirou Kamimaru
真一郎 紙丸
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.)
PFU Ltd
Original Assignee
PFU 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 PFU Ltd filed Critical PFU Ltd
Priority to JP03557494A priority Critical patent/JP3322749B2/en
Publication of JPH07244602A publication Critical patent/JPH07244602A/en
Application granted granted Critical
Publication of JP3322749B2 publication Critical patent/JP3322749B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To perform high-speed retrieval processing according to small memory capacity as to the data base retrieval processing system which retrieves records filling a retrieval conditional expression in a data base. CONSTITUTION:This data base retrieval processing system is equipped with a 1st conversion means 21 which generates the search condition tree of tree structure by converting the search conditional expression represented in the reverse Polish form and a 2nd conversion means 22 which generates evaluation procedure information having a branch condition and a branch destination set in conditions by converting the search condition tree generated by the 1st conversion means 21, and retrieves the data base according to the evaluation procedure information generated by the 2nd conversion means 22.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、データベースの中から
探索条件式を充足するレコードを検索するデータベース
検索処理方式に関し、特に、小さなメモリ容量に従いつ
つ、高速な検索処理を実現するデータベース検索処理方
式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a database retrieval processing method for retrieving records satisfying a retrieval condition expression from a database, and more particularly to a database retrieval processing method for realizing high-speed retrieval processing in accordance with a small memory capacity. Regarding

【0002】[0002]

【従来の技術】従来のデータベース検索処理では、アク
セスパスの決定を簡単化し、評価処理を単純化するため
に、探索条件式をCNF(Conjunction Normal Form)に
変換する方法を採っている。
2. Description of the Related Art In a conventional database search process, a method of converting a search condition expression into a CNF (Conjunction Normal Form) is adopted in order to simplify the access path determination and the evaluation process.

【0003】すなわち、条件要素をPxyで表すならば、
探索条件式を、「(P11 or P12 or ・・・P1i)and
(P21 or P22 or ・・・P2j)and ・・・and (Pm1
orPm2 or ・・・Pmn)」というCNFに変換して、
このCNF表現の探索条件式に従ってデータベースを検
索するという方法を採っている。
That is, if the conditional element is represented by P xy ,
The search condition expression is “(P 11 or P 12 or ・ ・ ・ P 1i ) and
(P 21 or P 22 or ・ ・ ・ P 2j ) and ・ ・ ・ and (P m1
orP m2 or ... P mn ) "
The method of searching the database according to the search condition expression of this CNF expression is adopted.

【0004】例えば、図15(イ)に示されるような探
索条件式をCNF変換することで、図15(ロ)に示す
ようなCNF表現の探索条件式を生成して、このCNF
表現の探索条件式に従ってデータベースを検索するとい
う方法を採っている。ここで、図15(ロ)中の
「(o)」はOR条件、「(a)」はAND条件を表し
ている。
For example, by performing CNF conversion on the search condition expression as shown in FIG. 15B, a search condition expression having a CNF expression as shown in FIG.
The method is to search the database according to the expression search condition expression. Here, “(o)” in FIG. 15B represents an OR condition, and “(a)” represents an AND condition.

【0005】[0005]

【発明が解決しようとする課題】確かに、CNF表現の
探索条件式に従ってデータベースを検索する構成を採る
と、階層レベルが単一構成であることから、アクセスパ
スの決定が簡単で、評価処理が単純になるという特長が
ある。
Certainly, if the database is searched according to the search condition expression of the CNF expression, since the hierarchy level is a single structure, the access path can be easily determined and the evaluation processing can be performed. It has the feature of being simple.

【0006】すなわち、階層レベルが単一構成であるこ
とから、アクセスパスの決定が簡単であるとともに、あ
るOR内部の途中の条件要素で真であることが確認され
ると、そのOR内部の評価処理を終了して次のORに移
るとともに、あるOR内部の条件要素が全て偽であるこ
とが確認されると、そこで処理を終了すればよいことか
ら、評価処理が単純になる。
That is, since the hierarchy level has a single structure, it is easy to determine the access path, and if it is confirmed that the condition element in the middle of a certain OR is true, then the inside of the OR is evaluated. When the processing is ended and the operation is moved to the next OR, and when it is confirmed that all the conditional elements inside a certain OR are false, the processing may be ended at that point, so that the evaluation processing is simplified.

【0007】しかしながら、CNF表現の探索条件式に
従ってデータベースを検索する構成を採ると、同一の条
件要素が重複して生成されることが起こることから、メ
モリ使用量が増加するとともに、同じ条件要素を何回も
評価しなければならないことから、評価時間が増加する
という問題点がある。
However, if the database is searched according to the search condition expression of the CNF expression, the same condition element may be generated in duplicate, so that the memory usage increases and the same condition element is used. Since it has to be evaluated many times, there is a problem that the evaluation time increases.

【0008】図16に、3つを例にして、DNF表現
(CNF表現のand とorとが逆になる表現形式)で表さ
れる探索条件式をCNF表現に変換する際の条件要素数
の増加例を図示する。ここで、図中のはDNF表現の
探索条件式、はCNF表現に変換された探索条件式、
は変換後の条件要素数、は条件要素数の増加率を表
している。
FIG. 16 shows the number of conditional elements when converting a search conditional expression represented by DNF expression (an expression format in which and of or are opposite to each other in CNF expression) into CNF expression by taking three examples. An example of increase is illustrated. Here, in the figure is a search condition expression of DNF expression, is a search condition expression converted into CNF expression,
Represents the number of conditional elements after conversion, and represents the increase rate of the number of conditional elements.

【0009】一般に、CNF変換後の条件要素数は以下
の計算式に従って求められる。すなわち、
Generally, the number of conditional elements after CNF conversion is obtained according to the following formula. That is,

【0010】[0010]

【数1】 [Equation 1]

【0011】と定義すると、CNF変換後の条件要素数
N’、論理因子数Mi'は、
If defined as, the number of conditional elements N ′ and the number of logical factors Mi ′ after CNF conversion are

【0012】[0012]

【数2】 [Equation 2]

【0013】で求められることになる。例えば、図17
に示すようなDNF表現の探索条件式を例にして説明す
るならば、上記の式に従い、下線部分についての変換後
の論理因子数は、 (1*2*1)=2 と求められ、下線部分についての変換後の条件要素数
は、 2*(1/1+2/2+1/1)=6 と求められることから、この探索条件式全体の変換後の
条件要素数は、 [3*2*(4+2)]*[4/3+5/2+(4+6)/(4+2)]=198 となって、その増加率は、 198/17≒12倍 となる。
[0013] will be required. For example, in FIG.
If the search condition expression of the DNF expression as shown in is used as an example, according to the above expression, the number of logical factors after conversion for the underlined part is calculated as (1 * 2 * 1) = 2, and the underlined The number of conditional elements after conversion for the part is calculated as 2 * (1/1 + 2/2 + 1/1) = 6, so the number of conditional elements after conversion of the entire search conditional expression is [3 * 2 * ( 4 + 2)] * [4/3 + 5/2 + (4 + 6) / (4 + 2)] = 198, and the rate of increase is 198 / 17≈12 times.

【0014】このように、CNF表現の探索条件式に従
ってデータベースを検索する構成を採ると、同一の条件
要素が重複して生成されることが起こることから、メモ
リ使用量が増加するとともに、同じ条件要素を何回も評
価しなければならないことから、評価時間が増加すると
いう問題点がある。
In this way, if the database is searched according to the search condition expression of the CNF expression, the same condition element may be generated in duplicate, so that the memory usage increases and the same condition is increased. Since the element must be evaluated many times, there is a problem that the evaluation time increases.

【0015】本発明はかかる事情に鑑みてなされたもの
であって、小さなメモリ容量に従いつつ、高速な検索処
理を実現する新たなデータベース検索処理方式の提供を
目的とする。
The present invention has been made in view of the above circumstances, and an object of the present invention is to provide a new database search processing method which realizes high-speed search processing while complying with a small memory capacity.

【0016】[0016]

【課題を解決するための手段】図1に本発明の原理構成
を図示する。図中、1はデータベース、2は本発明によ
り構成されるデータベース検索装置であって、データベ
ース1の中から探索条件式を充足するレコードを検索す
るものである。
FIG. 1 shows the principle configuration of the present invention. In the figure, reference numeral 1 is a database, and 2 is a database search apparatus configured according to the present invention, which searches the database 1 for records that satisfy a search conditional expression.

【0017】このデータベース検索装置2は、逆ポーラ
ンド変換手段20と、第1の変換手段21と、第2の変
換手段22と、判断手段23と、第3の変換手段24
と、アクセス実行手段25とを備える。
The database search device 2 includes a reverse Polish conversion means 20, a first conversion means 21, a second conversion means 22, a judgment means 23, and a third conversion means 24.
And an access execution unit 25.

【0018】逆ポーランド変換手段20は、与えられた
探索条件式の文法検査を行って、その探索条件式を逆ポ
ーランド形式に変換する。第1の変換手段21は、逆ポ
ーランド形式に変換された探索条件式を変換すること
で、木構造の探索条件木を生成する。従来技術であれ
ば、図15(ロ)に示すようにCNF変換されていた探
索条件式を、図2に示すような木構造の探索条件木に変
換するのである。
The inverse Polish conversion means 20 performs a grammatical check on the given search conditional expression and converts the search conditional expression into the reverse Polish format. The first conversion unit 21 generates a search condition tree having a tree structure by converting the search condition expression converted into the reverse Polish format. In the conventional technique, the CNF-converted search condition expression as shown in FIG. 15B is converted into a tree-structured search condition tree as shown in FIG.

【0019】第2の変換手段22は、生成された探索条
件木を変換することで、条件に分岐条件と分岐先とを設
定した評価手順情報を生成する。判断手段23は、生成
された探索条件木の一部をCNFに変換するか否かを判
断する。
The second converting means 22 converts the generated search condition tree to generate the evaluation procedure information in which the branch condition and the branch destination are set in the condition. The determination means 23 determines whether or not to convert a part of the generated search condition tree into CNF.

【0020】第3の変換手段24は、判断手段23がC
NFへの変換を判断するときに、その判断対象となった
探索条件木部分をCNFに変換する。このとき、第3の
変換手段24は、生成されるCNF表現の探索条件式の
要素数が規定値以下にあることを条件にして、CNFへ
の変換処理を実行することがある。
In the third converting means 24, the judging means 23 is C
When determining the conversion to NF, the search condition tree portion that is the determination target is converted to CNF. At this time, the third conversion means 24 may execute the conversion processing to CNF on condition that the number of elements of the search condition expression of the generated CNF expression is equal to or less than the specified value.

【0021】アクセス実行手段25は、第2の変換手段
22の生成する評価手順情報に従ってデータベース1を
検索し、この検索処理にあって、第3の変換手段24が
局所的なCNF表現の探索条件式を生成するときには、
そのCNF表現の探索条件式を使ってデータベース1を
検索する。
The access executing means 25 searches the database 1 in accordance with the evaluation procedure information generated by the second converting means 22, and in this search processing, the third converting means 24 locally searches the CNF expression. When generating the expression,
The database 1 is searched using the search conditional expression of the CNF expression.

【0022】[0022]

【作用】本発明のデータベース検索装置2では、探索条
件式が与えられると、第1の変換手段21は、逆ポーラ
ンド形式に変換された探索条件式を変換することで、木
構造の探索条件木を生成する。このようにして生成され
た探索条件木は、探索条件式と等価な木構造を持つもの
であることから、条件要素の数も元々の探索条件式と同
じになる。
In the database searching apparatus 2 of the present invention, when the search condition expression is given, the first converting means 21 converts the search condition expression converted into the reverse Polish form, thereby searching the tree structure search condition tree. To generate. Since the search condition tree generated in this way has a tree structure equivalent to the search condition expression, the number of condition elements is also the same as the original search condition expression.

【0023】第1の変換手段21が探索条件木を生成す
ると、第2の変換手段22は、生成された探索条件木を
変換することで、条件に分岐条件と分岐先とを設定した
評価手順情報を生成し、アクセス実行手段25は、この
生成された評価手順情報に従ってデータベース1を検索
する。
When the first converting means 21 generates the search condition tree, the second converting means 22 converts the generated search condition tree to set the branch condition and the branch destination in the condition. The information is generated, and the access execution means 25 searches the database 1 according to the generated evaluation procedure information.

【0024】この処理にあって、判断手段23は、生成
された探索条件木に含まれる複数表の参照部分をCNF
に変換するときに、単一表のみを参照する論理項が生成
されるか否かを判断し、第3の変換手段24は、単一表
のみを参照する論理項の生成が判断されるときには、そ
の論理項の生成源となる探索条件木部分をCNFに変換
し、この局所的なCNF表現の探索条件式を受けて、ア
クセス実行手段25は、そのCNF表現の探索条件式を
評価手順情報と組み合わせて使いつつデータベース1を
検索する。
In this processing, the judging means 23 uses the CNFs of the reference parts of the plural tables included in the generated search condition tree.
When converting to, a third conversion unit 24 determines whether a logical term that refers to only a single table is generated, and when it is determined that a logical term that only refers to a single table is generated. , The search condition tree portion that is the generation source of the logical term is converted into CNF, and the access execution means 25 receives the search condition expression of this local CNF expression, and the access execution means 25 evaluates the search condition expression of the CNF expression. Database 1 is searched while being used in combination with.

【0025】ここで、アクセス実行手段25は、アクセ
スパスを決定するときには、木の深さが浅い部分のみを
対象とすることで効率良く必要な条件を抽出していくこ
とが可能である。
Here, when determining the access path, the access execution means 25 can efficiently extract the necessary conditions by targeting only the portion where the depth of the tree is shallow.

【0026】このようにして、本発明では、条件要素数
の増加を招くことなく、高速にデータベース1を検索で
きるようになる。
As described above, according to the present invention, the database 1 can be searched at high speed without increasing the number of conditional elements.

【0027】[0027]

【実施例】以下、実施例に従って本発明を詳細に説明す
る。先ず最初に、図3ないし図5に従って、第1の変換
手段21の実行する処理の一実施例について説明する。
EXAMPLES The present invention will be described in detail below with reference to examples. First, an embodiment of the processing executed by the first conversion means 21 will be described with reference to FIGS.

【0028】第1の変換手段21は、図1で説明したよ
うに、逆ポーランド形式で表現される探索条件式を変換
することで、木構造の探索条件木を生成する。すなわ
ち、ユーザから、図3(イ)に示すような探索条件式が
与えられ、公知技術に従って、この探索条件式が図3
(ロ)に示すような逆ポーランド形式に変換されると、
第1の変換手段21は、この逆ポーランド形式で表現さ
れる探索条件式を変換することで、図3(ハ)に示すよ
うな木構造の探索条件木を生成するのである。ここで、
図中の「(o)」はOR条件、「(a)」はAND条
件、「(n)」はNOT条件、上線は反転値を表してい
る。
As described with reference to FIG. 1, the first conversion means 21 converts the search condition expression expressed in the reverse Polish form to generate a search condition tree having a tree structure. That is, the user gives a search condition expression as shown in FIG. 3A, and this search condition expression is changed to that shown in FIG.
When converted to reverse Polish format as shown in (b),
The first conversion means 21 converts the search condition expression expressed in the inverse Polish form to generate a search condition tree having a tree structure as shown in FIG. 3C. here,
In the figure, “(o)” represents an OR condition, “(a)” represents an AND condition, “(n)” represents a NOT condition, and the upper line represents an inverted value.

【0029】このようにして生成される探索条件木は、
図3(イ)と図3(ハ)とを比較すれば分かるように、
探索条件式と等価な木構造を持つことで、探索条件式と
同一の数の条件要素を持つものである。そして、図3
(ハ)から分かるように、AND条件とOR条件とが交
互に繰り返される階層構造を持つものである。
The search condition tree generated in this way is
As can be seen by comparing FIG. 3 (a) and FIG. 3 (c),
By having a tree structure equivalent to the search conditional expression, it has the same number of conditional elements as the search conditional expression. And FIG.
As can be seen from (C), it has a hierarchical structure in which AND conditions and OR conditions are alternately repeated.

【0030】図4に、この変換処理を実現するために第
1の変換手段21が実行する処理フローの一実施例を図
示する。次に、この処理フローについて詳細に説明す
る。第1の変換手段21は、変換処理に入ると、図4の
処理フローに示すように、先ず最初に、ステップ1で、
処理対象となる逆ポーランド形式の探索条件要素が論理
演算子であるのか条件要素であるのかを判断する。
FIG. 4 shows an example of a processing flow executed by the first conversion means 21 in order to realize this conversion processing. Next, this processing flow will be described in detail. When the first conversion means 21 enters the conversion processing, as shown in the processing flow of FIG. 4, first, in step 1,
It is determined whether the reverse Polish type search condition element to be processed is a logical operator or a conditional element.

【0031】このステップ1で、処理対象となる逆ポー
ランド形式の探索条件要素が条件要素であることを判断
するときには、ステップ2に進んで、その条件要素を指
すポインタを用意されるスタックに積み、続くステップ
3で、逆ポーランド形式の探索条件に次要素があるか否
かを判断して、次要素があることを判断するときにはス
テップ1に戻る。
When it is determined in step 1 that the reverse Polish type search condition element to be processed is a condition element, the process proceeds to step 2, and a pointer pointing to the condition element is stacked on the prepared stack, In the following step 3, it is judged whether or not there is a next element in the reverse Polish type search condition. When it is judged that there is a next element, the process returns to step 1.

【0032】一方、ステップ1で、処理対象となる逆ポ
ーランド形式の探索条件要素が論理演算子であることを
判断するときには、ステップ4に進んで、その論理演算
子が「NOT」であるのか、それ以外の「AND/O
R」であるのかを判断する。
On the other hand, when it is determined in step 1 that the search condition element of the reverse Polish type to be processed is a logical operator, the process proceeds to step 4, and whether the logical operator is "NOT", Other than that, "AND / O
R "is determined.

【0033】このステップ4で、処理対象となる逆ポー
ランド形式の探索条件要素が論理演算子「NOT」であ
ることを判断するときには、ステップ5に進んで、スタ
ックより1要素取り出し、続くステップ6で、取り出し
た要素の持つ論理演算子及び条件要素の条件を反転して
からスタックに積み、続くステップ3で、逆ポーランド
形式の探索条件に次要素があるか否かを判断して、次要
素があることを判断するときにはステップ1に戻る。
When it is determined in step 4 that the reverse Polish type search condition element to be processed is the logical operator "NOT", the process proceeds to step 5, one element is taken out from the stack, and in the following step 6. , The logical operator of the fetched element and the condition of the conditional element are inverted and then stacked on the stack, and in the subsequent step 3, it is determined whether or not there is a next element in the reverse Polish type search condition, and the next element is When it is determined that there is one, the process returns to step 1.

【0034】一方、ステップ4で、処理対象となる逆ポ
ーランド形式の探索条件要素が論理演算子「AND/O
R」であることを判断するときには、ステップ7に進ん
で、スタックより2要素取り出し、続くステップ8で、
取り出した第1スタック要素(前にスタックされた要
素)と、処理対象の論理演算子とが異種の論理演算子で
あるのか、それ以外であるのかを判断するとともに、取
り出した第2スタック要素(後にスタックされた要素)
と、処理対象の論理演算子とが異種の論理演算子である
のか、それ以外であるのかを判断する。ここで、取り出
したスタック要素が条件要素である場合には、異種の論
理演算子ではないものと判断するものとする。
On the other hand, in step 4, the reverse Polish type search condition element to be processed is the logical operator "AND / O".
If it is determined to be “R”, the process proceeds to step 7, two elements are taken out from the stack, and in step 8,
It is determined whether the extracted first stack element (previously stacked element) and the logical operator to be processed are different kinds of logical operators or other logical operators, and the extracted second stack element ( Elements stacked later)
And whether the logical operator to be processed is a different type of logical operator or not. If the fetched stack element is a conditional element, it is determined that it is not a different type of logical operator.

【0035】このステップ8で、異種の論理演算子であ
ることを判断するとき、すなわち、「AND」と「O
R」という異種の論理演算子であることを判断するとき
には、ステップ9に進んで、論理演算の順序を規定すべ
く取り出したスタック要素に節を作成し、続くステップ
10で、取り出した第1スタック要素と第2スタック要
素とを連結してからスタックに積み、続くステップ3
で、逆ポーランド形式の探索条件に次要素があるか否か
を判断して、次要素があることを判断するときにはステ
ップ1に戻る。
In this step 8, when it is judged that they are different kinds of logical operators, that is, "AND" and "O".
When it is determined that it is a different type of logical operator "R", the process proceeds to step 9, a node is created in the extracted stack element to define the order of the logical operation, and in step 10, the extracted first stack Connect the elements and the second stack element before stacking them, then step 3
Then, it is determined whether or not there is a next element in the reverse Polish format search condition, and when it is determined that there is a next element, the process returns to step 1.

【0036】一方、ステップ8で、異種の論理演算子で
ないことを判断するときには、節を作成することなくス
テップ10に進んで、取り出した第1スタック要素と第
2スタック要素とを連結してからスタックに積み、続く
ステップ3で、逆ポーランド形式の探索条件に次要素が
あるか否かを判断して、次要素があることを判断すると
きにはステップ1に戻る。
On the other hand, when it is determined in step 8 that the logical operator is not a different type of logical operator, the process proceeds to step 10 without creating a clause, and the extracted first stack element and second stack element are concatenated. In a succeeding step 3, it is judged whether or not there is a next element in the reverse Polish type search condition. When it is judged that there is a next element, the process returns to step 1.

【0037】このようにして、ステップ1ないしステッ
プ10の処理を繰り返していくときに、ステップ3で、
逆ポーランド形式の探索条件に次要素がなくなったこと
を判断すると、ステップ11に進んで、スタックから取
り出した最後の要素が論理演算子「OR」であるのか、
それ以外であるのかを判断して、それ以外であることを
判断するとき、すなわち、スタックから取り出した最後
の要素が条件要素か、論理演算子「AND」であること
を判断するときには、ステップ13に進んで、論理演算
子「AND」の根を作成して探索条件木の作成処理を終
了する。
In this way, when repeating the processing of steps 1 to 10, in step 3,
If it is determined that there is no next element in the search condition in the reverse Polish format, the process proceeds to step 11, and whether the last element extracted from the stack is the logical operator “OR”,
When it is determined whether it is other than that, and when it is determined that it is other than that, that is, when the last element fetched from the stack is the conditional element or the logical operator “AND”, step 13 Then, the process proceeds to the step of creating the root of the logical operator "AND" and ends the search condition tree creation process.

【0038】一方、ステップ11で、スタックから取り
出した最後の要素が論理演算子「OR」であることを判
断するときには、ステップ12で節を作成してから、ス
テップ13に進んで、論理演算子「AND」の根を作成
して探索条件木の作成処理を終了する。
On the other hand, when it is determined in step 11 that the last element taken out from the stack is the logical operator "OR", a clause is created in step 12, and then the process proceeds to step 13 to proceed to the logical operator. The root of "AND" is created, and the search condition tree creation process ends.

【0039】図5に、図3(ロ)の逆ポーランド形式表
現の探索条件式から、図3(ハ)の探索条件木への変換
処理過程を図示する。ここで、図5(イ)は、図3
(ロ)中の(1) の時点の処理に対応し、図5(ロ)は、
(2) の時点の処理に対応し、図5(ハ)は、(3) の時点
の処理に対応し、図5(ニ)は、(4) の時点の処理に対
応し、図5(ホ)は、(5) の時点の処理に対応し、図5
(ヘ)は、(6) の時点の処理に対応する。
FIG. 5 illustrates a process of converting the search condition expression of the inverse Polish format expression of FIG. 3B into the search condition tree of FIG. 3C. Here, FIG.
Corresponding to the processing at time (1) in (b), FIG.
5 (c) corresponds to the processing at the time (3), FIG. 5 (d) corresponds to the processing at the time (4), and FIG. 5) corresponds to the processing at the time of (5), and
(F) corresponds to the processing at the time of (6).

【0040】すなわち、第1の変換手段21は、図3
(ロ)の逆ポーランド形式表現の探索条件式が与えられ
ると、図5の(イ)に示すように、条件要素ならば、ス
タックに積み、(ロ)に示すように、同種の論理演算子
ならば、スタックから2要素取り出して連結してスタッ
クに積み、(ハ)に示すように、異種の論理演算子なら
ば、スタックから2要素取り出し節を作成してから連結
してスタックに積み、(ニ)に示すように、論理演算子
「NOT」ならば、スタックから1要素取り出して反転
してスタックに積み、(ホ)に示すように、最後に、論
理演算子「AND」の根を作成していくことで、(ヘ)
の探索条件木を生成していくのである。
That is, the first converting means 21 is the same as that shown in FIG.
When the search condition expression of the reverse Polish form expression of (b) is given, as shown in (a) of FIG. 5, if it is a conditional element, it is stacked on the stack, and as shown in (b), the same type of logical operator Then, take out two elements from the stack, connect them, and stack them on the stack. As shown in (c), if the logical operators are different, create a two-element extract clause from the stack, connect them, and stack them on the stack. As shown in (d), if the logical operator is “NOT”, one element is taken from the stack, inverted, and stacked on the stack. Finally, as shown in (e), the root of the logical operator “AND” is added. By creating, (f)
The search condition tree of is generated.

【0041】このようにして、第1の変換手段21は、
逆ポーランド形式で表現される探索条件式を変換するこ
とで、木構造の探索条件木を生成していくよう処理す
る。なお、探索条件木の根をAND条件にするのは、ア
クセスパスの決定に有利だからである。
In this way, the first converting means 21
Processing is performed so as to generate a search condition tree having a tree structure by converting a search condition expression expressed in reverse Polish format. The reason why the AND condition is used as the root of the search condition tree is advantageous in determining the access path.

【0042】次に、図6ないし図11に従って、第2の
変換手段22の実行する処理の一実施例について説明す
る。第2の変換手段22は、図1で説明したように、生
成された探索条件木を変換することで、条件に分岐条件
と分岐先とを設定した評価手順情報を生成する。
Next, one embodiment of the processing executed by the second conversion means 22 will be described with reference to FIGS. As described with reference to FIG. 1, the second conversion unit 22 converts the generated search condition tree to generate the evaluation procedure information in which the branch condition and the branch destination are set in the condition.

【0043】すなわち、図6(イ)に示すような木構造
の探索条件木が生成されると、第2の変換手段22は、
この探索条件木を変換することで、図6(ロ)に示すよ
うな評価手順情報を生成するのである。ここで、図中の
実線は真分岐、破線は偽分岐を表している。
That is, when a tree-structured search condition tree as shown in FIG. 6A is generated, the second conversion means 22
By converting this search condition tree, the evaluation procedure information as shown in FIG. 6B is generated. Here, the solid line in the figure represents a true branch, and the broken line represents a false branch.

【0044】このようにして生成される評価手順情報
は、条件に分岐条件と分岐先とを設定したものであるこ
とから、図1で説明したアクセス実行手段は、この評価
手順情報に従って、高速にデータベース1を検索できる
ようになる。
Since the evaluation procedure information generated in this way is such that branch conditions and branch destinations are set as conditions, the access execution means described in FIG. The database 1 can be searched.

【0045】図7に、この変換処理を実現するために第
2の変換手段22が実行する処理フローの一実施例を図
示する。次に、この処理フローについて詳細に説明す
る。第2の変換手段22は、探索条件木が与えられて変
換処理に入ると、図7の処理フローに示すように、先ず
最初に、ステップ1で、用意される次処理スタック(次
に処理すべき要素を指すポインタをスタックしていくも
の)にNULLポインタ/先頭要素ポインタを積むとと
もに、分岐レベルLj の値を“0”にリセットする。
FIG. 7 shows an embodiment of a processing flow executed by the second conversion means 22 to realize this conversion processing. Next, this processing flow will be described in detail. When the search condition tree is given and the conversion processing is started, the second conversion means 22 firstly, as shown in the processing flow of FIG. A NULL pointer / top element pointer is stacked on the stack (a pointer pointing to a power element), and the value of the branch level Lj is reset to "0".

【0046】次に、ステップ2で、次処理スタックから
1つ要素(以下、この取り出した要素を対象要素と呼
ぶ)を取り出して、その対象要素のポインタがNULL
ポインタであるか否か判断し、NULLポインタでない
ことを判断すると、続くステップ3で、対象要素の同レ
ベルに次要素があるか否かを判断する。すなわち、対象
要素の位置する探索条件木の右側同一レベルに次要素が
あるか否かを判断するのである。
Next, at step 2, one element (hereinafter, this taken-out element is called a target element) is taken out from the next processing stack, and the pointer of the target element is NULL.
If it is determined whether or not it is a pointer and it is determined that it is not a NULL pointer, it is determined in the following step 3 whether or not there is a next element at the same level as the target element. That is, it is determined whether or not there is a next element on the same level on the right side of the search condition tree where the target element is located.

【0047】このステップ3で、次要素があることを判
断するときには、ステップ4に進んで、次処理スタック
にその次要素のポインタを積む。続いて、ステップ5
で、対象要素が論理演算子であるのか条件要素であるの
かを判断して、論理演算子であることを判断するときに
は、ステップ6に進んで、分岐レベルLj の値を1つカ
ウントアップし、続くステップ7で、対象要素の下位要
素のポインタを次処理スタックに積んでからステップ2
に戻っていく。
When it is determined in step 3 that there is a next element, the process proceeds to step 4 and the pointer of the next element is loaded on the next processing stack. Then, step 5
Then, it is determined whether the target element is a logical operator or a conditional element, and when it is determined that the target element is a logical operator, the process proceeds to step 6, and the value of the branch level Lj is incremented by 1, In the following step 7, the pointer of the lower element of the target element is stacked on the next processing stack, and then step 2
Go back to.

【0048】このようにして、探索条件木を右に辿りな
がら、論理演算子があるときは、探索条件木を下にと辿
っていくのである。一方、ステップ5で、対象要素が条
件要素であることを判断するときには、ステップ8に進
んで、分岐レベルLj が偶数であるのか奇数であるのか
を判断する。この分岐レベルLj は、この図7の処理フ
ローの実行に従い、AND項の途中の条件要素と、OR
項の最後の条件要素とで偶数を示すとともに、AND項
の最後の条件要素と、OR項の途中の条件要素とで奇数
を示すことから、このステップ8では、対象要素の条件
要素が、どちらの条件要素であるのかを判断するのであ
る。
In this way, when there is a logical operator while tracing the search condition tree to the right, the search condition tree is traced downward. On the other hand, when it is determined in step 5 that the target element is a conditional element, the process proceeds to step 8 and it is determined whether the branch level Lj is an even number or an odd number. According to the execution of the processing flow of FIG. 7, the branch level Lj is equal to the condition element in the middle of the AND term and OR.
Since the last conditional element of the term indicates an even number and the last conditional element of the AND term and a conditional element in the middle of the OR term indicate an odd number, in this step 8, the conditional element of the target element is It is determined whether it is a condition element of.

【0049】このステップ8で、分岐レベルLj が偶数
であることを判断するとき、すなわち、対象要素の条件
要素が、AND項の途中の条件要素か、OR項の最後の
条件要素であることを判断するときには、ステップ9に
進んで、偽のときに分岐するように判定を行う。すなわ
ち、図8及び図9に一例を示すように、AND項の途中
の条件要素が偽であるときには、それ以降の同一AND
項内の条件要素については評価する必要がないととも
に、OR項の全ての条件要素が偽であるときには、その
OR項とAND条件で連結する他のOR項については評
価する必要がないことから、分岐するように判定を行う
のである。
In this step 8, when it is judged that the branch level Lj is an even number, that is, the condition element of the target element is a condition element in the middle of the AND term or the last condition element of the OR term. When making a determination, the process proceeds to step 9, and when it is false, the determination is made so as to branch. That is, as shown in an example in FIG. 8 and FIG. 9, when the condition element in the middle of the AND term is false, the same AND after that
Since it is not necessary to evaluate the conditional element in the term, and when all the conditional elements of the OR term are false, it is not necessary to evaluate the other OR terms connected with the OR term by the AND condition. The decision is made so as to branch.

【0050】一方、ステップ8で、分岐レベルLj が奇
数であることを判断するとき、すなわち、対象要素の条
件要素が、AND項の最後の条件要素か、OR項の途中
の条件要素であることを判断するときには、ステップ1
0に進んで、真のときに分岐するように判定を行う。す
なわち、図8及び図9に一例を示すように、AND項の
最後の条件要素が真であるときには、そのAND項とO
R条件で連結する他のAND項については評価する必要
がないとともに、OR項の途中の条件要素が真であると
きには、それ以降の同一OR項内の条件要素については
評価する必要がないことから、分岐するように判定を行
うのである。
On the other hand, when it is judged in step 8 that the branching level Lj is an odd number, that is, the condition element of the target element is the last condition element of the AND term or the condition element in the middle of the OR term. Step 1
Go to 0 and make a decision so that it branches when true. That is, as shown in an example in FIGS. 8 and 9, when the last conditional element of the AND term is true, the AND term and O
Since it is not necessary to evaluate other AND terms connected by the R condition, and when a conditional element in the middle of the OR term is true, it is not necessary to evaluate subsequent conditional elements in the same OR term. , So that it is branched.

【0051】ステップ9/ステップ10での処理を終了
すると、続いて、ステップ11で、分岐レベルLj を識
別子として分岐情報を記憶する。すなわち、分岐先とし
て、分岐レベルLj の値を仮に設定するのである。
When the processing in step 9 / step 10 is completed, subsequently, in step 11, branch information is stored using the branch level Lj as an identifier. That is, the value of the branch level Lj is provisionally set as the branch destination.

【0052】続いて、ステップ12で、対象要素の同レ
ベルに次要素があるか否かを判断して、次要素があるこ
とを判断するときには、ステップ2に戻り、次要素がな
いことを判断するときには、ステップ13に進んで、分
岐レベル(Lj +1)を識別子とした分岐情報の解決点
を設定する。すなわち、分岐レベル(Lj +1)の識別
子を持つ分岐情報を現在処理中の条件要素の所に接続す
るのである。後述するように、対象要素の同レベルに次
要素がないときには、分岐レベルLj の値を1つカウン
トダウンすることから、図8及び図9に一例を示すよう
に、分岐レベル(Lj +1)の識別子を持つ分岐情報を
現在処理中の条件要素の所に接続することで、分岐情報
の解決点を設定するのである。
Subsequently, in step 12, it is judged whether or not there is a next element at the same level as the target element. When it is judged that there is a next element, the process returns to step 2 and it is judged that there is no next element. When doing so, the process proceeds to step 13 and the solution point of the branch information with the branch level (Lj + 1) as the identifier is set. That is, the branch information having the branch level (Lj + 1) identifier is connected to the condition element currently being processed. As will be described later, when there is no next element at the same level as the target element, the value of the branch level Lj is decremented by one, so as shown in an example in FIGS. 8 and 9, the identifier of the branch level (Lj + 1). The solution point of the branch information is set by connecting the branch information having with to the condition element currently being processed.

【0053】一方、ステップ3で、対象要素の同レベル
に次要素がないことを判断するときには、探索条件木を
上に戻っていく必要があることから、分岐レベルLj の
値を1つカウントダウンしていく必要がある。このとき
には、続くステップ14で、対象要素が論理演算子であ
るのか条件要素であるのかを判断して、条件要素である
ことを判断するときには、ステップ15に進んで、分岐
レベルLj の値を1つカウントダウンするのであるが、
このカウントダウン処理により分岐レベルLjの値が
“−1”となることがあるので、このときには、“0”
にセットしていく。そして、このステップ15での処理
を終了すると、上述したステップ8の処理に進んでい
く。
On the other hand, when it is determined in step 3 that there is no next element at the same level as the target element, it is necessary to return to the upper part of the search condition tree. Therefore, the branch level Lj is counted down by one. Need to go. At this time, in the following step 14, it is determined whether the target element is a logical operator or a conditional element. When it is determined that the target element is a conditional element, the process proceeds to step 15 to set the value of the branch level Lj to 1 One counts down,
Since the value of the branch level Lj may become "-1" by this countdown processing, at this time, "0"
To set. When the process in step 15 is completed, the process proceeds to step 8 described above.

【0054】一方、ステップ14で、対象要素が論理演
算子であることを判断するときには、ステップ16に進
んで、分岐レベルLj の値を1つカウントダウンするの
であるが、このカウントダウン処理により分岐レベルL
j の値が“−1”となることがあるので、このときに
は、偶数と奇数とが入れ替わらないようにするために、
“0”ではなくて“+1”にセットしていく。そして、
このステップ16での処理を終了すると、上述したステ
ップ7の処理に進んでいく。
On the other hand, when it is determined in step 14 that the target element is a logical operator, the process proceeds to step 16 and the branch level Lj is counted down by one.
Since the value of j may be "-1", at this time, in order to prevent even numbers and odd numbers from being interchanged,
Set to "+1" instead of "0". And
When the process in step 16 is completed, the process proceeds to step 7 described above.

【0055】そして、ステップ2で、次処理スタックか
ら取り出した対象要素のポインタがNULLポインタで
あることを判断するときには、ステップ17に進んで、
分岐しない場合を真とし、“0”の値を示す分岐レベル
Lj を識別子とした分岐情報の解決点を設定して、この
場合を偽とすることで、評価手順情報の作成処理を終了
する。
When it is determined in step 2 that the pointer of the target element extracted from the next processing stack is the NULL pointer, the process proceeds to step 17,
The process of creating the evaluation procedure information is completed by setting the case where no branch is made as true, setting the solution point of the branch information with the branch level Lj indicating the value of "0" as the identifier, and making this case false.

【0056】図10及び図11に、図6(イ)の探索条
件木から、図6(ロ)の評価手順情報への変換処理過程
を図示する。ここで、図10(イ)は、図6(ロ)中の
(1)の時点の処理に対応し、図10(ロ)は、(2) の時
点の処理に対応し、図10(ハ)は、(3) の時点の処理
に対応し、図10(ニ)は、(4) の時点の処理に対応
し、図10(ホ)は、(5) の時点の処理に対応し、図1
0(ヘ)は、(6) の時点の処理に対応し、図10(ト)
は、(7) の時点の処理に対応し、図11(チ)は、(8)
の時点の処理に対応し、図11(リ)は、(9) の時点の
処理に対応し、図11(ヌ)は、(10)の時点の処理に対
応し、図11(ル)は、(11)の時点の処理に対応し、図
11(ヲ)は、評価手順情報の作成終了時点の処理に対
応する。
FIGS. 10 and 11 show the process of converting the search condition tree of FIG. 6A into the evaluation procedure information of FIG. 6B. Here, FIG. 10 (a) corresponds to FIG. 6 (b).
10 (b) corresponds to the processing at the time (2), FIG. 10 (c) corresponds to the processing at the time (3), and FIG. (D) corresponds to the processing at the time (4), and FIG. 10 (e) corresponds to the processing at the time (5).
0 (f) corresponds to the processing at the time of (6), and is shown in FIG.
Corresponds to the processing at the time of (7), and FIG.
11 (i) corresponds to the processing at time (9), FIG. 11 (nu) corresponds to the processing at time (10), and FIG. , (11), and FIG. 11 (wo) corresponds to the processing at the end of creation of the evaluation procedure information.

【0057】すなわち、第2の変換手段22は、図6
(イ)の探索条件木が与えられると、図10の(イ)に
示すように、初期処理として、次処理スタックにNUL
Lポインタ/先頭要素ポインタを積んで、分岐レベルL
j の値を“0”にリセットし、(ロ)に示すように、対
象要素の同レベルの次要素のポインタを次処理スタック
に積んで、分岐レベルLj の値が“0”であることか
ら、条件判定が偽のときに分岐してその分岐情報の識別
子を“00”とし、(ハ)に示すように、対象要素の同
レベルの次要素のポインタをスタックに積んで、分岐レ
ベルLj の値を1つカウントアップするとともに、下位
要素のポインタを次処理スタックに積む。
That is, the second converting means 22 is the same as that shown in FIG.
When the search condition tree of (A) is given, as shown in (A) of FIG.
Branch level L by stacking L pointer / first element pointer
Since the value of j is reset to "0" and the pointer of the next element at the same level as the target element is stacked on the next processing stack as shown in (b), the value of the branch level Lj is "0". , When the condition determination is false, the branch is performed and the identifier of the branch information is set to “00”. As shown in (C), the pointer of the next element at the same level as the target element is stacked on the stack, and the branch level Lj The value is incremented by 1, and the pointer of the lower element is stacked on the next processing stack.

【0058】そして、(ニ)に示すように、対象要素の
同レベルの次要素のポインタをスタックに積んで、分岐
レベルLj の値が“2”であることから、条件判定が偽
のときに分岐してその分岐情報の識別子を“02”と
し、(ホ)に示すように、対象要素の同レベルの次要素
がないので、分岐レベルLj の値を1つカウントダウン
し、そのカウントダウンした分岐レベルLj が“1”で
あることから、条件判定が真のときに分岐してその分岐
情報の識別子を“01”とするとともに、“02”の識
別子を持つ分岐情報の解決点を設定し、(ト)に示すよ
うに、対象要素の同レベルの次要素がないので、分岐レ
ベルLj の値を1つカウントダウンして、下位要素のポ
インタを次処理スタックに積む。
Then, as shown in (d), the pointer of the next element at the same level as the target element is stacked on the stack, and the value of the branch level Lj is "2". After branching, the identifier of the branch information is set to “02”, and as shown in (e), since there is no next element at the same level as the target element, the value of the branch level Lj is counted down by one and the counted down branch level. Since Lj is "1", when the condition determination is true, the branch is performed and the identifier of the branch information is set to "01", and the solution point of the branch information having the identifier of "02" is set. As shown in (g), since there is no next element at the same level as the target element, the value of the branch level Lj is counted down by one and the pointer of the lower element is stacked on the next processing stack.

【0059】そして、図11の(チ)に示すように、対
象要素の同レベルの次要素がないので、分岐レベルLj
の値を1つカウントダウンするが、その値が“−1”と
なることから、分岐レベルLj の値を“0”として、下
位要素のポインタを次処理スタックに積み、(ヌ)に示
すように、対象要素の同レベルの次要素がないので、分
岐レベルLj の値を1つカウントダウンするが、その値
が“−1”となることから、分岐レベルLj の値を
“1”として、下位要素のポインタを次処理スタックに
積み、(ヲ)に示すように、対象要素がNULLポイン
タなので、分岐しない場合を真とし、“00”の識別子
を持つ分岐情報の解決点を設定して偽としていくこと
で、評価手順情報を生成していくのである。
As shown in (h) of FIG. 11, since there is no next element at the same level as the target element, the branch level Lj
However, since the value becomes "-1", the value of the branch level Lj is set to "0", the pointer of the lower element is stacked on the next processing stack, and as shown in (nu). Since there is no next element at the same level as the target element, the value of the branch level Lj is counted down by one, but since the value becomes "-1", the value of the branch level Lj is set to "1" and the lower element Is stacked on the next processing stack, and the target element is a NULL pointer as shown in (o), so that the case where no branch is made is true, and the solution point of the branch information having the identifier of "00" is set to be false. Therefore, the evaluation procedure information is generated.

【0060】このようにして、第2の変換手段22は、
探索条件木を変換することで、条件に分岐条件と分岐先
とを設定した評価手順情報を生成していくよう処理す
る。次に、図12ないし図14に従って、判断手段23
/第3の変換手段24の実行する処理の一実施例につい
て説明する。
In this way, the second conversion means 22
By processing the search condition tree, the evaluation procedure information in which the branch condition and the branch destination are set in the condition is generated. Next, the judging means 23 will be described with reference to FIGS.
/ An embodiment of the processing executed by the third conversion means 24 will be described.

【0061】判断手段23/第3の変換手段24は、図
1で説明したように、複数表にまたがる探索条件に対し
て、1つの表に閉じた探索条件を抽出して絞り込みを行
い、全体の評価時間を短縮することを実現するものであ
って、生成された探索条件木の有効な部分のみを局所的
にCNFに変換することで、条件要素の増加を抑えつ
つ、単一表に閉じた探索条件を増やすことでそれを実現
するものである。
As described with reference to FIG. 1, the judging means 23 / third converting means 24 extracts the search conditions closed in one table and narrows down the search conditions spanning a plurality of tables. It is possible to reduce the evaluation time of, and by locally converting only the effective part of the generated search condition tree into CNFs, the increase in the number of condition elements is suppressed, and a single table is closed. This is achieved by increasing the search conditions.

【0062】すなわち、図12(イ)に示すような探索
条件式が与えられ、第1の変換手段21がこれを探索条
件木に変換すると、判断手段23/第3の変換手段24
は、条件要素C1xが表T1の列に属し、条件要素C2xが
表T2の列に属する場合には、これを考慮しつつ、この
探索条件木を局所的にCNFに変換していくことで、図
12(ロ)に示すような局所的にCNF表現を含む探索
条件木を生成するのである。この例では、図13に示す
ように、表T1に閉じた(イ)の探索条件木部分と、表
T2に閉じた(ロ)の探索条件木部分と、表T1と表T
2の双方に関係する探索条件木部分とから構成されるも
のに変換されることになる。
That is, when a search condition expression as shown in FIG. 12A is given and the first conversion means 21 converts this into a search condition tree, the judgment means 23 / third conversion means 24.
When the condition element C1x belongs to the column of the table T1 and the condition element C2x belongs to the column of the table T2, the search condition tree is locally converted into CNF by taking this into account. The search condition tree locally including the CNF expression as shown in FIG. 12B is generated. In this example, as shown in FIG. 13, the search condition tree part (A) closed in the table T1, the search condition tree part (B) closed in the table T2, the table T1 and the table T.
2 will be converted into a search condition tree portion related to both.

【0063】このような単一表に閉じた探索条件は、各
表の行の読み込み時や、一時的なインデックスの作成時
等に評価することで事前に行を絞り込めることから、全
体の処理時間を短縮できることになる。ここで、各々の
探索条件木部分については、第2の変換手段22が、上
述の処理に従って評価手順情報を生成することになる。
The search condition closed in such a single table can be narrowed down in advance by evaluating when the row of each table is read or when a temporary index is created. This will save time. Here, for each search condition tree portion, the second conversion means 22 will generate evaluation procedure information in accordance with the processing described above.

【0064】図14に、この変換処理を実現するために
判断手段23/第3の変換手段24が実行する処理フロ
ーの一実施例を図示する。次に、この処理フローについ
て詳細に説明する。
FIG. 14 shows an embodiment of the processing flow executed by the judging means 23 / third converting means 24 in order to realize this converting processing. Next, this processing flow will be described in detail.

【0065】判断手段23/第3の変換手段24は、探
索条件木が与えられて変換処理に入ると、図14の処理
フローに示すように、先ず最初に、ステップ1で、探索
条件木の最上位のAND条件に対する論理和項Ba が論
理積項を含むか否かを判断して、論理積項を含む論理和
項Ba が存在しないことを判断するときには、そのまま
処理を終了する。すなわち、探索条件木の最上位のAN
D条件に属する全ての論理和項Ba が1階層であるとき
には、既にCNFとなっていることからそのまま処理を
終了するのである。
When the determining means 23 / third converting means 24 are given a search condition tree and enter the converting process, as shown in the processing flow of FIG. 14, first, in step 1, the search condition tree is searched. When it is determined whether the logical sum term B a for the highest AND condition includes the logical product term, and it is determined that the logical sum term B a including the logical product term does not exist, the processing is terminated as it is. That is, the highest AN of the search condition tree
When all the logical sum terms B a belonging to the condition D are in the first layer, the processing is ended as it is because it is already CNF.

【0066】このステップ1で、論理積項を含む論理和
項Ba が存在することを判断するときには、ステップ2
に進んで、その論理和項Ba が複数表を参照しているか
否かを判断して、複数表を参照するものが存在しないこ
とを判断するときには、そのまま処理を終了し、存在す
ることを判断するときには、ステップ3に進んで、その
論理和項Ba をCNFに変換すると、単一表のみを参照
する論理項が生成されるか否かを判断する。
When it is judged in this step 1 that the logical sum term B a containing the logical product term exists, step 2
When it is determined whether the logical sum term B a refers to a plurality of tables and it is determined that there is no reference to a plurality of tables, the processing is terminated and the existence When making a determination, the process proceeds to step 3, and it is determined whether or not the logical sum term B a is converted into CNF to generate a logical term that refers to only a single table.

【0067】このステップ3で、単一表のみを参照する
論理項が生成されないことを判断するときには、そのま
ま処理を終了し、生成されることを判断するときには、
ステップ4に進んで、上述の〔数1〕、〔数2〕式を使
って、その論理和項Ba をCNFに変換すると、条件要
素の個数が規定のN個を超えるか否かを判断して、超え
ることを判断するときには、そのまま処理を終了し、超
えないことを判断するときには、ステップ5に進んで、
その論理和項Ba をCNFに変換する。そして、続くス
テップ6で、探索条件木の最上位のAND条件に対する
全ての論理和項Ba についての処理を確認すると全処理
を終了する。ここで、探索条件木は、探索条件式と等価
な構造を持つものであることから、CNFへの変換は従
来技術を利用することが簡単に実行できるものである。
In this step 3, when it is determined that a logical term that refers to only a single table is not generated, the processing is terminated as it is, and when it is determined that it is generated,
When the process proceeds to step 4 and the logical sum term B a is converted into CNF using the above-mentioned [Equation 1] and [Equation 2], it is determined whether or not the number of conditional elements exceeds the prescribed N. Then, when it is determined that the amount is exceeded, the processing is terminated as it is, and when it is determined that the amount is not exceeded, the process proceeds to step 5,
The logical sum term B a is converted into CNF. Then, in the subsequent step 6, when the processing for all the logical sum terms B a for the highest AND condition of the search condition tree is confirmed, the entire processing is ended. Here, since the search condition tree has a structure equivalent to the search condition expression, the conversion to CNF can be easily performed by using the conventional technique.

【0068】このようにして、本発明のデータベース検
索装置2では、探索条件式が与えられると、第1の変換
手段21が、逆ポーランド形式に変換された探索条件式
を変換することで、木構造の探索条件木を生成し、第2
の変換手段22が、この生成された探索条件木を変換す
ることで、条件に分岐条件と分岐先とを設定した評価手
順情報を生成し、アクセス実行手段25が、この生成さ
れた評価手順情報に従ってデータベース1を検索してい
くのである。
In this way, in the database search device 2 of the present invention, when the search condition expression is given, the first conversion means 21 converts the search condition expression converted into the reverse Polish form, and Generate a structure search condition tree,
The conversion means 22 converts the generated search condition tree to generate evaluation procedure information in which a branch condition and a branch destination are set as conditions, and the access execution means 25 generates the evaluation procedure information. The database 1 is searched according to.

【0069】ここで、アクセス実行手段25は、第1の
変換手段21の生成する探索条件木をそのまま用いてデ
ータベース1を検索していくことも可能である。そし
て、この処理にあって、判断手段23が、生成された探
索条件木に含まれる複数表の参照部分をCNFに変換す
るときに、単一表のみを参照する論理項が生成されるか
否かを判断し、第3の変換手段24が、単一表のみを参
照する論理項の生成が判断されるときには、その論理項
の生成源となる探索条件木部分をCNFに変換し、この
局所的なCNF表現の探索条件式を受けて、アクセス実
行手段25が、そのCNF表現の探索条件式を組み合わ
せて使いつつデータベース1を検索していくのである。
Here, the access execution means 25 can also search the database 1 by using the search condition tree generated by the first conversion means 21 as it is. Then, in this processing, when the judging means 23 converts the reference part of the plurality of tables included in the generated search condition tree into CNF, whether or not a logical term that refers to only a single table is generated. If it is determined that the logical term that refers to only a single table is generated, the third conversion means 24 converts the search condition tree portion that is the source of the logical term into CNF, and this local The access execution means 25 receives the search condition expression of the specific CNF expression and searches the database 1 while using the search condition expression of the CNF expression in combination.

【0070】[0070]

【発明の効果】以上説明したように、本発明によれば、
探索条件式の形式がCNFかDNFかによらず、探索条
件評価の動的情報となる探索条件木の条件要素数が元々
の探索条件式の条件要素数と同じになることから、従来
に比べて評価時間を大幅に短縮できるようになる。
As described above, according to the present invention,
Regardless of whether the format of the search condition expression is CNF or DNF, the number of condition elements in the search condition tree, which is the dynamic information of the search condition evaluation, is the same as the number of condition elements in the original search condition expression. The evaluation time can be significantly reduced.

【0071】そして、探索条件木を評価手順情報表に変
換する構成を採っていることから、評価を行う際にスタ
ックが不要となって処理を単純化できるようになる。そ
して、複数表にまたがる探索条件に対して有効的な部分
のみをCNF変換し、1つの表に閉じた探索条件を抽出
して絞り込みを行う構成を採っていることから、動的情
報の増加を最小限に抑えつつ全体の処理時間を短縮でき
るようになる。
Since the search condition tree is converted into the evaluation procedure information table, the stack is not required at the time of evaluation, and the processing can be simplified. Then, since only the effective part for the search condition that spans multiple tables is CNF-converted and the search condition that is closed in one table is extracted and narrowed down, it is possible to increase the dynamic information. The overall processing time can be shortened while keeping it to the minimum.

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

【図1】本発明の原理構成図である。FIG. 1 is a principle configuration diagram of the present invention.

【図2】探索条件木の説明図である。FIG. 2 is an explanatory diagram of a search condition tree.

【図3】第1の変換手段の実行する処理の説明図であ
る。
FIG. 3 is an explanatory diagram of a process executed by a first conversion unit.

【図4】第1の変換手段の実行する処理フローの一実施
例である。
FIG. 4 is an example of a processing flow executed by a first conversion unit.

【図5】探索条件木の生成処理の説明図である。FIG. 5 is an explanatory diagram of a search condition tree generation process.

【図6】第2の変換手段の実行する処理の説明図であ
る。
FIG. 6 is an explanatory diagram of processing executed by a second conversion unit.

【図7】第2の変換手段の実行する処理フローの一実施
例である。
FIG. 7 is an example of a processing flow executed by a second conversion unit.

【図8】第2の変換手段の実行する処理の説明図であ
る。
FIG. 8 is an explanatory diagram of a process executed by a second conversion unit.

【図9】第2の変換手段の実行する処理の説明図であ
る。
FIG. 9 is an explanatory diagram of a process executed by a second conversion unit.

【図10】評価手順情報の生成処理の説明図である。FIG. 10 is an explanatory diagram of a generation process of evaluation procedure information.

【図11】評価手順情報の生成処理の説明図である。FIG. 11 is an explanatory diagram of a process of generating evaluation procedure information.

【図12】判断手段/第3変換手段の実行する処理の説
明図である。
FIG. 12 is an explanatory diagram of a process executed by a determination unit / third conversion unit.

【図13】判断手段/第3変換手段の実行する処理の説
明図である。
FIG. 13 is an explanatory diagram of a process executed by a determination unit / third conversion unit.

【図14】判断手段/第3変換手段の実行する処理フロ
ーの一実施例である。
FIG. 14 is an example of a processing flow executed by a determination unit / third conversion unit.

【図15】従来技術の説明図である。FIG. 15 is an explanatory diagram of a conventional technique.

【図16】CNF表現による条件要素数増加の説明図で
ある。
FIG. 16 is an explanatory diagram of an increase in the number of condition elements by CNF expression.

【図17】DNF表現の探索条件式の一例である。FIG. 17 is an example of a search condition expression of DNF expression.

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

1 データベース 2 データベース検索装置 20 逆ポーランド変換手段 21 第1の変換手段 22 第2の変換手段 23 判断手段 24 第3の変換手段 25 アクセス実行手段 DESCRIPTION OF SYMBOLS 1 database 2 database search device 20 reverse Polish conversion means 21 first conversion means 22 second conversion means 23 determination means 24 third conversion means 25 access execution means

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 データベースの中から探索条件式を充足
するレコードを検索するデータベース検索処理方式にお
いて、 逆ポーランド形式で表現される探索条件式を変換するこ
とで、木構造の探索条件木を生成する第1の変換手段(2
1)を備え、 上記第1の変換手段(21)の生成する探索条件木に従っ
て、データベースの検索処理を実行するよう処理するこ
とを、 特徴とするデータベース検索処理方式。
1. A search condition tree having a tree structure is generated by converting a search condition expression expressed in reverse Polish format in a database search processing method for searching a record that satisfies a search condition expression from a database. First conversion means (2
A database search processing method, characterized by comprising 1) and performing a database search processing in accordance with a search condition tree generated by the first conversion means (21).
【請求項2】 データベースの中から探索条件式を充足
するレコードを検索するデータベース検索処理方式にお
いて、 逆ポーランド形式で表現される探索条件式を変換するこ
とで、木構造の探索条件木を生成する第1の変換手段(2
1)と、 上記第1の変換手段(21)の生成する探索条件木を変換す
ることで、条件に分岐条件と分岐先とを設定した評価手
順情報を生成する第2の変換手段(22)とを備え、 上記第2の変換手段(22)の生成する評価手順情報に従っ
て、データベースの検索処理を実行するよう処理するこ
とを、 特徴とするデータベース検索処理方式。
2. A search condition tree having a tree structure is generated by converting a search condition expression expressed in a reverse Polish format in a database search processing method for searching a record satisfying a search condition expression from a database. First conversion means (2
1) and second conversion means (22) for generating evaluation procedure information in which a branch condition and a branch destination are set by converting the search condition tree generated by the first conversion means (21) A database search processing method comprising: and a processing for executing a database search processing according to the evaluation procedure information generated by the second conversion means (22).
【請求項3】 請求項1又は2記載のデータベース検索
処理方式において、 第1の変換手段(21)の生成する探索条件木に含まれる複
数表の参照部分をCNFに変換するときに、単一表のみ
を参照する論理項が生成されるか否かを判断する判断手
段(23)と、 上記判断手段(23)が単一表のみを参照する論理項が生成
されることを判断するときに、該論理項の生成源となる
探索条件木部分をCNFに変換する第3の変換手段(24)
とを備え、 上記第3の変換手段(24)の生成する局所的なCNF表現
の探索条件式を組み合わせて使いつつ、データベースの
検索処理を実行するよう処理することを、 特徴とするデータベース検索処理方式。
3. The database search processing method according to claim 1 or 2, wherein when converting a reference part of a plurality of tables included in a search condition tree generated by the first conversion means (21) into CNF, Judgment means (23) for judging whether a logical term that refers only to a table is generated, and when the above judgment means (23) determines that a logical term that refers only to a single table is generated. , A third conversion means (24) for converting the search condition tree portion, which is the generation source of the logical term, into CNF
A database search process characterized by comprising: using a search condition expression of a local CNF expression generated by the third conversion means (24) in combination, and performing a database search process. method.
【請求項4】 請求項3記載のデータベース検索処理方
式において、 第3の変換手段(24)は、生成されるCNF表現の探索条
件式の要素数が規定値以下にあることを条件にして、C
NFへの変換処理を実行するよう処理することを、 特徴とするデータベース検索処理方式。
4. The database search processing method according to claim 3, wherein the third conversion means (24) provides that the number of elements of the search condition expression of the generated CNF expression is equal to or less than a specified value, C
A database search processing method characterized in that processing for executing conversion processing into NF is performed.
JP03557494A 1994-03-07 1994-03-07 Database search processing method Expired - Fee Related JP3322749B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP03557494A JP3322749B2 (en) 1994-03-07 1994-03-07 Database search processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP03557494A JP3322749B2 (en) 1994-03-07 1994-03-07 Database search processing method

Publications (2)

Publication Number Publication Date
JPH07244602A true JPH07244602A (en) 1995-09-19
JP3322749B2 JP3322749B2 (en) 2002-09-09

Family

ID=12445539

Family Applications (1)

Application Number Title Priority Date Filing Date
JP03557494A Expired - Fee Related JP3322749B2 (en) 1994-03-07 1994-03-07 Database search processing method

Country Status (1)

Country Link
JP (1) JP3322749B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112632110A (en) * 2021-01-06 2021-04-09 上海合合信息科技股份有限公司 Data extraction method and device for automatically generating query statement

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01147624A (en) * 1987-12-02 1989-06-09 Mitsubishi Electric Corp Language processing system
JPH01244528A (en) * 1988-03-25 1989-09-28 Fujitsu Ltd Data base inquiry expression processing system
EP0435476A2 (en) * 1989-12-23 1991-07-03 International Computers Limited Database system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01147624A (en) * 1987-12-02 1989-06-09 Mitsubishi Electric Corp Language processing system
JPH01244528A (en) * 1988-03-25 1989-09-28 Fujitsu Ltd Data base inquiry expression processing system
EP0435476A2 (en) * 1989-12-23 1991-07-03 International Computers Limited Database system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112632110A (en) * 2021-01-06 2021-04-09 上海合合信息科技股份有限公司 Data extraction method and device for automatically generating query statement

Also Published As

Publication number Publication date
JP3322749B2 (en) 2002-09-09

Similar Documents

Publication Publication Date Title
US20080059417A1 (en) Structured document management system and method of managing indexes in the same system
CN1552032B (en) Database
CN110532347A (en) A kind of daily record data processing method, device, equipment and storage medium
CN102867049A (en) Chinese PINYIN quick word segmentation method based on word search tree
CN110232106A (en) A kind of mass data storage and method for quickly retrieving based on MongoDB and Solr
US11281645B2 (en) Data management system, data management method, and computer program product
JP4724051B2 (en) Keyword generation method, document search method, topic range estimation method, topic boundary estimation method, apparatus and program thereof, and recording medium thereof
CN114491172A (en) Method, device and equipment for quickly searching tree structure nodes and storage medium
CN115269968A (en) Internet big data keyword word searching method of improved RDF
CN108304384B (en) Word splitting method and device
CN111046092B (en) Parallel similarity connection method based on CPU-GPU heterogeneous system structure
JPH07244602A (en) Data base retrieval processing system
CN108319678A (en) A kind of distributed index method of magnanimity time series
CN107506473A (en) A kind of big data search method based on cloud computing
RU2490702C1 (en) Method of accelerating processing of multiple select-type request to rdf database using graphics processor
JP2001134594A (en) Method and device for retrieving similar feature variable and that retrieving program recording medium thereof
JPWO2011099114A1 (en) Hybrid database system and operation method thereof
JPH10240741A (en) Managing method for tree structure type data
CN106681939B (en) Reading method and device for disk page
JP2006228155A (en) Xml data processing apparatus, xml data processing method, xml data processing program, and storage medium having xml data processing program recorded therein
JP2001134584A (en) Method and device for retrieving similar data and similar data retrieving program recording medium
CN101420454A (en) Substitute Web service data processing method based on service grid
JPH087754B2 (en) Drawing search method
JP3279002B2 (en) Information management device
JPH04127371A (en) Device and method for registering data and device and method for retrieving data

Legal Events

Date Code Title Description
S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313532

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees