JPH0764837A - Computer system - Google Patents

Computer system

Info

Publication number
JPH0764837A
JPH0764837A JP5211413A JP21141393A JPH0764837A JP H0764837 A JPH0764837 A JP H0764837A JP 5211413 A JP5211413 A JP 5211413A JP 21141393 A JP21141393 A JP 21141393A JP H0764837 A JPH0764837 A JP H0764837A
Authority
JP
Japan
Prior art keywords
sql
source
information
database
buffer
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
JP5211413A
Other languages
Japanese (ja)
Other versions
JP3253772B2 (en
Inventor
Kazunori Shimakawa
和典 島川
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP21141393A priority Critical patent/JP3253772B2/en
Publication of JPH0764837A publication Critical patent/JPH0764837A/en
Application granted granted Critical
Publication of JP3253772B2 publication Critical patent/JP3253772B2/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 improve the performance of data base operation responding to an SQL source by efficiently shortening the compilation time of this SQL source. CONSTITUTION:SQL information including the SQL source and the SQL object as its compilation result is generated for each inputted SQL source and is stored in an SQL information storage buffer 122 of a main memory 12. Contents of this SQL information storage buffer 122 are substituted by the technique of LRU or the like, and then, only the latest SQL information is left in the SQL information storage buffer 122, and the other SQL information are held on a disk device 14. The SQL information storage buffer 122 is retrieved in accordance with an inputted SQL source, and the SQL object corresponding to this SQL source is called and executed when existing. Since the compilation processing of the SQL source is unnecessary at this time, the data base operation is efficiently performed.

Description

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

【0001】[0001]

【産業上の利用分野】この発明は、データベース操作言
語であるSQLをコンパイルしそのオブジェクトを実行
してデータベース操作を行うコンピュータシステムに関
する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a computer system for compiling SQL, which is a database operation language, and executing its objects to perform database operations.

【0002】[0002]

【従来の技術】一般に、コンピュータシステム上に構築
されたデータベースシステムにおいては、その端末から
発行されるデータベース操作言語に従ってデータベース
の検索、更新等が行われる。データベース操作言語とし
ては、SQLが良く利用されている。SQLは関係型デ
ータベースに対して検索要求や更新要求を行なうための
言語であり、非定型業務における操作の容易性を図るた
めにSELECT,FROM,WHEREの3つの基本
句からなる簡単な構文によって表現される。
2. Description of the Related Art Generally, in a database system constructed on a computer system, the database is searched and updated according to the database operation language issued from the terminal. SQL is often used as a database operation language. SQL is a language for making a search request or an update request to a relational database, and is expressed by a simple syntax consisting of three basic phrases SELECT, FROM, and WHERE in order to facilitate the operation in atypical work. To be done.

【0003】このようなSELECT,FROM,WH
EREによって記述されたSQLソースが端末から発行
されると、そのSQLソースはホストコンピュータシス
テムのデータベースシステムに送られる。データベース
システムは、まず、そのSQLソースをコンパイルし、
SQLオブジェクトに変換する。そして、データベース
管理システムは、SQLオブジェクトを実行することに
よって、SQLソースによって要求された問い合わせに
対応するデータベース操作を実行し、必要に応じてその
操作結果を端末の画面に表示する。
Such SELECT, FROM, WH
When the SQL source described by the ERE is issued by the terminal, the SQL source is sent to the database system of the host computer system. The database system first compiles its SQL source,
Convert to SQL object. Then, the database management system executes the SQL object to execute the database operation corresponding to the inquiry requested by the SQL source, and displays the operation result on the screen of the terminal as necessary.

【0004】このように、ホストコンピュータのデータ
ベースシステムにおいては、端末からのSQLソースを
受け付ける度にコンパイル処理を行う必要がある。この
場合、SQLソースのコンパイルは、データベースのス
キーマ情報を参照しながら行われる。スキーマ情報はデ
ータベースに蓄積されているデータの形式を定義するも
のであり、データベースの蓄積データと共にディスク装
置にデータベース化されて格納されているのが普通であ
る。このため、スキーマ情報の取得にはディスク装置か
らの数多くの入力処理が必要とされる。したがって、従
来のデータベースシステムでは、コンパイル処理に時間
がかかり、それによってシステムの性能低下が引き起こ
される欠点があった。
As described above, in the database system of the host computer, it is necessary to compile each time the SQL source is received from the terminal. In this case, the SQL source is compiled with reference to the schema information of the database. The schema information defines the format of the data stored in the database, and is usually stored in the disk device as a database together with the stored data in the database. Therefore, a lot of input processing from the disk device is required to acquire the schema information. Therefore, the conventional database system has a drawback in that the compilation process takes a long time, which causes a decrease in system performance.

【0005】そこで、最近では、システム性能を向上さ
せるための次のような2つの方式が考えられている。1
つは、ユーザがデータベースシステムを使用している期
間のみSQLオブジェクトを一時的に主記憶上に保持
し、そのSQLオブジェクトに対応するSQLソースが
再度発行された場合にその保持されているSQLオブジ
ェクトを利用するという方式である。
Therefore, recently, the following two methods for improving system performance have been considered. 1
One is to temporarily retain the SQL object in the main memory only while the user is using the database system, and when the SQL source corresponding to the SQL object is issued again, the retained SQL object is retained. It is a method of using.

【0006】もう1つは、ストアドプロシジャと称され
る方式であり、ある特定の問い合わせ処理に対応するS
QLソースをプリコンパイルして専用のライブラリに登
録しておき、それをユーザが呼び出すという方式であ
る。
[0006] The other is a method called a stored procedure, which corresponds to a specific inquiry process.
In this method, the QL source is precompiled, registered in a dedicated library, and the user calls it.

【0007】前者の方式では、データベースシステムに
対するある特定のセッションにおいて同一内容のSQL
ソースが何度もユーザから発行される場合にはコンパイ
ル処理が省けるので有効であるが、ユーザがデータベー
スシステムの使用を一旦終了すると主記憶上に保持され
ていたSQLオブジェクトはすべて破棄されてしまう。
このため、ユーザが再度データベースシステムとのセッ
ションを開始した場合には、SQLオブジェクが存在し
ないのでデータベースシステムはコンパイル処理から行
う必要がある。したがって、前者の方式では、実際上十
分な性能向上を期待することができない。また、もしデ
ータベースシステムの使用終了後もSQLオブジェクト
を破棄せずに主記憶上に保持し続けたとすると、主記憶
の大部分がSQLオブジェクトによって占有されてしま
うことになる。この場合、使用頻度の低いSQLオブジ
ェクトによってメモリ資源が浪費されたり、残りメモリ
容量の低下による処理速度の低下などの問題が生じる。
In the former method, the SQL having the same content is used in a specific session with the database system.
This is effective because the compilation process can be omitted when the source is issued many times by the user, but once the user finishes using the database system, all SQL objects held in the main memory are destroyed.
Therefore, when the user starts the session with the database system again, the SQL system does not exist and the database system needs to start the compilation process. Therefore, in the former method, practically sufficient performance improvement cannot be expected. Further, if the SQL object is kept in the main memory without being discarded even after the use of the database system, most of the main memory will be occupied by the SQL object. In this case, there are problems that memory objects are wasted by SQL objects that are used infrequently, and processing speed is reduced due to reduction in remaining memory capacity.

【0008】後者の方式では、定型の問い合わせを行う
場合は問題ないが、問い合わせ内容が一定に定まらない
非定型の問い合わせに対処できない問題がある。もし、
非定型の問い合わせに対処するためには、すべての発生
し得る問い合わせパターンに対応した多数のSQLオブ
ジェクトを含むプログラムをライブラリに登録しておく
必要が生じる。また、この方式では、本来のSQLの良
さ、つまり、非定型業務における操作の容易性が損なわ
れるという問題がある。
In the latter method, there is no problem in making a fixed inquiry, but there is a problem in that it cannot deal with an atypical inquiry in which the contents of the inquiry are not fixed. if,
In order to deal with atypical queries, it is necessary to register a program containing a large number of SQL objects corresponding to all possible query patterns in a library. In addition, this method has a problem that the original goodness of SQL, that is, the easiness of operation in an atypical work is impaired.

【0009】[0009]

【発明が解決しようとする課題】従来では、SQLソー
スが入力される度にそれをコンパイルする必要があり、
それによってデータベースシステムの性能が低下される
欠点があった。また、コンパイル結果である全てのSQ
Lオブジェクトを主記憶上に保持しておいたのでは、主
記憶の大部分がSQLオブジェクトによって占有されて
しまい、メモリ資源が浪費される。さらに、ストアドプ
ロシジャ方式を採用した場合には、コンパイルは不要と
なるものの、非定型業務における操作の容易性が損なわ
れる欠点がある。
Conventionally, it is necessary to compile the SQL source each time it is input.
As a result, the performance of the database system is degraded. Also, all SQs that are compilation results
If the L object is held in the main memory, most of the main memory is occupied by the SQL object, and the memory resource is wasted. Further, when the stored procedure method is adopted, although compiling is unnecessary, there is a drawback that the easiness of operation in non-routine work is impaired.

【0010】この発明はこのような点に鑑みてなされた
もので、主記憶のメモリ資源を浪費すること無く実行す
るコンパイル回数を低減できるようにして、高性能で且
つ非定型業務に適したデータベース操作を行うことがで
きるコンピュータシステムを提供することを目的とす
る。
The present invention has been made in view of the above circumstances, and it is possible to reduce the number of compilations to be executed without wasting the memory resources of the main memory, and to achieve a high-performance database suitable for atypical work. An object is to provide a computer system capable of performing operations.

【0011】[0011]

【課題を解決するための手段および作用】この発明は、
入力されたデータベース問い合せのためのSQLソース
をコンパイルしてSQLオブジェクトを生成し、そのS
QLオブジェクトを実行することによって問い合わせに
応じたデータベース操作を行うコンピュータシステムに
おいて、前記入力された各SQLソース毎に、SQLソ
ースとそのコンパイル結果であるSQLオブジェクトと
を含むSQL情報を生成し、そのSQL情報を前記コン
ピュータシステムの主記憶のSQLバッファに格納する
手段と、前記主記憶のSQLバッファに最新の1以上の
SQLソースに対応するSQL情報だけが保持されるよ
うに、前記SQLバッファと前記コンピュータシステム
の2次記憶との間のデータ転送によってSQLバッファ
の内容を置き換える手段と、入力されたSQLソースに
従って前記主記憶のSQLバッファまたは2次記憶を検
索してそのSQLソースに対応するSQLオブジェクト
を呼び出し、そのSQLオブジェクトを実行する手段と
を具備することを特徴とする。
Means and Actions for Solving the Problems
Compile the input SQL source for database inquiry to generate SQL object,
In a computer system that performs a database operation in response to a query by executing a QL object, SQL information including an SQL source and an SQL object that is a compilation result of the SQL source is generated for each of the input SQL sources, and the SQL information is generated. A means for storing information in an SQL buffer of the main memory of the computer system; and the SQL buffer and the computer so that only the SQL information corresponding to the latest one or more SQL sources is held in the SQL buffer of the main memory. A means for replacing the contents of the SQL buffer by transferring data to and from the secondary storage of the system, and searching the SQL buffer or the secondary storage of the main storage according to the input SQL source to find the SQL object corresponding to the SQL source. Call that Characterized by comprising a means for executing the QL object.

【0012】このコンピュータシステムにおいては、入
力された各SQLソース毎にSQLソースとそのコンパ
イル結果であるSQLオブジェクトとを含むSQL情報
が生成され、それが主記憶のSQLバッファに格納され
る。SQLバッファの内容は例えばLRUなどの手法に
よって置き換えられ、これによって最新のSQL情報だ
けがSQLバッファに残され、他のSQL情報は2次記
憶に保持される。このため、主記憶のSQLバッファに
は結果として使用頻度の高いSQLソースを含むSQL
情報が保持されることになり、メモリ資源の浪費を防止
することができる。また、主記憶のSQLバッファは入
力されたSQLソースに従って検索され、そのSQLソ
ースに対応するSQLオブジェクトがあればそれが呼び
出されて実行される。この時、SQLソースのコンパイ
ル処理は不要であるので、問い合わせに応じたデータベ
ース操作を効率良く行うことができる。
In this computer system, SQL information including the SQL source and the SQL object that is the compilation result of the SQL source is generated for each input SQL source, and the SQL information is stored in the SQL buffer of the main memory. The contents of the SQL buffer are replaced by a technique such as LRU, whereby only the latest SQL information is left in the SQL buffer, and other SQL information is held in the secondary storage. For this reason, the SQL buffer of the main memory eventually contains an SQL source that includes a frequently used SQL source.
Since the information is retained, it is possible to prevent waste of memory resources. The SQL buffer in the main memory is searched according to the input SQL source, and if there is an SQL object corresponding to the SQL source, it is called and executed. At this time, it is not necessary to compile the SQL source, so that the database operation according to the inquiry can be efficiently performed.

【0013】さらに、変更対象のスキーマ情報を参照し
ているSQLソースを含むSQL情報をSQLバッファ
または2次記憶から削除することにより、保持されてい
るSQLオブジェクトと実際のデータベースとの整合性
を保証することもできる。
Furthermore, by deleting the SQL information including the SQL source referring to the schema information to be changed from the SQL buffer or the secondary storage, the consistency between the held SQL object and the actual database is guaranteed. You can also do it.

【0014】[0014]

【実施例】以下、図面を参照してこの発明の実施例を説
明する。図1には、この発明の一実施例に係わるコンピ
ュータシステムの全体構成が示されている。このコンピ
ュータシステムは、ホストコンピュータ10と、これに
接続される複数の端末20から構成されるものであり、
ホストコンピュータ10は各端末20に対してデータベ
ースの検索、更新等のサービスを提供する。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 shows the overall configuration of a computer system according to an embodiment of the present invention. This computer system includes a host computer 10 and a plurality of terminals 20 connected to the host computer 10,
The host computer 10 provides services such as database search and update to each terminal 20.

【0015】ホストコンピュータ10は、図示のよう
に、CPU11、メインメモリ12、データベース演算
処理装置13、ディスク装置14、I/Oチャネル1
5、および通信インターフェース16を備えており、そ
れらCPU11、メインメモリ12、データベース演算
処理装置13、I/Oチャネル15、および通信インタ
ーフェース16はシステムバス17を介して相互接続さ
れている。
As shown, the host computer 10 includes a CPU 11, a main memory 12, a database processing unit 13, a disk unit 14, and an I / O channel 1.
5 and a communication interface 16, and the CPU 11, main memory 12, database arithmetic processing unit 13, I / O channel 15, and communication interface 16 are interconnected via a system bus 17.

【0016】CPU11は、ホストコンピュータ10の
システム全体の制御を司るためのものであり、データベ
ース管理システム(DBMMS)121を実行すること
によってデータベース141の管理やそのデータベース
141に蓄積されたデータの操作を行う。また、CPU
11は、必要に応じてデータベース演算処理装置13に
コマンドを発行し、ソートや関係演算等の処理をデータ
ベース演算処理装置13に実行させる。
The CPU 11 controls the entire system of the host computer 10. By executing a database management system (DBMMS) 121, the CPU 11 manages the database 141 and operates data stored in the database 141. To do. Also, CPU
Reference numeral 11 issues a command to the database operation processing device 13 as necessary, and causes the database operation processing device 13 to execute processing such as sorting and relational operation.

【0017】メインメモリ12はCPU11によって実
行されるプログラムやデータを格納するためのものであ
り、ここには、データベース管理システム(DBMM
S)121が格納されている。このデータベース管理シ
ステム(DBMMS)121はデータベ−スの管理を行
うためのシステムプログラムである。また、このメイン
メモリ12のある一定の記憶領域はSQL情報格納用バ
ッファ122として定義されており、ここにはCPU1
1によってSQL情報が格納される。このSQL情報は
SQLソースがコンパイルする度に生成されるものであ
り、各端末20から発行されたSQLソースとそのコン
パイル結果であるSQLオプジェクト等との対応関係を
示すものであり、その詳細については図2を参照して後
述する。
The main memory 12 is for storing programs and data to be executed by the CPU 11, and includes a database management system (DBMM).
S) 121 is stored. The database management system (DBMMS) 121 is a system program for managing a database. Further, a certain storage area of the main memory 12 is defined as an SQL information storage buffer 122, where the CPU 1
1 stores SQL information. This SQL information is generated each time the SQL source is compiled, and shows the correspondence relationship between the SQL source issued from each terminal 20 and the SQL object or the like that is the compilation result. It will be described later with reference to FIG.

【0018】データベース演算処理装置13はソートや
関係演算等の処理を高速実行する専用ハードウェアであ
り、CPU11からのコマンドにしたがって動作する。
ディスク装置14は、I/Oチャネル15を介してシス
テムバス17に接続されており、ホストコンピュータ1
0の2次記憶として使用される。このディスク装置14
は磁気ディスク、光磁気ディスク、または半導体ディス
ク装置等から構成されており、ここには、データディク
ショナリ141およびデータベース142が格納されて
いる。
The database arithmetic processing unit 13 is a dedicated hardware for executing processing such as sorting and relational operation at high speed, and operates according to commands from the CPU 11.
The disk device 14 is connected to the system bus 17 via the I / O channel 15, and the host computer 1
Used as secondary storage of zero. This disk device 14
Is composed of a magnetic disk, a magneto-optical disk, a semiconductor disk device, or the like, and a data dictionary 141 and a database 142 are stored therein.

【0019】データディクショナリ141はデータベー
ス142の蓄積データを管理するカタログデータ群であ
り、スキーマ情報141a、およびSQL情報141b
を含んでいる。スキーマ情報141aは、データベース
142の蓄積データを定義するものであり、データベー
ス142のテーブルやカラムに関する情報から構成され
ている。このスキーマ情報141aはデータベース14
2の定義の変更に応答して更新され、データベース14
2の内容が新しくなる度にバージョンアップされる。
The data dictionary 141 is a catalog data group for managing the accumulated data of the database 142, and schema information 141a and SQL information 141b.
Is included. The schema information 141a defines the accumulated data of the database 142, and is composed of information about the tables and columns of the database 142. This schema information 141a is the database 14
Database 14 updated in response to changes in definition 2
Every time the contents of 2 are updated, it will be upgraded.

【0020】SQL情報141bは、前述のSQL情報
格納用バッファ122に格納されているものと同一の情
報である。すなわち、SQL情報格納用バッファ122
の内容は、最新の内容だけがそこに保持されるようにL
RU法(Least-Recently-Used 法)によって置き換えら
れ、SQL情報格納用バッファ122から排出されたS
QL情報がSQL情報141bとしてデータディクショ
ナリ141に転送される。データベース142は、関係
型モデルをなす複数のテーブルから構成されている。
The SQL information 141b is the same information as that stored in the above-mentioned SQL information storage buffer 122. That is, the SQL information storage buffer 122
The content of L is such that only the latest content is retained there.
S replaced by the RU method (Least-Recently-Used method) and discharged from the SQL information storage buffer 122
The QL information is transferred to the data dictionary 141 as the SQL information 141b. The database 142 is composed of a plurality of tables forming a relational model.

【0021】図2には、SQL情報のデータ構造の一例
が示されている。各SQL情報は、図示のように、登録
時間情報、スキーマバージョン情報、SQL識別子、S
QLソース、およびSQLオブジェクトから構成されて
おり、それらはSQL情報格納用バッファ122の対応
するエントリe1〜e5にそれぞれ格納される。
FIG. 2 shows an example of the data structure of SQL information. As shown in the figure, each SQL information includes registration time information, schema version information, SQL identifier, S
It is composed of a QL source and an SQL object, which are stored in the corresponding entries e1 to e5 of the SQL information storage buffer 122, respectively.

【0022】エントリe1にセットされる登録時間情報
は、生成されたSQL情報をSQL情報格納用バッファ
122に登録する時間を示すものであり、登録年月日情
報と時間情報とを含む。また、データディクショナリ1
41の内容はSQLソースによりアクセス可能な形式
(つまり、データベース142上のテーブルと同一の形
式)であるので、その中に格納されているSQL情報1
41b自体をSQLソースによりアクセスすることがで
きる。この場合、登録時間は、端末20にどのようなS
QL情報が何時登録されたかを画面表示によってユーザ
に知らせるといった運用にも利用する事ができる。
The registration time information set in the entry e1 indicates the time at which the generated SQL information is registered in the SQL information storage buffer 122, and includes registration date information and time information. Also, the data dictionary 1
Since the content of 41 is in a format that can be accessed by the SQL source (that is, the same format as the table on the database 142), the SQL information 1 stored therein is
41b itself can be accessed by SQL source. In this case, the registration time depends on what S
It can also be used for operations such as notifying the user of when the QL information was registered by displaying a screen.

【0023】エントリ2にセットされるスキーマバージ
ョン情報は、SQLソースをコンパイルする際に使用し
たスキーマ情報141aのバージョンを示すものであ
る。また、そのスキーマバージョン情報は、SQL情報
が生成されたときにそのベースとなったスキーマ情報1
41aがユーザによって変更されたり削除されたとき
に、それと同じスキーマバージョンをサーチしそのスキ
ーマバージョンと同一バージョンのSQL情報141b
をデータディクショナリ141上から削除し、古くて不
正なSQLオブジェクトによりデータベース142をア
クセスすることのないようにするためにも利用される。
The schema version information set in the entry 2 indicates the version of the schema information 141a used when compiling the SQL source. In addition, the schema version information is the schema information 1 which is the base when the SQL information is generated.
When 41a is changed or deleted by the user, the same schema version is searched and the SQL information 141b of the same version as the schema version is searched.
Is also used for deleting the database 142 from the data dictionary 141 so that the database 142 is not accessed by an old and invalid SQL object.

【0024】エントリ3にセットされるSQL識別子は
該当するSQL情報を識別するためのID情報であり、
同一内容のデータベース問い合わせを何度も行う場合に
は端末20はそのSQL識別子をSQLソースの代わり
に発行することもできる。この場合には、例えば、端末
20にすべてのあるいは一部のSQL情報を表示し、そ
こに表示されたSQLソースを確認し、対応するSQL
識別子を端末20から指定するといった運用ができ、操
作性を向上できる。
The SQL identifier set in the entry 3 is ID information for identifying the corresponding SQL information,
When the database inquiry of the same content is repeatedly made, the terminal 20 can issue the SQL identifier instead of the SQL source. In this case, for example, all or part of the SQL information is displayed on the terminal 20, the SQL source displayed there is confirmed, and the corresponding SQL is displayed.
Operation such as designating an identifier from the terminal 20 can be performed, and operability can be improved.

【0025】エントリe4にセットされるSQLソース
は、SQLで記述されたソースプログラムそのものであ
り、例えば、 SELECT * FROM 社員表 WHERE 勤続年数 >= 10 のように記述される。
The SQL source set in the entry e4 is the source program itself described in SQL, and is described as, for example, SELECT * FROM employee table WHERE years of service> = 10.

【0026】これは、データベース142にテーブルと
して登録されている社員表から勤続年数が10年以上の
全てのフィールド(カラム)を選択することを指定する
問い合わせである。
This is an inquiry designating that all fields (columns) having been in service for 10 years or more are selected from the employee table registered as a table in the database 142.

【0027】エントリe5にセットされるSQLオブジ
ェクトは、エントリe4のSQLソースのコンパイル結
果そのものである。次に、ホストコンピュータ10のデ
ータベース管理動作を説明する。
The SQL object set in the entry e5 is the compilation result itself of the SQL source in the entry e4. Next, the database management operation of the host computer 10 will be described.

【0028】まず、図3のフローチャートを参照して、
ユーザがホストコンピュータ10に最初にログオンする
場合、つまり、プリコンパイルされたSQLオブジェク
トが全く存在してない場合を例にとって説明する。
First, referring to the flow chart of FIG.
A case where the user first logs on to the host computer 10, that is, there is no precompiled SQL object will be described as an example.

【0029】ユーザが端末20からディスク装置14上
のデータベース142への問い合わせのためにログオン
してSQLソースを発行すると、まず、CPU11上で
動作しているデータベース管理システム121によって
そのSQLソースが受け付けられる(ステップS1
1)。データベース管理システム121は、メモリ12
上に予め用意されているSQL情報格納用バッファ12
2内の1つのSQL情報領域のエントリe4に受け取っ
たSQLソース21を置き、それをコンパイルしてSQ
Lオブジェクトを生成する(ステップS11,S1
2)。
When the user logs on from the terminal 20 to issue an inquiry to the database 142 on the disk device 14 and issues an SQL source, first, the SQL source is accepted by the database management system 121 operating on the CPU 11. (Step S1
1). The database management system 121 includes a memory 12
The SQL information storage buffer 12 prepared in advance above
Place the received SQL source 21 in the entry e4 of one SQL information area in 2 and compile it to SQ
Generate an L object (steps S11 and S1)
2).

【0030】この後、データベース管理システム121
は、登録時間、データディクショナリ141上に格納さ
れているテーブルやカラムに関するスキーマ情報141
aのバージョン、SQLソースを識別するSQL識別
子、及びSQLオブジェクトをSQL情報としてSQL
情報格納用バッファ122上で生成すると共に、それと
同一内容のSQL情報をディスク装置14のデータディ
クショナリ141上にSQL情報141bとして登録す
る(ステップS14、S15)。
After this, the database management system 121
Is the registration time, schema information 141 regarding the tables and columns stored in the data dictionary 141.
The version of a, the SQL identifier for identifying the SQL source, and the SQL object as SQL information are SQL
The SQL information having the same content as that generated in the information storage buffer 122 is registered in the data dictionary 141 of the disk device 14 as the SQL information 141b (steps S14 and S15).

【0031】そして、データベース管理システム121
は、メモリ12上のSQLオブジェクトを実行し、結果
を端末30に表示する(ステップS16、S17)。以
下同様にして、複数のSQLソースに対して個別にSQ
L情報を生成しデータディクショナリ141上に登録
し、一連の問い合わせ処理が完了するとユーザがログオ
フする。
The database management system 121
Executes the SQL object on the memory 12 and displays the result on the terminal 30 (steps S16 and S17). In the same manner, SQ is individually applied to a plurality of SQL sources.
The L information is generated, registered in the data dictionary 141, and the user is logged off when a series of inquiry processing is completed.

【0032】ユーザのログオフ後もデータベース管理シ
ステム121は、メモリ12上のSQL情報格納用バッ
ファ122を消去することなく、ホストコンピュータ1
0のシステムが停止されるまで保持しておく。この保持
方法は、前述したようにいわゆるLRU法(Least-Rece
ntly-Used 法)によるものであり、一番古く発行された
SQLソースあるいはSQL識別子が付与されたSQL
ソースに対応するSQL情報をデータディクショナリ1
41に書き出すことで、一定サイズのSQL情報格納バ
ッファ122には常に最新のSQL情報の集まりだけを
保持することができる。
Even after the user logs off, the database management system 121 does not erase the SQL information storage buffer 122 on the memory 12 and the host computer 1
Hold 0 until the system is stopped. This holding method is the so-called LRU method (Least-Rece
ntly-Used method), and the SQL source issued the oldest or SQL with the SQL identifier added
Data dictionary 1 for SQL information corresponding to the source
By writing to the 41, the SQL information storage buffer 122 having a fixed size can always hold only the latest collection of SQL information.

【0033】次に、図4を参照して、ユーザがログオフ
後、再びログオンしてデータベース問い合わせのために
SQLソースを発行した場合の動作について説明する。
データベース管理システム121は、SQLソースを受
け付けると、それが以前に発行したものと同一のSQL
ソースであるかを調べるために、まずメモリ12上のS
QL情報格納用バッファ122内をSQLソースに従っ
てサーチする(ステップS21〜S23)。
Next, with reference to FIG. 4, the operation when the user logs off and then logs on again and issues the SQL source for database inquiry will be described.
Upon receiving the SQL source, the database management system 121 receives the same SQL as that previously issued.
In order to check whether it is the source, S on the memory 12 is first.
The buffer 122 for storing QL information is searched according to the SQL source (steps S21 to S23).

【0034】SQL情報格納用バッファ122に同一の
SQLソースが存在していれば、そのSQL情報に格納
されているSQLオブジェクトをメモリ12から呼び出
してそれを実行する(ステップS24、S31,S3
2)。
If the same SQL source exists in the SQL information storage buffer 122, the SQL object stored in the SQL information is called from the memory 12 and executed (steps S24, S31, S3).
2).

【0035】一方、存在していなければディスク装置1
4上のデータディクションリ141のSQL情報141
b内のSQLソースをサーチし、同一SQLソースが存
在していれば、そのSQL情報に格納されているSQL
オブジェクトをディスク装置14からメモリ12上に呼
び出して実行する(ステップS25、S26、S27、
S31、S32)。
On the other hand, if it does not exist, the disk device 1
SQL information 141 of data dictionary 141 on 4
The SQL source in b is searched, and if the same SQL source exists, the SQL stored in the SQL information is searched.
The object is called from the disk device 14 onto the memory 12 and executed (steps S25, S26, S27,
S31, S32).

【0036】メモリ12とディスク装置14のどちらに
も該当するSQLソースが存在していなければ、前述の
ように、SQLソースのコンパイル、SQL情報の生成
および登録処理を行った後、コンパイル結果であるSQ
Lオブジェクトを実行する(ステップS28〜S3
2)。
If the corresponding SQL source does not exist in either the memory 12 or the disk device 14, the SQL source is compiled and the SQL information is generated and registered as described above. SQ
Execute the L object (steps S28 to S3)
2).

【0037】この後、ホストコンピュータ10のシステ
ム停止時には、データベース管理システム121は、メ
モリ12上のSQL情報格納用バッファ122内のすべ
てのSQL情報をディスク装置14上のデータディクシ
ョナリ141にSQL情報141bとしてセーブした後
に、処理を終了する。このため、電源オフ後において
も、最新のSQL情報を保持し続ける事ができる。
After that, when the system of the host computer 10 is stopped, the database management system 121 uses all the SQL information in the SQL information storage buffer 122 on the memory 12 as SQL information 141b in the data dictionary 141 on the disk device 14. After saving, the process ends. Therefore, the latest SQL information can be retained even after the power is turned off.

【0038】次に、図5のフローチャートを参照して、
保持されているSQL情報を削除する動作を説明する。
例えばデータベース142の構造定義の変更が必要な場
合には、データベース管理システム121は、システム
管理者や特権ユーザからの要求に応じてデータディクシ
ョナリ141のスキーマ情報141aの変更や削除を行
う(ステップS41)。このとき、データベース管理シ
ステム121は、データディクショナリ141のSQL
情報141bをサーチする(ステップS43)。そし
て、変更や削除の対象となった旧バージョンのスキーマ
情報をベースとして生成されたSQL情報を見付け出
し、それをデータディクショナリ141、SQL情報格
納用バッファ122から削除する(ステップS43、S
44)。
Next, referring to the flow chart of FIG.
The operation of deleting the held SQL information will be described.
For example, when the structure definition of the database 142 needs to be changed, the database management system 121 changes or deletes the schema information 141a of the data dictionary 141 in response to a request from the system administrator or a privileged user (step S41). . At this time, the database management system 121 uses the SQL of the data dictionary 141.
The information 141b is searched (step S43). Then, it finds the SQL information generated based on the old version of the schema information that has been changed or deleted, and deletes it from the data dictionary 141 and the SQL information storage buffer 122 (steps S43 and S).
44).

【0039】以上のように、この実施例のデータベース
システムにおいては、入力された各SQLソース毎にS
QLソースとそのコンパイル結果であるSQLオブジェ
クトとを含むSQL情報が生成され、それがメインメモ
リ12のSQL情報格納用バッファ122に格納され
る。SQL情報格納用バッファ122の内容は例えばL
RUなどの手法によって置き換えられ、これによって最
新のSQL情報だけがSQL情報格納用バッファ122
に残され、他のSQL情報はディスク装置14のデータ
ディクショナリ141上に保持される。このため、メイ
ンメモリ12のSQL情報格納用バッファ122には結
果として使用頻度の高いSQLソースを含むSQL情報
が保持されることになり、ディスクアクセスの回数を抑
制でき、且つメモリ資源の浪費を防止することができ
る。
As described above, in the database system of this embodiment, S is input for each input SQL source.
SQL information including a QL source and an SQL object which is a compilation result of the QL source is generated and stored in the SQL information storage buffer 122 of the main memory 12. The content of the SQL information storage buffer 122 is, for example, L
It is replaced by a method such as RU, so that only the latest SQL information is stored in the SQL information storage buffer 122.
Other SQL information is retained in the data dictionary 141 of the disk device 14. Therefore, as a result, the SQL information storage buffer 122 of the main memory 12 holds the SQL information including the frequently used SQL source, so that the number of times of disk access can be suppressed and the waste of memory resources can be prevented. can do.

【0040】また、メインメモリ12のSQL情報格納
用バッファ122は入力されたSQLソースに従って検
索され、そのSQLソースに対応するSQLオブジェク
トがあればそれが呼び出されて実行される。この時、S
QLソースのコンパイル処理は不要であるので、問い合
わせに応じたデータベース操作を効率良く行うことがで
きる。
Further, the SQL information storage buffer 122 of the main memory 12 is searched according to the input SQL source, and if there is an SQL object corresponding to the SQL source, it is called and executed. At this time, S
Since the compilation process of the QL source is unnecessary, the database operation according to the inquiry can be efficiently performed.

【0041】さらに、変更対象のスキーマ情報を参照し
ているSQLソースを含むSQL情報をデータディクシ
ョナリ141、SQL情報格納用バッファ122から削
除することにより、保持されているSQLオブジェクト
と実際のデータベースとの整合性を保証することもでき
る。
Further, by deleting the SQL information including the SQL source that refers to the schema information to be changed from the data dictionary 141 and the SQL information storage buffer 122, the stored SQL object and the actual database are Consistency can also be guaranteed.

【0042】[0042]

【発明の効果】以上のように、この発明によれば、ユー
ザが一度発行したSQLソースとSQLオブジェクト等
をSQL情報としてデータディクショナリ上に登録して
おくことにより、同一SQLソースの再発行後のコンパ
イル時間をなくしSQLソース実行の性能を向上させる
ことができる。したがって、主記憶のメモリ資源を浪費
すること無く実行するコンパイル回数を低減できるよう
になり、高性能で且つ非定型業務に適したデータベース
操作を実現できる。
As described above, according to the present invention, the SQL source and the SQL object which the user once issued are registered as SQL information in the data dictionary, so that the same SQL source after the reissue is issued. It is possible to eliminate the compile time and improve the performance of SQL source execution. Therefore, the number of compilations to be executed can be reduced without wasting the memory resource of the main memory, and a high-performance database operation suitable for atypical work can be realized.

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

【図1】この発明の一実施例に係わるコンピュータシス
テムの全体構成を示す図。
FIG. 1 is a diagram showing an overall configuration of a computer system according to an embodiment of the present invention.

【図2】同実施例のコンピュータシステムで管理される
SQL情報のデータ構造の一例を示す図。
FIG. 2 is an exemplary view showing an example of a data structure of SQL information managed by the computer system of the embodiment.

【図3】同実施例のコンピュータシステムにおけるデー
タベースアクセス時の動作の第1の例を説明するフロー
チャート。
FIG. 3 is a flowchart illustrating a first example of an operation at the time of database access in the computer system of the same embodiment.

【図4】同実施例のコンピュータシステムにおけるデー
タベースアクセス時の動作の第2の例を説明するフロー
チャート。
FIG. 4 is a flowchart illustrating a second example of an operation at the time of database access in the computer system of the same embodiment.

【図5】同実施例のコンピュータシステムにおけるSQ
L情報の削除動作を説明するフローチャート。
FIG. 5 is an SQ in the computer system of the same embodiment.
The flowchart explaining the deletion operation of L information.

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

10…ホストコンピュータ、11…CPU、12…メイ
ンメモリ、13…データベース演算処理装置、14…デ
ィスク装置、20…端末、121…データベース管理シ
ステム、122…SQL情報格納用バッファ、141…
データディクショナリ、141a…スキーマ情報、14
1b…SQL情報、142…データベース。
10 ... Host computer, 11 ... CPU, 12 ... Main memory, 13 ... Database operation processing device, 14 ... Disk device, 20 ... Terminal, 121 ... Database management system, 122 ... SQL information storage buffer, 141 ...
Data dictionary, 141a ... Schema information, 14
1b ... SQL information, 142 ... Database.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 入力されたデータベース問い合せのため
のSQLソースをコンパイルしてSQLオブジェクトを
生成し、そのSQLオブジェクトを実行することによっ
て問い合わせに応じたデータベース操作を行うコンピュ
ータシステムにおいて、 前記入力された各SQLソース毎に、SQLソースとそ
のコンパイル結果であるSQLオブジェクトとを含むS
QL情報を生成し、そのSQL情報を前記コンピュータ
システムの主記憶のSQLバッファに格納する手段と、 前記主記憶のSQLバッファに最新の1以上のSQLソ
ースに対応するSQL情報だけが保持されるように、前
記SQLバッファと前記コンピュータシステムの2次記
憶との間のデータ転送によってSQLバッファの内容を
置き換える手段と、 入力されたSQLソースに従って前記主記憶のSQLバ
ッファまたは2次記憶を検索してそのSQLソースに対
応するSQLオブジェクトを呼び出し、そのSQLオブ
ジェクトを実行する手段とを具備することを特徴とする
コンピュータシステム。
1. A computer system for compiling an input SQL source for a database inquiry to generate an SQL object, and executing the SQL object to perform a database operation in response to the inquiry. S that includes the SQL source and the SQL object that is the compilation result for each SQL source
Means for generating QL information and storing the SQL information in an SQL buffer of the main memory of the computer system, and so that only the SQL information corresponding to one or more latest SQL sources is held in the SQL buffer of the main memory. And means for replacing the contents of the SQL buffer by data transfer between the SQL buffer and the secondary storage of the computer system, and searching the SQL buffer or secondary storage of the main storage according to the input SQL source. A computer system comprising: means for calling an SQL object corresponding to an SQL source and executing the SQL object.
【請求項2】 入力されたSQLソースをコンパイルし
てSQLオブジェクトを生成し、そのSQLオブジェク
トを実行することによってデータベース操作を行うコン
ピュータシステムにおいて、 蓄積データとその蓄積データの形式を定義するスキーマ
情報とから構成されるデータベースが格納されるデータ
ベース記憶手段と、 前記スキーマ情報の変更の度に前記データベースの蓄積
データに対応するスキーマ情報のバージョンを更新する
手段と、 前記入力された各SQLソース毎に、SQLソース、そ
のコンパイル結果であるSQLオブジェクト、およびS
QLソースによって参照されるデータベースのバージョ
ン名を含むSQL情報を生成し、そのSQL情報を主記
憶のSQLバッファに格納する手段と、 前記主記憶のSQLバッファに最新の1以上のSQLソ
ースに対応するSQL情報だけが保持されるように、前
記SQLバッファと前記コンピュータシステムの2次記
憶との間のデータ転送によってSQLバッファの内容を
置き換える手段と、 入力されたSQLソースに従って前記主記憶のSQLバ
ッファまたは2次記憶を検索してそのSQLソースに対
応するSQLオブジェクトを呼び出し、そのSQLオブ
ジェクトを実行する手段と、 前記スキーマ情報のバージョンに従って前記主記憶のS
QLバッファまたは2次記憶を検索し、変更対象のスキ
ーマ情報を参照しているSQLソースを含むSQL情報
を前記主記憶のSQLバッファまたは2次記憶から削除
する手段とを具備することを特徴とするコンピュータシ
ステム。
2. A computer system for compiling an input SQL source to generate an SQL object, and executing the SQL object to perform a database operation, and stored data and schema information defining a format of the stored data. A database storing means for storing a database configured by: a means for updating the version of the schema information corresponding to the accumulated data of the database each time the schema information is changed; and for each of the input SQL sources, SQL source, SQL object which is the compilation result, and S
A means for generating SQL information including the version name of the database referred to by the QL source and storing the SQL information in the SQL buffer of the main memory, and one or more latest SQL sources in the SQL buffer of the main memory. Means for replacing the contents of the SQL buffer by a data transfer between the SQL buffer and the secondary storage of the computer system so that only SQL information is retained, and an SQL buffer of the main storage according to an input SQL source or A means for retrieving the secondary storage, invoking an SQL object corresponding to the SQL source, and executing the SQL object; and an S for the main storage according to the version of the schema information.
Means for searching the QL buffer or the secondary storage and deleting the SQL information including the SQL source referring to the schema information to be changed from the SQL buffer or the secondary storage of the main storage. Computer system.
JP21141393A 1993-08-26 1993-08-26 Computer system and database operation control method applied to the system Expired - Fee Related JP3253772B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP21141393A JP3253772B2 (en) 1993-08-26 1993-08-26 Computer system and database operation control method applied to the system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP21141393A JP3253772B2 (en) 1993-08-26 1993-08-26 Computer system and database operation control method applied to the system

Publications (2)

Publication Number Publication Date
JPH0764837A true JPH0764837A (en) 1995-03-10
JP3253772B2 JP3253772B2 (en) 2002-02-04

Family

ID=16605551

Family Applications (1)

Application Number Title Priority Date Filing Date
JP21141393A Expired - Fee Related JP3253772B2 (en) 1993-08-26 1993-08-26 Computer system and database operation control method applied to the system

Country Status (1)

Country Link
JP (1) JP3253772B2 (en)

Also Published As

Publication number Publication date
JP3253772B2 (en) 2002-02-04

Similar Documents

Publication Publication Date Title
US20200034364A1 (en) Query plan generation and execution in a relational database management system with a temporal-relational database
US8341120B2 (en) Apparatus and methods for transferring database objects into and out of database systems
US5685003A (en) Method and system for automatically indexing data in a document using a fresh index table
US7925632B2 (en) Transient data facility for database applications
US6240422B1 (en) Object to relational database mapping infrastructure in a customer care and billing system
US10671594B2 (en) Statement based migration for adaptively building and updating a column store database from a row store database based on query demands using disparate database systems
US20120158795A1 (en) Entity triggers for materialized view maintenance
CN111752959B (en) Real-time database cross-database SQL interaction method and system
US20040225666A1 (en) Materialized view system and method
US7953749B2 (en) Providing the timing of the last committed change to a row in a database table
US9171036B2 (en) Batching heterogeneous database commands
JPH0644128A (en) Data base management system and method supporting object directional programming
JPH0667951A (en) Database management system
CA2302303A1 (en) System for accessing database tables mapped into memory for high performance
JPH10240590A (en) Method for executing parallel database system routine
US6301581B1 (en) Method and system for managing access to a plurality of data objects
US11704317B2 (en) Partial group by for eager group by placement query plans
US10509632B2 (en) Model augmentation in a model-driven application development environment
CN114925084A (en) Distributed transaction processing method, system, device and readable storage medium
US20090171892A1 (en) Object Query Over Previous Query Results
US6856996B2 (en) Method, system, and program for accessing rows in one or more tables satisfying a search criteria
JPH11134368A (en) Language management program interface
JPH1040146A (en) Parallel database system communication frequency decreasing method
US7613710B2 (en) Suspending a result set and continuing from a suspended result set
JP3253772B2 (en) Computer system and database operation control method applied to the system

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20071122

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081122

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees