JPS6318777B2 - - Google Patents

Info

Publication number
JPS6318777B2
JPS6318777B2 JP56154696A JP15469681A JPS6318777B2 JP S6318777 B2 JPS6318777 B2 JP S6318777B2 JP 56154696 A JP56154696 A JP 56154696A JP 15469681 A JP15469681 A JP 15469681A JP S6318777 B2 JPS6318777 B2 JP S6318777B2
Authority
JP
Japan
Prior art keywords
reference counter
relation
field
processing
contents
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.)
Expired
Application number
JP56154696A
Other languages
Japanese (ja)
Other versions
JPS5856031A (en
Inventor
Susumu Adachi
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP56154696A priority Critical patent/JPS5856031A/en
Publication of JPS5856031A publication Critical patent/JPS5856031A/en
Publication of JPS6318777B2 publication Critical patent/JPS6318777B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30007Arrangements for executing specific machine instructions to perform operations on data operands
    • G06F9/30021Compare instructions, e.g. Greater-Than, Equal-To, MINMAX
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/22Arrangements for sorting or merging computer data on continuous record carriers, e.g. tape, drum, disc

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

【発明の詳細な説明】 本発明は、リレーシヨナル・データベース・シ
ステムにおいて、リダクシヨン又はジヨインの結
果生成される作業用リレーシヨンの大きさを最小
にできるようにした最小作業リレーシヨンの決定
方式に関するものである。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a method for determining a minimum work relation that can minimize the size of a work relation generated as a result of reduction or join in a relational database system. be.

リレーシヨナル・データベースは、データを表
形式でユーザに提供するものであるが、リレーシ
ヨナル・データベース・システムは、ユーザから
の問い合わせがあると、関連するリレーシヨンを
選択し、これらに対してリダクシヨン処理又はジ
ヨイン処理を行つて所望のリレーシヨンを作成
し、これをユーザに問い合わせ結果として提供し
ている。リダクシヨン処理やジヨイン処理を組合
わせて問い合せ結果を得る過程においては、リダ
クシヨン結果又はジヨイン結果を一時的に保存し
ておく作業用リレーシヨンを必要とする。問い合
わせ処理における処理効率を向上するためには、
作業用リレーシヨンの大きさを最小化することが
必要であるが、それにはフイールド構成を必要最
小限の構成にすること及び作業用リレーシヨン中
のレコード数を最小化することが必要となる。
Relational databases provide data to users in tabular format, but when a relational database system receives an inquiry from a user, it selects related relations and performs reduction processing or join processing on them. The processing is performed to create the desired relationship, which is then provided to the user as the inquiry result. In the process of obtaining query results by combining reduction processing and join processing, a working relation is required to temporarily store the reduction results or join results. In order to improve processing efficiency in inquiry processing,
It is necessary to minimize the size of the working relation, which requires minimizing the field configuration and the number of records in the working relation.

本発明は、上記のような要求に応えるものであ
つて、問い合わせ処理過程中において使用される
作業用リレーシヨンのフイールド構成を必要最小
限の構成にすることが出来るようにした最小作業
リレーシヨンの決定方式を提供することを目的と
している。そしてそのため、本発明の最小作業リ
レーシヨンの決定方式は、ユーザから送られて来
た問い合わせ情報に従つてリダクシヨン処理もし
くはジヨイン処理を含む処理系列を定め、上記処
理系列の実行の過程におけるリダクシヨン処理も
しくはジヨイン処理の結果を作業用リレーシヨン
に格納するリレーシヨナル・データベース・シス
テムにおいて、上記問い合わせ中に現われるフイ
ールドと1対1の対応をなすと共に初期値として
問い合わせの中における当該フイールドの出現回
数がセツトされる複数の参照カウンタをもつ参照
カウンタ制御機構と、問い合せの条件および処理
系列に基づいて参照カウンタの内容の変更を上記
参照カウンタ制御機構に依頼すると共に上記複数
の参照カウンタよりなる参照カウンタ群の内容に
基づいて各リダクシヨン処理もしくはジヨイン処
理の結果を格納するための作業用リレーシヨンの
フイールド構成を決定する最小作業用リレーシヨ
ン決定機構とを設け、上記最小作業用リレーシヨ
ン決定機構は、第i番目(i=1、2……n、n
は最後の処理)の処理に対応する作業用リレーシ
ヨンのフイールド構成を決定する際、その処理が
リダクシヨン処理である場合には、リダクシヨン
元リレーシヨンのフイールドのみを使用している
条件が対象となる問い合わせ条件の中に存在する
か否かを調べ、存在するときには該当する参照カ
ウンタの内容を当該フイールドの出現回数だけ減
んずることを上記参照カウンタ制御機構に依頼す
ると共に当該条件を対象となる問い合わせ条件か
ら除外し、参照カウンタの内容の変更が行われた
後に参照カウンタ群の内容を読取つて当該リダク
シヨン処理に対する作業用リレーシヨンのフイー
ルド構成を定め、上記第i番目の処理がジヨイン
処理である場合には、ジヨインする複数のリレー
シヨンのフイールドのみを使用する条件が対象と
なる問い合わせ条件の中に存在するか否かを調
べ、存在するときには該当する参照カウンタの内
容を当該フイールドの出現回数だけ減んずること
を上記参照カウンタ制御機構に依頼すると共に当
該条件を対象となる問い合わせ条件から除外し、
参照カウンタの内容の変更が行われた後に参照カ
ウンタ群の内容を読取つて当該ジヨイン処理に対
する作業リレーシヨンのフイールド構成を定める
ように構成されていることを特徴とするものであ
る。以下、本発明を図面を参照しつつ説明する。
The present invention meets the above-mentioned requirements, and provides a minimum working relation that allows the field configuration of the working relation used during the inquiry processing process to be reduced to the minimum necessary configuration. The purpose is to provide a decision method. Therefore, the method for determining the minimum work relation of the present invention determines a processing sequence including reduction processing or join processing according to inquiry information sent from the user, and performs reduction processing or join processing in the process of executing the processing sequence. In a relational database system that stores the result of join processing in a working relation, there is a one-to-one correspondence with the field that appears in the above query, and the number of occurrences of the field in the query is set as an initial value. A reference counter control mechanism having a plurality of reference counters, and requesting the reference counter control mechanism to change the contents of the reference counter based on the query conditions and processing sequence, and changing the contents of the reference counter group consisting of the plurality of reference counters. and a minimum working relation determining mechanism that determines the field configuration of a working relation for storing the results of each reduction process or join process based on the i-th ( i=1, 2...n, n
When determining the field configuration of the working relation corresponding to the process (the last process), if that process is a reduction process, the condition in which only the fields of the reduction source relation are used is considered. Checks whether the field exists in the query condition, and if it exists, requests the reference counter control mechanism to reduce the contents of the corresponding reference counter by the number of times the field appears, and also makes a query that targets the condition. If the content of the reference counter group is read after the content of the reference counter is changed and the field configuration of the working relation for the reduction process is determined, and the i-th process is a join process. To do this, check whether there is a condition in the target query condition that uses only the fields of multiple relations to join, and if it exists, decrement the contents of the corresponding reference counter by the number of times the field appears. the reference counter control mechanism, and excludes the condition from the target inquiry conditions,
The present invention is characterized in that after the contents of the reference counters are changed, the contents of the reference counter group are read to determine the field structure of the work relation for the join process. Hereinafter, the present invention will be explained with reference to the drawings.

第1図はリレーシヨナル・データベース・シス
テルの概要を示す図、第2図は論理データ・サブ
システムにおける処理の流れを示す図、第3図は
スケジユーラにおける処理を説明する図、第4図
は最小作業用リレーシヨンのフイールド構成を決
定する機構の1実施例を示す図、第5図はインタ
プリタにおける処理の1例を示す図、第6図は問
い合わせの1例を示す図、第7図は問い合わせ処
理順序の1例を示す図、第8図は参照カウンタの
状態遷移の1例を示す図である。
Figure 1 shows an overview of the relational database system, Figure 2 shows the flow of processing in the logical data subsystem, Figure 3 explains the processing in the scheduler, and Figure 4 shows the minimum work required. Figure 5 is a diagram showing an example of processing in the interpreter; Figure 6 is a diagram showing an example of a query; Figure 7 is a diagram showing an example of query processing. FIG. 8 is a diagram showing an example of the order, and FIG. 8 is a diagram showing an example of the state transition of the reference counter.

第1図において、1はリレーシヨナル・データ
ベース管理システム、2はリレーシヨ・データベ
ース、3は論理データ・サブシステム、4は論理
記憶サブシステムをそれぞれ示している。リレー
シヨナル・データベース管理システム1は、問い
合わせ入力があると、リレーシヨナル・データベ
ース2をアクセスし、問い合わせ結果を作成し、
これをユーザに転送するものである。リレーシヨ
ナル・データベース管理システムは、論理デー
タ・サブシステム3と論理記憶サブシステム4と
から構成されている。論理データ・サブシステム
3は問い合わせの解析や最適化、実行などを提供
するものであり、論理記憶サブシステム4はデー
タの記憶や排他制御、リカバリなどを提供するも
のである。リレーシヨナル・データベース2に
は、複数のリレーシヨン(テーブル又は表)が格
納されている。
In FIG. 1, 1 represents a relational database management system, 2 represents a relational database, 3 represents a logical data subsystem, and 4 represents a logical storage subsystem. When an inquiry is input, the relational database management system 1 accesses the relational database 2, creates an inquiry result, and
This is transferred to the user. The relational database management system consists of a logical data subsystem 3 and a logical storage subsystem 4. The logical data subsystem 3 provides query analysis, optimization, execution, etc., and the logical storage subsystem 4 provides data storage, exclusive control, recovery, etc. The relational database 2 stores a plurality of relations (tables).

第2図は論理データ・サブシステムにおける処
理の流れを示すものである。第2図に示すよう
に、論理データ・サブシステム3は、構文解析、
意味解析、スケジユーラおよびインタプクータ等
の処理を行う。論理データ・サブシステム3に入
力される問い合わせは、非手続言語で書かれてい
る。第6図は非手続言語で書かれた問い合わせ文
の1例を示すものである。第6図の問い合わせ文
は、フイールドa1,a2,a3,a4,a5をもつリレー
シヨンA、フイールドb1,b2,b3,b4をもつリレ
ーシヨンBおよびフイールドc1,c2,c3,c4をも
つリレーシヨンCを用いて、WHERE以下で示さ
れる条件を満すところのフイールドa1,a3,b1
b2,c1,c4をもつリレーシヨンを作成して欲し
い、ということを依頼している。構文解析部は入
力された問い合わせ文の構文チエツクを行うもの
であり、意味解析部は入力された問い合わせ文で
指定されたリレーシヨンやフイールドの存在チエ
ツクなどを行うものであり、スケジユーラは最適
化および実行手続き文の生成などを行うものであ
り、インタプクタは実行手続き文を実行するもの
である。第6図の非手続言語で書かれた問い合わ
せ文に対応する実行手続き文の1例は、第7図に
示されたような構成を有している。第7図は、 リレーシヨンAをリダクシヨンして、その結
果をa1でソートし、ソート結果を作業用リレー
シヨンTAに格納せよ リレーシヨンBをリダクシヨンして、その結
果をb1でソートし、ソート結果を作業用リレー
シヨンTBに格納せよ。
FIG. 2 shows the flow of processing in the logical data subsystem. As shown in FIG. 2, the logical data subsystem 3 includes syntax parsing,
Performs processing such as semantic analysis, scheduler, and interrupter. Queries input to the logical data subsystem 3 are written in a non-procedural language. FIG. 6 shows an example of a query written in a non-procedural language. The query in Figure 6 consists of relation A with fields a 1 , a 2 , a 3 , a 4 , and a 5 , relation B with fields b 1 , b 2 , b 3 , and b 4 , and field c 1 . , c 2 , c 3 , c 4 , fields a 1 , a 3 , b 1 , which satisfy the conditions shown below WHERE
The request is to create a relation with b 2 , c 1 , and c 4 . The syntax analysis unit checks the syntax of the input query sentence, the semantic analysis unit checks the existence of relations and fields specified in the input query sentence, and the scheduler performs optimization and It generates executable procedure statements, and the interpreter executes executable procedure statements. An example of an execution procedure statement corresponding to the inquiry statement written in the non-procedural language of FIG. 6 has a structure as shown in FIG. Figure 7 shows the following: Reduce relation A, sort the results by a 1 , and store the sorted results in working relation TA. Reduce relation B, sort the results by b 1 , Store the sort results in the working relation TB.

作業用リレーシヨンTAとTBをa1=b1とい
う条件の下でジヨインし、その結果をb2でソー
トし、ソート結果を作業用リレーシヨンTAB
に格納せよ リレーシヨンCをリダクシヨンして、その結
果をc2でソートし、ソート結果を作業用リレー
シヨンTCに格納せよ 作業用リレーシヨンTABとTCとをb2=c2
いう条件の下でジヨインし、その結果を作業用
リレーシヨンTABCに格納せよ。
Join the working relations TA and TB under the condition that a 1 = b 1 , sort the result by b 2 , and use the sorted result as the working relation TAB.
Reduce relation C, sort the result by c 2 , and store the sorted result in working relation TC. Set working relations TAB and TC under the condition that b 2 = c 2 . join and store the result in working relation TABC.

ということを表わしている。This means that.

第4図は最小作業用リレーシヨンのフイールド
構成を決定するため機構の1例を示す図である。
第4図において、5は最小作業用リレーシヨン決
定機構、6は参照カウンタ制御機構、7は参照カ
ウンタ群、8は参照カウンタをそれぞれ示してい
る。最小作業用リレーシヨン決定機構5には、問
い合わせ条件および処理順序が入力される。この
条件とは、第6図のWHERE以下の文で指定され
るものであり、また処理順序とは第7図で表わさ
れる如きものである。参照カウンタ制御機構6は
参照カウンタ群7を有している。参照カウンタ群
7は、問い合わせ中で引用されるフイールドのそ
れぞれに対応する複数の参照カウンタ8を有して
おり、各参照カウンタ8には初期値がセツトされ
ている。例えば、第6図の如き問い合わせの場合
には、フイールドa1はGET以下の文に2回表わ
れているのでフイールドa1に対応する参照カウン
タ8の初期値は“2”とされフイールドa2
GET以下の文に1回表われているのでフイール
ドa2に対応する参照カウンタ8の初期値は“1”
とされる。以下、同様である。リレーシヨンAを
リダクシヨンしてその結果を格納する作業用リレ
ーシヨンTAの最小フイールド構成を決定する場
合元のリレーシヨンAにのみ関係する条件は、 a2=5 という条件であるので、最小作業用リレーシヨン
決定機構5は、フイールドa2に対応する参照カウ
ンタの内容から“1”減することを参照カウンタ
制御機構6に依頼する。最小作業用リレーシヨン
決定機構5は、この依頼を実行し終るとカウンタ
参照依頼を参照カウンタ制御機構6に対して発信
する。カウンタ参照依頼を受取ると、参照カウン
タ制御機構6は、参照カウンタ群7の内容を返
す、このとき、フイールドa2に対応する参照カウ
ンタの内容は零となつているので、作業用リレー
シヨンTAをフイールドa1とa2をもつものと決定
する。以下、同様にして他の作業用リレーシヨン
のフイールド構成を決定する。第4図の機構は、
第3図の最適化部に含まれているものである。作
業用リレーシヨンの最小フイールド構成について
は、後で更に詳細に説明する。
FIG. 4 is a diagram showing an example of a mechanism for determining the field configuration of the minimum working relation.
In FIG. 4, numeral 5 indicates a minimum work relation determining mechanism, 6 a reference counter control mechanism, 7 a reference counter group, and 8 a reference counter. Inquiry conditions and processing order are input to the minimum work relation determining mechanism 5. This condition is specified by the statement following WHERE in FIG. 6, and the processing order is as shown in FIG. The reference counter control mechanism 6 has a reference counter group 7. The reference counter group 7 has a plurality of reference counters 8 corresponding to each of the fields cited in the inquiry, and each reference counter 8 has an initial value set. For example, in the case of the query shown in Figure 6, field a1 appears twice in the sentence following GET, so the initial value of the reference counter 8 corresponding to field a1 is set to "2", and field a2 teeth
Since it appears once in the statement following GET, the initial value of reference counter 8 corresponding to field a 2 is “1”.
It is said that The same applies hereafter. When determining the minimum field configuration of a working relation TA that reduces relation A and stores the result, the condition related only to the original relation A is a 2 = 5, so the minimum working relation TA The relation determination mechanism 5 requests the reference counter control mechanism 6 to subtract "1" from the content of the reference counter corresponding to field a2 . When the minimum work relation determination mechanism 5 finishes executing this request, it sends a counter reference request to the reference counter control mechanism 6. Upon receiving the counter reference request, the reference counter control mechanism 6 returns the contents of the reference counter group 7. At this time, since the contents of the reference counter corresponding to field a2 are zero, the reference counter control mechanism 6 returns the contents of the reference counter group 7. Decide to have fields a 1 and a 2 . Thereafter, field configurations of other work relations are determined in the same manner. The mechanism in Figure 4 is
This is included in the optimization section shown in FIG. The minimum field configuration of the working relation will be discussed in more detail below.

第5図はインタプリータにおける処理の1例を
示すものである。この例は、第7図で示される如
き処理を実行するためのものである。インタプリ
ータはスケジユーラで作成された実行手続き文に
したがつてリダクシヨン又はジヨインを行い、そ
のリダクシヨン結果又はジヨイン結果を格納する
ための作業リレーシヨンをスケジユーラの決定に
したがつて作成し、これに処理結果を格納する。
例えば、リレーシヨンAのリダクシヨン結果を格
納するための作業用リレーシヨンはフイールドa1
とa2をもつものとスケジユーラによつて決定され
ているので、インタプリータはこのような構成を
もつ作業用リレーシヨンTAを作成し、これにリ
レーシヨンAをリダクシヨンした結果を書込む。
FIG. 5 shows an example of processing in the interpreter. This example is for executing the process shown in FIG. The interpreter performs reduction or join according to the execution procedure statement created by the scheduler, creates a work relation to store the reduction result or join result according to the scheduler's decision, and stores the processing result in this work relation. Store.
For example, the working relation for storing the reduction result of relation A is field a 1
The interpreter creates a working relation TA with such a configuration and writes the result of reducing relation A into it.

さきに述べたように、第6図に示す問い合わせ
は、例えば第7図に示すような処理順序で処理さ
れる。この場合、その処理過程で必要とされる作
業用リレーシヨンTA、TB、TC、TABのフイ
ールド構成として最小化しない最も効率の悪い方
法は元のリレーシヨンのフイールドを全て作業用
リレーシヨンのフイールドに含ませるものであ
る。すなわち、下記のような構成となる。
As mentioned above, the inquiry shown in FIG. 6 is processed in the processing order shown in FIG. 7, for example. In this case, the least efficient method of not minimizing the field configuration of the working relations TA, TB, TC, and TAB required in the processing process is to change all the fields of the original relation to the fields of the working relation. It is to be included. That is, the configuration is as follows.

TA(a1、a2、a3、a4、a5) TB(b1、b2、b3、b4) TC(c1、c2、c3、c4) TAB(a1、a2、a3、a4、a5、b1、b2、b3、b4) 以上のように簡単であるが効率の悪い方法を、
参照カウンタ7を用いることにより、最小のフイ
ールド構成を使う効率の良い方法に改善すること
が出来る。以下、最小フイールド構成をもつ作業
用リレーシヨンの求め方について、第8図を参照
しつつ説明する。第8図は第7図の如き処理を行
う場合における参照カウンタの遷移状態を示すも
のであり、第8図において*印は直前のステツプ
で変更された参照カウンタを示している。
TA (a 1 , a 2 , a 3 , a 4 , a 5 ) TB (b 1 , b 2 , b 3 , b 4 ) TC (c 1 , c 2 , c 3 , c 4 ) TAB (a 1 , a 2 , a 3 , a 4 , a 5 , b 1 , b 2 , b 3 , b 4 ) The above simple but inefficient method,
By using the reference counter 7, it is possible to improve the efficiency of the method using the minimum field configuration. Hereinafter, a method for finding a working relation having a minimum field configuration will be explained with reference to FIG. FIG. 8 shows the transition state of the reference counter when performing the process shown in FIG. 7, and in FIG. 8, the * mark indicates the reference counter changed in the immediately previous step.

ステツプ 条件の中でリレーシヨンAのフイールドのみを
使用している条件P1(第6図参照)に関し、各
フイールドに対応する参照カウンタ8を出現回
数だけ減ずる。その結果の参照カウンタ群7の
状態は第8図ロのようになる(条件P1は以降
の処理対象から除外する)。リレーシヨンAの
フイールドの中で参照カウンタ8が零のものは
リダクシヨン結果の作業用リレーシヨンのフイ
ールド構成として不要であることを示し、作業
用リレーシヨンTAのフイールド構成を下記の
ようにすれば良いことを示している。
Regarding the condition P1 (see FIG. 6) in which only the field of relation A is used in the step condition, the reference counter 8 corresponding to each field is decremented by the number of times it appears. The resulting state of the reference counter group 7 is as shown in FIG. 8B (condition P1 is excluded from subsequent processing). Fields in relation A whose reference counter 8 is zero indicate that they are unnecessary as a field configuration of the working relation as a result of reduction, and the field configuration of the working relation TA can be configured as shown below. It is shown that.

TA(a1、a2) ステツプ 条件(J1、J2、P2、P3、P4)の中でリレーシ
ヨンBのフイールドのみを使用している条件
P2に関してステツプと同様な処理を行う
(条件P2は以降の処理対象から除外する)。こ
の結果得られる参照カウンタ群7の状態は、第
8図ハに示される。作業用リレーシヨンTBと
して下記のフイールド構成をもてば良いことが
決定できる。
TA (a 1 , a 2 ) Condition in which only field of relation B is used among step conditions (J1, J2, P2, P3, P4)
Perform the same processing as in step regarding P2 (condition P2 will be excluded from subsequent processing). The state of the reference counter group 7 obtained as a result is shown in FIG. 8C. It can be determined that the working relation TB should have the following field configuration.

TB(b1、b2、b3) ステツプ 条件(J1、J2、P3、P4)の中でジヨインする
2個の作業用リレーシヨンTA、TBのフイー
ルドのみを使用している条件J1、P3に関して
ステツプと同様な処理を行う(条件J1、P3
は以降の処理対象から除外する)。この結果得
られる参照カウンタ群7の状態は第8図ニに示
される。作業用リレーシヨンTABとしては下
記のフイールド構成を持てば良いことが決定で
きる。
TB (b 1 , b 2 , b 3 ) Regarding conditions J1 and P3 that use only the fields of the two working relations TA and TB that join in the step conditions (J1, J2, P3, P4) Performs the same processing as the step (conditions J1, P3
will be excluded from further processing). The state of the reference counter group 7 obtained as a result is shown in FIG. 8D. It can be determined that the working relation TAB should have the following field configuration.

TAB(a1、a2、b1、b2) ステツプ 条件J2、P4の中でリレーシヨンCのフイール
ドのみを使用している条件P4についてステツ
プ1と同様な処理を行う(条件P4は以降の対
象から除外する)。この結果得られる参照カウ
ンタ群7の状態は第8図ホに示される。作業用
リレーシヨンTCとしては、以下のフイールド
構成をもてば良いことが決定できる。
TAB (a 1 , a 2 , b 1 , b 2 ) Perform the same processing as in step 1 for condition P4, which uses only the field of relation C among step conditions J2 and P4 (condition P4 is (excluded from the scope). The state of the reference counter group 7 obtained as a result is shown in FIG. 8E. It has been determined that the working relation TC should have the following field configuration.

TC(c1、c2、c4) ステツプ 残されている条件の中で2個の作業用リレーシ
ヨンTAB、TCのフイールドのみを使用してい
る条件J2に関してステツプと同様な処理を行
う(これで全ての条件をチエツクし終る。)こ
の結果得られる参照カウンタ群7の状態は第8
図ヘに示される。作業用リレーシヨン(問い合
わせ結果の最終リレーシヨンと一致する)のフ
イールド構成は下記のようになる。
TC (c 1 , c 2 , c 4 ) Step Performs the same processing as the step for condition J2, which uses only the fields of the two working relations TAB and TC among the remaining conditions (this (This completes checking all conditions.) The state of the reference counter group 7 obtained as a result is the 8th
As shown in Figure F. The field structure of the working relation (which matches the final relation of the query result) is as follows.

TABC(a1、a3、b1、b2、c1、c4) 以上の説明から明らかなように、本発明によれ
ば、リレーシヨナル・データベース・システムの
問い合わせ処理で使用する作業用リレーシヨンの
フイールド構成を参照カウンタを用いることによ
り非常に簡単な方法で決定でき、最適化の効率を
向上させることが出来る。
TABC (a 1 , a 3 , b 1 , b 2 , c 1 , c 4 ) As is clear from the above description, according to the present invention, the working relation used in query processing in a relational database system By using a reference counter, the field configuration of can be determined in a very simple way, and the efficiency of optimization can be improved.

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

第1図はリレーシヨナル・データベース・シス
テムの概要を示す図、第2図は論理データ・サブ
ンステムにおける処理の流れを示す図、第3図は
スケジユーラにおける処理を説明する図、第4図
は最小作業用リレーシヨンのフイールド構成を決
定する機構の1実施例を示す図、第5図はインタ
プリタにおける処理の1例を示す図、第6図は問
い合わせの1例を示す図、第7図は問い合わせ処
理順序の1例を示す図、第8図は参照カウンタの
状態遷移の1例を示す図である。 1……リレーシヨナル・データベース管理シス
テム、2……リレーシヨナル・データベース、3
……論理データ・サブシステム、4……論理記憶
サブシステム、5……最小作業用リレーシヨン決
定機構、6……参照カウンタ制御機構、7……参
照カウンタ群、8……参照カウンタ。
Figure 1 is a diagram showing an overview of the relational database system, Figure 2 is a diagram showing the flow of processing in the logical data subsystem, Figure 3 is a diagram explaining the processing in the scheduler, and Figure 4 is for minimum work. FIG. 5 is a diagram showing an example of processing in the interpreter; FIG. 6 is a diagram showing an example of a query; FIG. 7 is a diagram showing an example of the query processing order. FIG. 8 is a diagram showing an example of the state transition of the reference counter. 1... Relational database management system, 2... Relational database, 3
... Logical data subsystem, 4 ... Logical storage subsystem, 5 ... Minimum work relation determination mechanism, 6 ... Reference counter control mechanism, 7 ... Reference counter group, 8 ... Reference counter.

Claims (1)

【特許請求の範囲】[Claims] 1 ユーザから送られて来た問い合わせ情報に従
つてリダクシヨン処理もしくはジヨイン処理を含
む処理系列を定め、上記処理系列の実行の過程に
おけるリダクシヨン処理もしくはジヨイン処理の
結果を作業用リレーシヨンに格納するリレーシヨ
ナル・データベース・システムにおいて、上記問
い合わせ中に現われるフイールドと1対1の対応
をなすと共に初期値として問い合わせの中におけ
る当該フイールドの出現回数がセツトされる複数
の参照カウンタをもつ参照カウンタ制御機構と、
問い合せの条件および処理系列に基づいて参照カ
ウンタの内容の変更を上記参照カウンタ制御機構
に依頼すると共に上記複数の参照カウンタよりな
る参照カウンタ群の内容に基づいて各リダクシヨ
ン処理もしくはジヨイン処理の結果を格納するた
めの作業用リレーシヨンのフイールド構成を決定
する最小作業用リレーシヨン決定機構とを設け、
上記最小作業用リレーシヨン決定機構は、第i番
目(i=1、2……n、nは最後の処理)の処理
に対応する作業用リレーシヨンのフイールド構成
を決定する際、その処理がリダクシヨン処理であ
る場合には、リダクシヨン元リレーシヨンのフイ
ールドのみを使用している条件が対象となる問い
合わせ条件の中に存在するか否かを調べ、存在す
るときには該当する参照カウンタの内容を当該フ
イールドの出現回数だけ減んずることを上記参照
カウンタ制御機構に依頼すると共に当該条件を対
象となる問い合わせ条件から除外し、参照カウン
タの内容の変更が行われた後に参照カウンタ群の
内容を読取つて当該リダクシヨン処理に対する作
業用リレーシヨンのフイールド構成を定め、上記
第i番目の処理がジヨイン処理である場合には、
ジヨインする複数のリレーシヨンのフイールドの
みを使用する条件が対象となる問い合わせ条件の
中に存在するか否かを調べ、存在するときには該
当する参照カウンタの内容を当該フイールドの出
現回数だけ減んずることを上記参照カウンタ制御
機構に依頼すると共に当該条件を対象となる問い
合わせ条件から除外し、参照カウンタの内容の変
更が行われた後に参照カウンタ群の内容を読取つ
て当該ジヨイン処理に対する作業リレーシヨンの
フイールド構成を定めるように構成されているこ
とを特徴とする最小作業リレーシヨンの決定方
式。
1 A relational system that determines a processing sequence including reduction processing or join processing according to inquiry information sent from the user, and stores the results of the reduction processing or join processing in the process of executing the processing sequence in a working relation. In a database system, a reference counter control mechanism having a plurality of reference counters that have a one-to-one correspondence with a field appearing in the query and whose initial value is set to the number of occurrences of the field in the query;
Requests the reference counter control mechanism to change the contents of the reference counter based on the inquiry condition and processing sequence, and stores the results of each reduction process or join process based on the contents of the reference counter group made up of the plurality of reference counters. and a minimum working relation determining mechanism for determining the field configuration of the working relation for the purpose of
The above-mentioned minimum working relation determining mechanism determines the field configuration of the working relation corresponding to the i-th process (i=1, 2...n, n is the last process), when the process is a reduction. If it is a process, it is checked whether a condition that uses only the field of the reduction source relation exists in the target query condition, and if it exists, the contents of the corresponding reference counter are added to the field. Requests the reference counter control mechanism to decrease by the number of occurrences, excludes the condition from the target query conditions, reads the contents of the reference counter group after changing the contents of the reference counter, and performs the reduction. Define the field configuration of the working relation for the process, and if the i-th process is a join process,
Check whether a condition that uses only the fields of multiple relations to join exists in the target query condition, and if it exists, decrement the contents of the corresponding reference counter by the number of times the field appears. is requested to the reference counter control mechanism, the condition is excluded from the target query conditions, and after the contents of the reference counter are changed, the contents of the reference counter group are read and the field of the work relation for the join processing is read. A method for determining a minimum work relation, characterized in that the method is configured to determine a configuration.
JP56154696A 1981-09-29 1981-09-29 Decision system for minimum working relation Granted JPS5856031A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP56154696A JPS5856031A (en) 1981-09-29 1981-09-29 Decision system for minimum working relation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP56154696A JPS5856031A (en) 1981-09-29 1981-09-29 Decision system for minimum working relation

Publications (2)

Publication Number Publication Date
JPS5856031A JPS5856031A (en) 1983-04-02
JPS6318777B2 true JPS6318777B2 (en) 1988-04-20

Family

ID=15589940

Family Applications (1)

Application Number Title Priority Date Filing Date
JP56154696A Granted JPS5856031A (en) 1981-09-29 1981-09-29 Decision system for minimum working relation

Country Status (1)

Country Link
JP (1) JPS5856031A (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS624877A (en) * 1985-06-28 1987-01-10 Hitachi Chem Co Ltd Electroless copper plating solution
JP3570082B2 (en) * 1996-05-24 2004-09-29 ソニー株式会社 Database device and database search method

Also Published As

Publication number Publication date
JPS5856031A (en) 1983-04-02

Similar Documents

Publication Publication Date Title
EP0070119B1 (en) Join operation processing system in relational model
US6466931B1 (en) Method and system for transparently caching and reusing query execution plans efficiently
US5640555A (en) Performance optimization in a heterogeneous, distributed database environment
US6339777B1 (en) Method and system for handling foreign key update in an object-oriented database environment
US5950210A (en) Database row version differentiation process
US5829006A (en) System and method for efficient relational query generation and tuple-to-object translation in an object-relational gateway supporting class inheritance
US5732274A (en) Method for compilation using a database for target language independence
EP0633538A2 (en) Relational database management system
US6122644A (en) System for halloween protection in a database system
US6343286B1 (en) Efficient technique to defer large object access with intermediate results
US8108375B2 (en) Processing database queries by returning results of a first query to subsequent queries
EP0753176A1 (en) Improved method and apparatus for data access in multiprocessor digital data processing systems
US6748377B1 (en) Facilitating query pushdown in a multi-tiered database environment
JPH05233720A (en) Data base assist method for db
US20040220908A1 (en) Information retrieval system and method for optimizing queries having maximum or minimum function aggregation predicates
US6353819B1 (en) Method and system for using dynamically generated code to perform record management layer functions in a relational database manager
US20040083204A1 (en) Query modification analysis
JP3808941B2 (en) Parallel database system communication frequency reduction method
JPS6318777B2 (en)
JP2780996B2 (en) Query optimization processing method
JPH09305622A (en) Method and system for managing data base having document retrieval function
JPH0877201A (en) System and method for document database retrieval
US6438536B1 (en) Method and system for dynamically generating code to enhance the performance of a relational database manager that provides access to a relational database
JPH05204727A (en) Method and system for managing data base
US20240012803A1 (en) Mechanisms for deleting triples of a database store