JP4084740B2 - Database search apparatus, database search method and program - Google Patents

Database search apparatus, database search method and program Download PDF

Info

Publication number
JP4084740B2
JP4084740B2 JP2003395888A JP2003395888A JP4084740B2 JP 4084740 B2 JP4084740 B2 JP 4084740B2 JP 2003395888 A JP2003395888 A JP 2003395888A JP 2003395888 A JP2003395888 A JP 2003395888A JP 4084740 B2 JP4084740 B2 JP 4084740B2
Authority
JP
Japan
Prior art keywords
search
schema
record
database
fact
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 - Fee Related
Application number
JP2003395888A
Other languages
Japanese (ja)
Other versions
JP2005157773A (en
Inventor
祥幸 寺門
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.)
Canon Marketing Japan Inc
Original Assignee
Canon Marketing Japan Inc
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 Canon Marketing Japan Inc filed Critical Canon Marketing Japan Inc
Priority to JP2003395888A priority Critical patent/JP4084740B2/en
Publication of JP2005157773A publication Critical patent/JP2005157773A/en
Application granted granted Critical
Publication of JP4084740B2 publication Critical patent/JP4084740B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

本発明は、複数のスキーマを有するデータベースに対するデータ検索を行うための技術に関するものである。   The present invention relates to a technique for performing data search for a database having a plurality of schemas.

データウェアハウスとして用いられる、複数のデータテーブルから構成されるデータベースに対するデータベース検索システムにおいては、データベースの管理者等が定義するスキーマによりデータベースが構築されている。そして、ユーザがデータベースに対する検索を行う場合には、データベース自由検索ツールがユーザの入力する検索及び出力の条件からデータベースのスキーマに合わせたクエリを生成してデータベースへの検索を行ってデータ出力をするものである。   In a database search system for a database composed of a plurality of data tables used as a data warehouse, a database is constructed by a schema defined by a database administrator or the like. When the user performs a search on the database, the database free search tool generates a query according to the database schema from the search and output conditions input by the user, performs a search to the database, and outputs the data. Is.

従来のデータベース検索システムにおいては、入力される検索に係わる条件の全てを満たすことが可能な画一的なスキーマを定義し、そのためのファクトテーブルを1つ用意しているために簡単な検索を行うだけでもクエリ実行時間の最適化を図ることができなかった。   In a conventional database search system, a uniform schema that can satisfy all the conditions related to the input search is defined, and a simple fact table is prepared for that purpose. Alone could not optimize the query execution time.

そこで、例えば特許文献1においてはユーザ利用方法にスキーマが合わない課題を解決するために、ユーザ利用状況情報としてSQL(Structured Query Language)を保存し、ユーザのスキーマ利用パターンを導き出し、設定されているチューニング目標(スループット、記憶容量等)に合わせて最適なスキーマパターンを生成して用いるものである。   Therefore, for example, in Patent Document 1, in order to solve the problem that the schema does not match the user usage method, SQL (Structured Query Language) is stored as the user usage status information, and the schema usage pattern of the user is derived and set. An optimal schema pattern is generated and used according to a tuning target (throughput, storage capacity, etc.).

特開2000−259723号公報JP 2000-259723 A

しかしながら、特許文献1に記載のデータベースシステムにおいては、スキーマパターンを最適化して用いることは可能であるが、最適化の仕組みをデータベースのRDBMSの機能として持つためには非常に高価なデータベースの導入が必要となる。これらの高価なデータベースにおいてはキューブ等の名称で呼ばれるデータベースを構築しなくてはならないが、その場合同一のデータテーブルを複数作成する必要があり、無駄な記憶容量を必要とする。   However, in the database system described in Patent Document 1, it is possible to optimize and use the schema pattern. However, in order to have the optimization mechanism as the RDBMS function of the database, it is necessary to introduce a very expensive database. Necessary. In these expensive databases, it is necessary to construct a database called by a name such as a cube. In this case, it is necessary to create a plurality of identical data tables, and useless storage capacity is required.

また、更には、特許文献1ではスキーマは最適化することが可能となるが、クエリの生成は最適化されないので簡単な検索を最適化されたスキーマを用いて行う場合でも画一的なクエリ生成を行うので、クエリ生成において無駄な処理を行うという欠点もあった。さらに、従来、スキーマ定義テーブルにおいて定義されたスキーマが直ぐに見つからず、この処理に長時間を要する虞があった。   Furthermore, although it is possible to optimize the schema in Patent Document 1, since query generation is not optimized, uniform query generation is performed even when a simple search is performed using the optimized schema. Therefore, there is a disadvantage that useless processing is performed in query generation. Further, conventionally, the schema defined in the schema definition table cannot be found immediately, and this processing may take a long time.

本発明の目的は、複数のスキーマから適するスキーマを探す検索処理と、検索されたスキーマを用いた検索処理の検索処理全体としての処理時間を短くする仕組みを提供することである。
An object of the present invention is to provide a search process for searching for a suitable schema from a plurality of schemas and a mechanism for shortening the processing time of the entire search process of the search process using the searched schema.

本発明のデータベース検索装置は、集計対象の項目を有したファクトテーブルと、当該ファクトテーブルと関連付けられた集計軸の項目を有したディメンションテーブルとの1対の関連付けを1つのレコードとして紐付けられ、データベースの論理構造である、当該レコードに対応したスキーマを複数定義したスキーマ定義テーブルを記憶する記憶手段と、データの検索条件を入力する入力手段と、前記入力手段で入力された検索条件に含まれる検索項目を有するファクトテーブル又はディメンジョンテーブルを決定する決定手段と、前記決定手段で決定されたファクトテーブル又はディメンジョンテーブルをすべて備えるレコードが、前記スキーマ定義テーブルのレコードにあるか否かを判定する判定手段と、前記判定手段で、前記決定手段で決定されたファクトテーブル又はディメンジョンテーブルをすべて備えるレコードが、前記スキーマ定義テーブルのレコードにないと判定した場合、すべての検索対象の項目を含むスキーマを検索対象として、前記入力手段で入力された検索条件に従ったクエリを生成する第1のクエリ生成手段と、前記判定手段で、前記決定手段で決定されたファクトテーブル又はディメンジョンテーブルをすべて備えるレコードが、前記スキーマ定義テーブルのレコードにあると判定した場合、当該レコードに従ったスキーマを検索対象として、前記入力手段で入力された検索条件に応じたクエリを生成する第2のクエリ生成手段とを備えることを特徴とする。
本発明のデータベース検索方法は、データベース検索装置におけるデータベース検索方法であって、前記データベース検索装置の記憶手段が、集計対象の項目を有したファクトテーブルと、当該ファクトテーブルと関連付けられた集計軸の項目を有したディメンションテーブルとの1対の関連付けを1つのレコードとして紐付けられ、データベースの論理構造である、当該レコードに対応したスキーマを複数定義したスキーマ定義テーブルを記憶する記憶工程と、前記データベース検索装置の入力手段が、データの検索条件を入力する入力工程と、前記データベース検索装置の決定手段が、前記入力工程で入力された検索条件に含まれる検索項目を有するファクトテーブル又はディメンジョンテーブルを決定する決定工程と、前記データベース検索装置の判定手段が、前記決定工程で決定されたファクトテーブル又はディメンジョンテーブルをすべて備えるレコードが、前記スキーマ定義テーブルのレコードにあるか否かを判定する判定工程と、前記データベース検索装置の第1のクエリ生成手段が、前記判定工程で、前記決定工程で決定されたファクトテーブル又はディメンジョンテーブルをすべて備えるレコードが、前記スキーマ定義テーブルのレコードにないと判定した場合、すべての検索対象の項目を含むスキーマを検索対象として、前記入力手段で入力された検索条件に従ったクエリを生成する第1のクエリ生成工程と、前記データベース検索装置の第2のクエリ生成手段が、前記判定工程で、前記決定工程で決定されたファクトテーブル又はディメンジョンテーブルをすべて備えるレコードが、前記スキーマ定義テーブルのレコードにあると判定した場合、当該レコードに従ったスキーマを検索対象として、前記入力工程で入力された検索条件に応じたクエリを生成する第2のクエリ生成工程とを備えることを特徴とする。
本発明のプログラムは、データベース検索装置におけるデータベース検索方法をコンピュータに実行させるためのプログラムであって、前記データベース検索装置の記憶手段が、集計対象の項目を有したファクトテーブルと、当該ファクトテーブルと関連付けられた集計軸の項目を有したディメンションテーブルとの1対の関連付けを1つのレコードとして紐付けられ、データベースの論理構造である、当該レコードに対応したスキーマを複数定義したスキーマ定義テーブルを記憶する記憶ステップと、前記データベース検索装置の入力手段が、データの検索条件を入力する入力ステップと、前記データベース検索装置の決定手段が、前記入力ステップで入力された検索条件に含まれる検索項目を有するファクトテーブル又はディメンジョンテーブルを決定する決定ステップと、前記データベース検索装置の判定手段が、前記決定ステップで決定されたファクトテーブル又はディメンジョンテーブルをすべて備えるレコードが、前記スキーマ定義テーブルのレコードにあるか否かを判定する判定ステップと、前記データベース検索装置の第1のクエリ生成手段が、前記判定ステップで、前記決定ステップで決定されたファクトテーブル又はディメンジョンテーブルをすべて備えるレコードが、前記スキーマ定義テーブルのレコードにないと判定した場合、すべての検索対象の項目を含むスキーマを検索対象として、前記入力手段で入力された検索条件に従ったクエリを生成する第1のクエリ生成ステップと、前記データベース検索装置の第2のクエリ生成手段が、前記判定ステップで、前記決定ステップで決定されたファクトテーブル又はディメンジョンテーブルをすべて備えるレコードが、前記スキーマ定義テーブルのレコードにあると判定した場合、当該レコードに従ったスキーマを検索対象として、前記入力ステップで入力された検索条件に応じたクエリを生成する第2のクエリ生成ステップとをコンピュータに実行させることを特徴とする。
In the database search apparatus of the present invention, a pair of associations between a fact table having an aggregation target item and a dimension table having an aggregation axis item associated with the fact table is associated as one record, Included in the storage means for storing a schema definition table that defines a plurality of schemas corresponding to the record, which is the logical structure of the database, input means for inputting data search conditions, and search conditions input by the input means Determination means for determining a fact table or dimension table having a search item, and determination means for determining whether or not a record having all the fact tables or dimension tables determined by the determination means is in the record of the schema definition table And the determination means If it is determined that the record having all the fact table or dimension table determined in step 1 is not in the record of the schema definition table, the search including the items including all the search target items is set as the search target, and the search is input by the input unit. The first query generation means for generating a query in accordance with the conditions and the determination means determine that the record including all the fact tables or dimension tables determined by the determination means is in the record of the schema definition table In this case, a second query generation unit that generates a query according to the search condition input by the input unit using the schema according to the record as a search target is provided.
The database search method of the present invention is a database search method in a database search device, wherein the storage means of the database search device has a fact table having items to be aggregated, and items of aggregate axes associated with the fact table. A storage step of storing a schema definition table in which a plurality of schemas corresponding to the record, which is a logical structure of the database, is linked with a pair of associations with a dimension table having a database, and the database search An input unit of the apparatus inputs an input process of data search conditions, and a determination unit of the database search apparatus determines a fact table or a dimension table having search items included in the search conditions input in the input process. Determination process and the database A determination unit for determining whether a record having all the fact table or dimension table determined in the determination step is in the record of the schema definition table; and a first of the database search device In the determination step, the query generation means includes all the search target items when it is determined that the record including all of the fact table or dimension table determined in the determination step is not in the record of the schema definition table. A first query generation step for generating a query in accordance with a search condition input by the input unit using a schema as a search target, and a second query generation unit of the database search device include the determination in the determination step. Fact table or dimension table determined in the process A second query that generates a query according to the search condition input in the input step, with the schema according to the record as a search target, when it is determined that all the records are included in the record of the schema definition table And a generation step.
A program of the present invention is a program for causing a computer to execute a database search method in a database search device, wherein the storage means of the database search device associates a fact table having items to be aggregated with the fact table. A memory for storing a schema definition table in which a pair of associations with a dimension table having an item of the aggregated axis specified is linked as one record and which is a logical structure of the database and which defines a plurality of schemas corresponding to the record A fact table in which the input unit of the database search device inputs a data search condition; and the determination unit of the database search device has a search item included in the search condition input in the input step Or dimension A determination step of determining a table, and a determination unit of the database search device determining whether or not a record including all the fact table or dimension table determined in the determination step is in the record of the schema definition table And the first query generation means of the database search device determines in the determination step that a record including all the fact table or dimension table determined in the determination step is not included in the record of the schema definition table. A first query generation step of generating a query according to a search condition input by the input means, using a schema including all search target items as a search target, and a second query generation of the database search device Means for determining When it is determined that the record having all the fact table or dimension table determined in the determination step is in the record of the schema definition table, the schema according to the record is input as the search target in the input step. A computer is caused to execute a second query generation step of generating a query according to a search condition.

本発明によれば、複数のスキーマから適するスキーマを探す検索処理と、検索されたスキーマを用いた検索処理の検索処理全体としての処理時間を短くすることができる。   According to the present invention, it is possible to shorten the processing time of the entire search process of the search process for searching for a suitable schema from a plurality of schemas and the search process using the searched schema.

以下、本発明を適用した好適な実施形態を、添付図面を参照しながら詳細に説明する。   DESCRIPTION OF EXEMPLARY EMBODIMENTS Hereinafter, preferred embodiments to which the invention is applied will be described in detail with reference to the accompanying drawings.

図1は、本発明の一実施形態に係るデータベース検索システムの構成を模式的に示した図である。
100は、ユーザが操作するクライアントPCであり、Webブラウザを用いて後述のデータベース検索サーバ200から送信されるWebページを画面上で表示する。200は、自由検索アプリケーション21及び各種データを記録した自由検索DB(自由検索データベース)22を備えたデータベース検索サーバであり、自由検索アプリケーション21によりクライアントPC100の要求に応じたデータを自由検索DB22から検索し、その結果をWebページで各クライアントPC100に送信する。300は、システムDBサーバであり、自由検索DB22に格納すべきデータを逐次或いはバッチ処理によりデータベース検索サーバ200に対して送信する。
FIG. 1 is a diagram schematically showing a configuration of a database search system according to an embodiment of the present invention.
Reference numeral 100 denotes a client PC operated by the user, which displays a Web page transmitted from a database search server 200 (described later) on the screen using a Web browser. A database search server 200 includes a free search application 21 and a free search DB (free search database) 22 in which various data are recorded. The free search application 21 searches the free search DB 22 for data according to a request from the client PC 100. Then, the result is transmitted to each client PC 100 as a Web page. A system DB server 300 transmits data to be stored in the free search DB 22 to the database search server 200 sequentially or by batch processing.

データベース検索サーバ200に接続される各クライアント100は、所望の出力データ項目を指定する出力条件及びその検索条件を画面上で入力し、その入力内容をデータベース検索サーバ200に対して送信する。当該入力内容を受けたデータベース検索サーバ200は、出力条件に挙げられたデータのうち検索条件に合致するデータを自由検索DB22から取得する。なお、出力条件もデータを検索するための条件であるので、出力条件の概念に含まれる。従って、以下の説明では、出力条件も含む意味で検索条件という用語を用いるものとする。   Each client 100 connected to the database search server 200 inputs an output condition for designating a desired output data item and the search condition on the screen, and transmits the input contents to the database search server 200. Receiving the input content, the database search server 200 acquires from the free search DB 22 data that matches the search condition among the data listed in the output condition. The output condition is also a condition for searching for data, and is included in the concept of the output condition. Therefore, in the following description, the term “search condition” is used to include the output condition.

次に、データベース検索サーバ200は、取得したデータを例えばCSV(Comma Separated Value)データとしてクライアントPC100に返信し、当該クライアントPC100では検索結果を画面上で確認することが可能となる。   Next, the database search server 200 returns the acquired data to the client PC 100 as, for example, CSV (Comma Separated Value) data, and the client PC 100 can check the search result on the screen.

図2は、データベース検索サーバ200のハードウェア構成を示す図である。
CPU201は、システムバス204に接続される各デバイスやコントローラを統括的に制御する。また、ROM202あるいは外部メモリ211には、CPU201の制御プログラムであるBIOS(Basic Input / Output System)やオペレーティングシステムプログラム(以下、OS)や、データベース検索サーバ200の実行する機能を実現するために必要な後述する各種プログラム等が記憶されている。RAM203は、CPU201の主メモリ、ワークエリア等として機能する。CPU201は、処理の実行に際して必要なプログラム等をRAM203にロードして、プログラムを実行することで各種動作を実現するものである。
FIG. 2 is a diagram illustrating a hardware configuration of the database search server 200.
The CPU 201 comprehensively controls each device and controller connected to the system bus 204. Further, the ROM 202 or the external memory 211 is necessary for realizing a function executed by the database search server 200, such as a BIOS (Basic Input / Output System), an operating system program (hereinafter referred to as OS), which is a control program of the CPU 201. Various programs to be described later are stored. The RAM 203 functions as a main memory, work area, and the like for the CPU 201. The CPU 201 implements various operations by loading a program necessary for execution of processing into the RAM 203 and executing the program.

また、入力コントローラ(入力C)205は、キーボード209や不図示のマウス等のポインティングデバイスからの入力を制御する。ビデオコントローラ(VC)206は、CRTディスプレイ(CRT)210等の表示器への表示を制御する。表示器はCRTだけでなく、液晶ディスプレイでも構わない。これらは必要に応じて管理者が使用するものであり、本発明には直接関係があるものではない。メモリコントローラ(MC)207は、ブートプログラム、ブラウザソフトウェア、各種のアプリケーション、フォントデータ、ユーザファイル、編集ファイル、各種データ等を記憶するハードディスク(HD)やフレキシブルディスク(FD)或いはPCMCIAカードスロットにアダプタを介して接続されるコンパクトフラッシュ(R)メモリ等の外部メモリ211へのアクセスを制御する。   An input controller (input C) 205 controls input from a pointing device such as a keyboard 209 or a mouse (not shown). A video controller (VC) 206 controls display on a display device such as a CRT display (CRT) 210. The display device may be a liquid crystal display as well as a CRT. These are used by the administrator as necessary, and are not directly related to the present invention. The memory controller (MC) 207 has an adapter in a hard disk (HD), flexible disk (FD), or PCMCIA card slot that stores a boot program, browser software, various applications, font data, user files, editing files, various data, and the like. Controls access to an external memory 211 such as a compact flash (R) memory connected via the network.

通信I/Fコントローラ(通信I/FC)208は、ネットワークを介して、外部機器と接続・通信するものであり、ネットワークでの通信制御処理を実行する。例えば、TCP/IPを用いたインターネット通信等が可能である。なお、CPU201は、例えばRAM203内の表示情報用領域へアウトラインフォントの展開(ラスタライズ)処理を実行することにより、CRT210上での表示を可能としている。また、CPU201は、CRT210上の不図示のマウスカーソル等でのユーザ指示を可能とする。   A communication I / F controller (communication I / FC) 208 is connected to and communicates with an external device via a network, and executes communication control processing in the network. For example, Internet communication using TCP / IP is possible. Note that the CPU 201 enables display on the CRT 210 by executing outline font rasterization processing on a display information area in the RAM 203, for example. In addition, the CPU 201 enables a user instruction with a mouse cursor (not shown) on the CRT 210.

クライアントPC100のハードウェア構成もデータベース検索サーバ200と同様であり、外部メモリ211に格納されているプログラム等が異なるものである。   The hardware configuration of the client PC 100 is the same as that of the database search server 200, and the programs stored in the external memory 211 are different.

次に、本実施形態において用いられるデータテーブルについて説明する。
本実施形態では、図3に示すように、2つのマスタテーブルと3つのトランザクションテーブルを夫々、検索対象となるデータベースの一構成として用いる。マスタテーブルには、得意先マスタテーブルと商品マスタテーブルがあり、トランザクションテーブルには、実績トランザクションテーブル、得意先集計トランザクションテーブル及び商品集計トランザクションテーブルがある。得意先集計トランザクション及び商品集計トランザクションテーブルは、得意先毎又は商品毎のデータ検索速度を向上させるために、夜間バッチ処理等でDBサーバ300内において実績トランザクションテーブルに基づいて作成されるデータテーブルであり、トランザクションテーブルの年月レコードを得意先、商品毎の上期、下期レコードに集計する。
Next, a data table used in the present embodiment will be described.
In this embodiment, as shown in FIG. 3, two master tables and three transaction tables are used as one configuration of a database to be searched. The master table includes a customer master table and a product master table, and the transaction table includes an actual transaction table, a customer total transaction table, and a product total transaction table. The customer aggregation transaction and the product aggregation transaction table are data tables created based on the actual transaction table in the DB server 300 by night batch processing or the like in order to improve the data search speed for each customer or each product. Then, the date record in the transaction table is aggregated in the first half and second half records for each customer and product.

得意先マスタテーブルは、得意先コードを記録した得意先CD項目及び得意先名を記録した得意先名項目によって構成される。商品マスタテーブルは、商品コードを記録した商品CD項目及び商品名を記録した商品名項目によって構成される。   The customer master table includes a customer CD item in which a customer code is recorded and a customer name item in which a customer name is recorded. The product master table includes a product CD item in which a product code is recorded and a product name item in which a product name is recorded.

実績トランザクションテーブルは、販売を行った年月を記録した年月項目、得意先コードを記録した得意先CD項目、商品コードを記録した商品CD項目、販売数を記録した販売数項目及び販売金額を記録した販売金額項目によって構成される。   The actual transaction table includes the year / month item in which the date of sale is recorded, the customer CD item in which the customer code is recorded, the product CD item in which the product code is recorded, the number of sales item in which the number of sales is recorded, and the sales amount. Consists of recorded sales amount items.

得意先集計トランザクションテーブルは、得意先コードを記録した得意先CD項目、上期販売数を記録した上期販売数項目、上期販売金額を記録した上期販売金額項目、下期販売数を記録した下期販売数項目及び下期販売金額を記録した下期販売金額項目によって構成される。   Customer tabulation transaction table includes customer CD item recording customer code, first half sales number recording first half sales, first half sales amount recording first half sales, second half sales number recording second half sales And the second half sales amount item that records the second half sales amount.

商品集計トランザクションテーブルは、商品コードを記録した商品CD項目、上期販売数を記録した上期販売数項目、上期販売金額を記録した上期販売金額項目、下期販売数を記録した下期販売数項目及び下期販売金額を記録した下期販売金額項目によって構成される。   Product summary transaction table includes product CD item with product code, first half sales number with first half sales, first half sales amount with first half sales, second half sales with second half sales and second half sales Consists of sales amount items in the second half that record the amount.

図4は、本実施形態において検索対象となる3つのスキーマ構造体のデータベースを示した図である。
図4に示すように、スキーマIDが"0"(以下、スキーマ0と略す。スキーマID"1"、"2"についても同様)のデータベースの構成は、スタースキーマ構造体である。スキーマ0は実績トランザクションテーブルをファクトテーブルとしており、得意先CD項目をキーにして、実績トランザクションテーブルと得意先マスタテーブル及び得意先集計トランザクションテーブルとが関連付けられ、商品CD項目をキーにして、実績トランザクションテーブルと商品マスタテーブル及び商品集計トランザクションテーブルとが関連付けられている。スキーマ0のデータベースは全てのデータテーブルを含む構成を有するため、全項目を検索の対象とすることができる。
FIG. 4 is a diagram showing a database of three schema structures to be searched in the present embodiment.
As shown in FIG. 4, the configuration of the database whose schema ID is “0” (hereinafter abbreviated as schema 0. The same applies to schema IDs “1” and “2”) is a star schema structure. Schema 0 uses the actual transaction table as a fact table. The actual transaction table is associated with the customer master table and the customer aggregation transaction table using the customer CD item as a key. The actual transaction is performed using the product CD item as a key. The table is associated with the product master table and the product aggregation transaction table. Since the database of schema 0 has a configuration including all data tables, all items can be searched.

スキーマ1のデータベースは、得意先マスタテーブル及び得意先集計トランザクションテーブルによって構成されており、本データベースを検索対象とした場合、得意先マスタテーブルと得意先集計トランザクションテーブルに含まれる項目のみを検索することができる。本データベース構造においては、得意先集計トランザクションテーブルをファクトテーブルとしており、得意先マスタテーブルと得意先集計トランザクションテーブルとは得意先CD項目をキーにして関連付けられている。   The database of schema 1 is composed of a customer master table and a customer aggregation transaction table. When this database is a search target, only the items included in the customer master table and the customer aggregation transaction table are searched. Can do. In this database structure, the customer aggregation transaction table is a fact table, and the customer master table and the customer aggregation transaction table are associated with each other using the customer CD item as a key.

スキーマ2のデータベースは、商品マスタテーブル及び商品集計トランザクションテーブルによって構成されており、本データベースを検索対象とした場合、商品マスタテーブルと商品集計トランザクションテーブルに含まれる項目のみを検索することができる。本データベース構造においては、商品集計トランザクションテーブルをファクトテーブルとしており、商品マスタテーブルと商品集計トランザクションテーブルとは商品CD項目をキーにして関連付けられている。   The database of the schema 2 includes a product master table and a product aggregation transaction table. When this database is a search target, only items included in the product master table and the product aggregation transaction table can be searched. In this database structure, the product aggregation transaction table is a fact table, and the product master table and the product aggregation transaction table are associated with each other using the product CD item as a key.

図5(a)は、スキーマ構造体を定義したデータテーブル(以下、スキーマ定義テーブルと称す)を示している。
このスキーマ定義テーブルによってスキーマ0〜2のデータベース構成が定義されている。即ち、本スキーマ定義テーブルでは、スキーマ0については、ファクトテーブルである実績トランザクションテーブルに対して、4つのディメンジョンテーブル、得意先マスタテーブル、商品マスタテーブル、得意先集計トランザクションテーブル及び商品集計トランザクションテーブルが対応付けられており、スキーマ1については、ファクトテーブルである得意先集計トランザクションテーブルに対し、1つのディメンジョンテーブル、得意先マスタテーブルが対応付けられており、スキーマ2については、ファクトテーブルである商品集計トランザクションテーブルに対し、1つのディメンジョンテーブル、商品マスタテーブルが対応付けられている。
FIG. 5A shows a data table defining a schema structure (hereinafter referred to as a schema definition table).
The database configuration of schemas 0 to 2 is defined by this schema definition table. That is, in this schema definition table, with respect to the schema 0, four dimension tables, a customer master table, a product master table, a customer aggregation transaction table, and a product aggregation transaction table correspond to the actual transaction table that is a fact table. For schema 1, one dimension table and customer master table are associated with the customer aggregation transaction table that is the fact table, and for schema 2, the product aggregation transaction that is the fact table. One dimension table and a product master table are associated with the table.

図5(b)は、ファクトテーブルを定義したデータテーブル(以下、ファクトテーブル定義テーブルと称す)を示している。
ファクトテーブル定義テーブルによってスキーマ0〜2のデータベース構造におけるファクトテーブルが定義される。即ち、本ファクトテーブル定義テーブルにおいては、スキーマ0の場合は実績トランザクションテーブル、スキーマ1の場合は得意先集計トランザクションテーブル、スキーマ2の場合は商品集計トランザクションテーブルが夫々ファクトテーブルとなることを示している。尚、得意先マスタテーブル及び商品マスタテーブルについてはスキーマIDが"null"が対応付けられているが、これはマスタテーブルがファクトテーブルには成り得ないためである。また、スキーマ定義テーブル及びファクトテーブル定義テーブルは、例えばRAM203内に記録される。
FIG. 5B shows a data table defining a fact table (hereinafter referred to as a fact table definition table).
A fact table in the database structure of schemas 0 to 2 is defined by the fact table definition table. That is, in the fact table definition table, the actual transaction table in the case of schema 0, the customer total transaction table in the case of schema 1, and the product total transaction table in the case of schema 2 indicate the fact table. . The customer master table and the product master table are associated with the schema ID “null” because the master table cannot be a fact table. The schema definition table and the fact table definition table are recorded in the RAM 203, for example.

尚、図5(b)では、スキーマ0〜スキーマ2の3つのデータベース構成についてのみ例示した。上記5つ以外にもデータテーブルが増えた際には、データテーブルを組み合わせによる更に多様なデータベース構成を検索対象とすることができ、例えば、スキーマ3〜9のファクトテーブルについても(スキーマID=1〜9:機能限定スキーマのファクトテーブル)定義し、同時に図5(a)のスキーマ定義テーブルへの登録を行うことでバリエーションを増やすことが可能であることは言うまでもない。   In FIG. 5B, only three database configurations of schema 0 to schema 2 are illustrated. When the number of data tables is increased in addition to the above five, more various database configurations by combining the data tables can be searched. For example, the fact tables of schemas 3 to 9 (schema ID = 1) It is needless to say that it is possible to increase variations by defining (˜9: fact-limited schema fact table) and simultaneously registering it in the schema definition table of FIG.

次に、データベース検索サーバ200によるデータ検索動作について、図6−1及び図6−2を参照しながら説明する。図6−1及び図6−2は、本実施形態に係るデータベース検索サーバ200の動作を示すフローチャートである。
本データベース検索動作において、ユーザの検索条件指定としては、例えば本願出願人による特願2002−382470号に記載されるように複数のデータテーブルで構成されるデータベースに対し、1以上のデータテーブルで1以上の項目名を指定して検索指定条件を入力し、同様に1以上のデータテーブルで1以上の項目名を指定して表示指定条件(検索出力条件)として検索を行う仕組みを適用することが可能である。
Next, the data search operation by the database search server 200 will be described with reference to FIGS. 6-1 and 6-2. 6A and 6B are flowcharts illustrating the operation of the database search server 200 according to the present embodiment.
In this database search operation, the user's search condition designation is, for example, 1 in one or more data tables for a database composed of a plurality of data tables as described in Japanese Patent Application No. 2002-382470 by the applicant of the present application. It is possible to apply a mechanism for inputting search specification conditions by specifying the above item names, and similarly performing search as display specification conditions (search output conditions) by specifying one or more item names in one or more data tables. Is possible.

−処理例1−
先ず、データベース検索サーバ200による処理例1を説明する。ここでは、検索条件として「得意先コード(得意先CD='1001')を指定して、得意先名を検索する」をクライアントPC100から受けた場合について説明する。
-Processing Example 1-
First, processing example 1 by the database search server 200 will be described. Here, a case will be described in which “search for a customer name by specifying a customer code (customer CD =“ 1001 ”)” is received from the client PC 100 as a search condition.

本処理例では、得意先コード及び得意先名を指定した検索条件をクライアントPC100から受けた場合を想定しているため、図7(a)に示すように、検索処理において利用される項目(以下、利用項目と称す)は、得意先コード項目及び得意先名項目となり、検索に利用されるテーブル(以下、利用テーブルと称す)は、得意先マスタテーブルとなる。ユーザは、クライアントPC100の画面上において表示される項目から所望の項目を選択する。選択された項目情報は検索条件としてクライアントPC100からデータベース検索サーバ200に対して送信され、データベース検索サーバ200は項目情報を含む検索条件を受信することによって利用項目とともに利用テーブルも同時に決定する。   In this processing example, since it is assumed that the search condition specifying the customer code and the customer name is received from the client PC 100, as shown in FIG. , Referred to as a usage item) is a customer code item and a customer name item, and a table used for searching (hereinafter referred to as a usage table) is a customer master table. The user selects a desired item from items displayed on the screen of the client PC 100. The selected item information is transmitted as a search condition from the client PC 100 to the database search server 200, and the database search server 200 simultaneously determines the use table as well as the use item by receiving the search condition including the item information.

CPU201は、クライアントPC100からの上記検索条件を受けて、ユーザの指定項目(得意先コード、得意先名)から利用テーブルを決定し(ステップS601)、得意先マスタテーブルを利用テーブル情報としてRAM203に記録する。利用テーブルの決定としては、どのテーブルの項目情報を指定したかが分かれば決定できるので、この場合は得意先マスタテーブルの項目を見ながら全ての条件を指定したケースが当てはまる。同様の項目を指定した場合でも他のテーブル、例えば得意先集計トランザクションテーブルの得意先CDを指定した場合には得意先集計トランザクションテーブルが利用テーブルに追加されることになる。同一のテーブルが複数回指定される場合には、重複しないように1つにしてしまう為に、利用テーブルの書き込み時同一テーブルは上書き等の処理を行う。ここでは得意先マスタテーブルのみが指定されたとして説明を続ける。   In response to the search condition from the client PC 100, the CPU 201 determines a usage table from user specified items (customer code, customer name) (step S601), and records the customer master table in the RAM 203 as usage table information. To do. The usage table can be determined by knowing which table item information is specified. In this case, the case where all conditions are specified while viewing the items in the customer master table is applicable. Even when the same item is specified, if the customer CD of the customer totaling transaction table is specified, for example, the customer totaling transaction table is added to the usage table. When the same table is specified a plurality of times, the same table is overwritten when the usage table is written in order to keep the same table one so as not to overlap. Here, the description will be continued assuming that only the customer master table is designated.

続いて、CPU201は、利用テーブル情報に含まれる全利用テーブルのRAM203からの読み込みが完了したか否かを判断する(ステップS602)。現時点では、未だ利用テーブルの読み込みが完了していないため、処理はステップS603に移行する。   Subsequently, the CPU 201 determines whether or not reading of all usage tables included in the usage table information from the RAM 203 has been completed (step S602). At this point, since the usage table has not yet been read, the process proceeds to step S603.

続いて、CPU201は、RAM203から1件の利用テーブルを読み込み、当該利用テーブルのテーブルIDを図8に示す利用テーブルIDテーブルから参照し、テーブル変数[A]にセットする(ステップS603)。ここで読み込まれる利用テーブルは得意先マスタテーブルであるため、RAM203内においてテーブル変数[A]は"0"にセットされる。尚、利用テーブルIDテーブルは、例えばRAM203に記録されている。   Subsequently, the CPU 201 reads one usage table from the RAM 203, refers to the table ID of the usage table from the usage table ID table shown in FIG. 8, and sets it in the table variable [A] (step S603). Since the usage table read here is the customer master table, the table variable [A] is set to “0” in the RAM 203. The usage table ID table is recorded in the RAM 203, for example.

続いて、CPU201は、テーブル変数[A]にセットされているテーブルID"0"のテーブル、即ち得意先マスタテーブルのスキーマIDをファクトテーブル定義テーブルから参照し、RAM203内においてそのスキーマIDをスキーマID変数[B]にセットする(ステップS604)。ここでは、ファクトテーブル定義テーブルにおいて、得意先マスタテーブルをファクトテーブルとした場合のスキーマIDは"null"と定義されているため、スキーマID変数[B]は"null"にセットされる。尚、ファクトテーブル定義テーブルは、例えばRAM203に記録されている。   Subsequently, the CPU 201 refers to the table with the table ID “0” set in the table variable [A], that is, the schema ID of the customer master table from the fact table definition table, and stores the schema ID in the RAM 203 as the schema ID. Variable [B] is set (step S604). Here, in the fact table definition table, the schema ID when the customer master table is the fact table is defined as “null”, so the schema ID variable [B] is set to “null”. The fact table definition table is recorded in the RAM 203, for example.

続いて、CPU201は、セットされているスキーマID変数[B]は"0"であるか否かを判断する(ステップS605)。ここでは、スキーマID変数[B]は"null"にセットされているため、処理はステップS606に移行する。   Subsequently, the CPU 201 determines whether or not the set schema ID variable [B] is “0” (step S605). Here, since the schema ID variable [B] is set to “null”, the process proceeds to step S606.

続いて、CPU201は、セットされているスキーマID変数[B]は"null"であるか否かを判断する(ステップS606)。スキーマID変数[B]は"null"であるため、処理はステップS607に移行する。   Subsequently, the CPU 201 determines whether or not the set schema ID variable [B] is “null” (step S606). Since the schema ID variable [B] is “null”, the process proceeds to step S607.

続いて、CPU201は、利用テーブル定義変数[C]にテーブル変数[A]を追加設定する。いま、利用テーブル定義変数[C]には何も設定されていない状態であるので、RAM203内において利用テーブル定義変数[C]は"0"にセットされる。また、CPU201は、利用テーブル定義変数[C]をセットするとともに、スキーマ判断定義変数[D]とスキーマ判断定義変数[E]をセットする。即ち、RAM203内において、スキーマ判断定義変数[D]にはテーブル変数[A]"0"がセットされ、スキーマ判断定義変数[E]には"null"がセットされる(ステップS607)。   Subsequently, the CPU 201 additionally sets a table variable [A] to the usage table definition variable [C]. Now, since nothing is set in the usage table definition variable [C], the usage table definition variable [C] is set to “0” in the RAM 203. Further, the CPU 201 sets a use table definition variable [C], and sets a schema determination definition variable [D] and a schema determination definition variable [E]. That is, in the RAM 203, the table variable [A] “0” is set to the schema determination definition variable [D], and “null” is set to the schema determination definition variable [E] (step S607).

CPU201の処理はステップS602に戻り、再び全利用テーブルの読み込みが終了したか否かが判断される。いま、CPU201によって全利用テーブルがRAM203から読み出された状態にあるので、処理は図6−2のステップS611に移行する。   The process of the CPU 201 returns to step S602, and it is determined again whether or not reading of all the usage tables has been completed. Now, since all the usage tables have been read from the RAM 203 by the CPU 201, the processing moves to step S611 in FIG.

CPU201は、スキーマ判断定義変数[D]とスキーマ判断定義変数[E]をRAM203から読み込み(ステップS611)、スキーマ判断定義変数[E]にセットされている内容が"null"、"0"及び"1以上"の何れであるかを判断する(ステップS612)。いま、スキーマ判断定義変数[E]には"null"がセットされているので、処理はステップS613に移行する。   The CPU 201 reads the schema judgment definition variable [D] and the schema judgment definition variable [E] from the RAM 203 (step S611), and the contents set in the schema judgment definition variable [E] are “null”, “0”, and “ It is determined whether it is 1 or more "(step S612). Now, since “null” is set in the schema determination definition variable [E], the process proceeds to step S613.

続いて、CPU201は、RAM203から利用テーブル情報を読み込み、当該利用テーブル情報に含まれる利用テーブルの数をカウント変数[F]にRAM203内でセットし(ステップS613)、セットしたカウント変数[F]の値が"1"であるか否かを判断する(ステップS614)。いま、カウント変数[F]の値は"1"にセットされているため、検索条件にて指定されるマスタテーブル、即ち得意先マスタテーブルのみを対象とした検索処理が決定される(ステップS615)。   Subsequently, the CPU 201 reads usage table information from the RAM 203, sets the number of usage tables included in the usage table information in the count variable [F] in the RAM 203 (step S613), and sets the count variable [F]. It is determined whether or not the value is “1” (step S614). Now, since the value of the count variable [F] is set to “1”, the search process for only the master table specified by the search condition, that is, the customer master table is determined (step S615). .

一方、カウント変数[F]の値が"1"ではない場合、検索対象となるデータベース構造はスキーマ0と決定される。これは、カウント変数[F]の値が"1"ではない場合は、利用テーブルに複数のマスタテーブルが設定されている可能性があり、データ量の多いトランザクションテーブルをファクトテーブルとしたスキーマのデータベースでしか検索することができないので、検索処理時のスキーマを決定することに時間をかけるより、スキーマ0を決定して即検索処理に移行した方が効率的だからである。   On the other hand, when the value of the count variable [F] is not “1”, the database structure to be searched is determined as schema 0. This is because, when the value of the count variable [F] is not “1”, there is a possibility that a plurality of master tables are set in the usage table, and a database of a schema with a transaction table having a large amount of data as a fact table. This is because it is more efficient to determine schema 0 and move to immediate search processing rather than spending time in determining the schema during search processing.

続いて、CPU201は検索クエリを生成する。ここで、ステップS615において得意先マスタテーブルのみが検索対象と決定されているので、次のような検索クエリが生成される。尚、SELECT文では検索する項目名及びその項目が属するテーブル名が指定され、FROM文では検索先となるテーブル名が指定され、WHERE文には検索条件が指定される。
<検索クエリ>
SELECT 得意先M.得意先名
FROM 得意先M
WHERE 得意先M.得意先CD='1001'
Subsequently, the CPU 201 generates a search query. Here, since only the customer master table is determined as the search target in step S615, the following search query is generated. The SELECT statement specifies the name of the item to be searched and the table name to which the item belongs, the FROM statement specifies the name of the table to be searched, and the WHERE statement specifies the search condition.
<Search query>
SELECT customer M. customer name
FROM Customer M
WHERE customer M. customer CD = '1001'

−処理例2−
次に、データベース検索サーバ200による処理例2を説明する。ここでは、検索条件として「実績年月、得意先コード、商品コードを指定して、得意先名、商品名、販売数を検索する」をクライアントPC100から受けた場合について説明する。
-Processing example 2-
Next, processing example 2 by the database search server 200 will be described. Here, a case will be described in which “searching for a customer name, a product name, and a sales number by specifying the actual date, customer code, and product code” is received from the client PC 100 as a search condition.

本処理例では、実績年月、得意先コード、商品コード、得意先名、商品名及び販売数を指定した検索条件をクライアントPC100から受けた場合を想定しているため、図8に示すように、利用項目は、年月項目、得意先CD項目、商品CD項目、得意先名、商品名及び販売数となり、利用テーブルは、実績トランザクションテーブル、得意先マスタテーブル及び商品マスタテーブルとなる。   In this processing example, since it is assumed that the search condition specifying the actual date, customer code, product code, customer name, product name, and number of sales is received from the client PC 100, as shown in FIG. The usage items are a year / month item, a customer CD item, a product CD item, a customer name, a product name, and a sales number, and the usage tables are an actual transaction table, a customer master table, and a product master table.

CPU201は、クライアントPCからの上記検索条件を受けて、ユーザの指定項目(実績年月、得意先コード、商品コード、得意先名、商品名及び販売数)から利用テーブルを決定し(ステップS601)、実績トランザクションテーブル、得意先マスタテーブル及び商品マスタテーブルを利用テーブル情報としてRAM203に記録する。   In response to the search condition from the client PC, the CPU 201 determines a usage table from user-specified items (actual date, customer code, product code, customer name, product name, and number of sales) (step S601). The actual transaction table, customer master table, and product master table are recorded in the RAM 203 as usage table information.

続いて、CPU201は、利用テーブル情報に含まれる全利用テーブルのRAM203からの読み込みが完了したか否かを判断する(ステップS602)。現時点では、未だ利用テーブルの読み込みが完了していないため、処理はステップS603に移行する。   Subsequently, the CPU 201 determines whether or not reading of all the usage tables included in the usage table information from the RAM 203 has been completed (step S602). At this point, since the usage table has not yet been read, the process proceeds to step S603.

続いて、CPU201は、RAM203から1件の利用テーブルを読み込み、当該利用テーブルのテーブルIDを図8に示す利用テーブルIDテーブルから参照し、テーブル変数[A]にセットする(ステップS603)。ここで読み込まれる利用テーブルは実績トランザクションテーブルであることを想定すると、RAM203内においてテーブル変数[A]を"2"にセットする。   Subsequently, the CPU 201 reads one usage table from the RAM 203, refers to the table ID of the usage table from the usage table ID table shown in FIG. 8, and sets it in the table variable [A] (step S603). Assuming that the usage table read here is an actual transaction table, the table variable [A] is set to “2” in the RAM 203.

続いて、CPU201は、変数[A]にセットされているテーブルID"2"のテーブル、即ち実績トランザクションテーブルのスキーマIDをファクトテーブル定義テーブルから参照し、RAM203内においてそのスキーマIDをスキーマID変数[B]にセットする(ステップS604)。ここでは、ファクトテーブル定義テーブルにおいて、実績トランザクションをファクトテーブルとした場合のスキーマIDは"0"と定義されているため、スキーマID変数[B]は"0"にセットされる。   Subsequently, the CPU 201 refers to the table of the table ID “2” set in the variable [A], that is, the schema ID of the actual transaction table from the fact table definition table, and stores the schema ID in the RAM 203 in the schema ID variable [ B] is set (step S604). Here, in the fact table definition table, the schema ID when the actual transaction is the fact table is defined as “0”, so the schema ID variable [B] is set to “0”.

続いて、CPU201は、セットされているスキーマID変数[B]は"0"であるか否かを判断する(ステップS605)。ここでは、スキーマID変数[B]は"0"にセットされているため、処理はステップS610に移行する。   Subsequently, the CPU 201 determines whether or not the set schema ID variable [B] is “0” (step S605). Here, since the schema ID variable [B] is set to “0”, the process proceeds to step S610.

続いて、CPU201は、スキーマ判断定義変数[D]とスキーマ判断定義変数[E]をセットする(ステップS610)。スキーマ判断定義変数[D]にはテーブル変数[A]、即ち実績トランザクションテーブルのテーブルID"2"がセットされ、スキーマ判断定義変数[E]には"0"がセットされる。   Subsequently, the CPU 201 sets a schema judgment definition variable [D] and a schema judgment definition variable [E] (step S610). A table variable [A], that is, a table ID “2” of the actual transaction table is set in the schema judgment definition variable [D], and “0” is set in the schema judgment definition variable [E].

CPU201は、スキーマ判断定義変数[D]とスキーマ判断定義変数[E]をRAM203から読み込み(ステップS611)、スキーマ判断定義変数[E]にセットされている内容が"null"、"0"及び"1以上"の何れかであるかを判断する(ステップS612)。いま、スキーマ判断定義変数[E]には"0"がセットされているので、処理はステップS616に移行する。   The CPU 201 reads the schema judgment definition variable [D] and the schema judgment definition variable [E] from the RAM 203 (step S611), and the contents set in the schema judgment definition variable [E] are “null”, “0”, and “ It is determined whether it is one or more "(step S612). Now, since “0” is set in the schema judgment definition variable [E], the process proceeds to step S616.

続いて、CPU201は、検索対象となるデータベースの構成をスキーマ0と決定する(ステップS616)。次に、CPU201は検索クエリを生成する。ここで、ステップS616においてスキーマ0が検索対象として決定されているので、次のような検索クエリが生成される。
<検索クエリ>
SELECT 得意先M.得意先名,商品M.商品名,実績TRN.販売数
FROM 得意先M,商品M,実績TRN
WHERE 得意先M.得意先CD='1001' AND 商品M.商品CD='A001'
AND (得意先M.得意先CD=実績TRN.得意先CD)
AND (商品M.商品CD=実績TRN.商品CD)
Subsequently, the CPU 201 determines the configuration of the database to be searched as schema 0 (step S616). Next, the CPU 201 generates a search query. Here, since schema 0 is determined as a search target in step S616, the following search query is generated.
<Search query>
SELECT Customer M. Customer Name, Product M. Product Name, Actual TRN. Number of Sales
FROM Customer M, Product M, Actual TRN
WHERE Customer M. Customer CD = '1001' AND Product M. Product CD = 'A001'
AND (customer M. customer CD = actual TRN. Customer CD)
AND (Product M. Product CD = Actual TRN. Product CD)

−処理例3−
次に、データベース検索サーバ200による処理例3を説明する。ここでは、検索条件として「得意先コード(得意先CD='1001')を指定して、得意先名、得意先上期販売数を検索する」をクライアントPC100から受けた場合について説明する。
-Processing example 3-
Next, processing example 3 by the database search server 200 will be described. Here, a description will be given of a case where the client PC 100 receives “customer code (customer CD =“ 1001 ”) and search for customer name and customer first-half sales number” as a search condition.

本処理例では、得意先コード、得意先名及び上期販売数を指定した検索条件をクライアントPC100から受けた場合を想定しているため、図7(c)に示すように、利用項目は得意先CD項目、得意先名項目及び上期販売数項目となり、利用テーブルは得意先マスタテーブル及び得意先集計トランザクションテーブルとなる。   In this processing example, since it is assumed that a search condition specifying a customer code, a customer name, and the number of first-half sales is received from the client PC 100, as shown in FIG. It becomes a CD item, a customer name item, and a first half sales number item, and a usage table becomes a customer master table and a customer aggregation transaction table.

CPU201は、クライアントPCからの上記検索条件を受けて、ユーザの指定項目(得意先CD、得意先名、上期販売数)から利用テーブルを決定し(ステップS601)、利用テーブルが得意先マスタテーブル及び得意先集計トランザクションテーブルであることを利用テーブル情報としてRAM203に記録する。   In response to the search condition from the client PC, the CPU 201 determines a usage table from user-specified items (customer CD, customer name, first half sales number) (step S601). The fact that it is a customer aggregation transaction table is recorded in the RAM 203 as usage table information.

続いて、CPU201は、利用テーブル情報に含まれる全利用テーブルのRAM203からの読み込みが完了したか否かを判断する(ステップS602)。現時点では、未だ利用テーブル情報の読み込みが完了していないため、処理はステップS603に移行する。   Subsequently, the CPU 201 determines whether or not reading of all the usage tables included in the usage table information from the RAM 203 has been completed (step S602). At this time, since the usage table information has not yet been read, the process proceeds to step S603.

続いて、CPU201は、RAM203から1件の利用テーブルを読み込み、当該利用テーブルのテーブルIDを図8に示す利用テーブルIDテーブルから参照し、テーブル変数[A]にセットする(ステップS603)。ここで読み込まれる利用テーブルは得意先マスタテーブルであることを想定すると、RAM203内においてテーブル変数[A]は"0"にセットされる。   Subsequently, the CPU 201 reads one usage table from the RAM 203, refers to the table ID of the usage table from the usage table ID table shown in FIG. 8, and sets it in the table variable [A] (step S603). Assuming that the usage table read here is the customer master table, the table variable [A] is set to “0” in the RAM 203.

続いて、CPU201は、テーブル変数[A]にセットされているテーブルID"0"のテーブル、即ち得意先マスタテーブルのスキーマIDをファクト定義テーブルから参照し、RAM203内においてそのスキーマIDをスキーマID変数[B]にセットする(ステップS604)。ここでは、ファクトテーブル定義テーブルにおいて、得意先マスタテーブルをファクトテーブルとした場合のスキーマIDは"null"と定義されているため、スキーマID変数[B]は"null"にセットされる。   Subsequently, the CPU 201 refers to the table of the table ID “0” set in the table variable [A], that is, the schema ID of the customer master table from the fact definition table, and stores the schema ID in the RAM 203 in the schema ID variable. [B] is set (step S604). Here, in the fact table definition table, the schema ID when the customer master table is the fact table is defined as “null”, so the schema ID variable [B] is set to “null”.

続いて、CPU201は、セットされているスキーマID変数[B]は"0"であるか否かを判断する(ステップS605)。ここでは、スキーマID変数[B]は"null"にセットされているため、処理はステップS606に移行する。   Subsequently, the CPU 201 determines whether or not the set schema ID variable [B] is “0” (step S605). Here, since the schema ID variable [B] is set to “null”, the process proceeds to step S606.

続いて、CPU201は、セットされているスキーマID変数[B]は"null"であるか否かを判断する(ステップS606)。スキーマID変数[B]は"null"であるため、処理はステップS607に移行する。   Subsequently, the CPU 201 determines whether or not the set schema ID variable [B] is “null” (step S606). Since the schema ID variable [B] is “null”, the process proceeds to step S607.

続いて、CPU201は、利用テーブル定義変数[C]にテーブル変数[A]を追加設定する。いま、利用テーブル定義変数[C]には何も設定されていない状態であるので、RAM203内において利用テーブル定義変数[C]は"0"にセットされる。また、CPU201は、利用テーブル定義変数[C]をセットするとともに、スキーマ判断定義変数[D]とスキーマ判断定義変数[E]をセットする。即ち、RAM203内において、スキーマ判断定義変数[D]にはテーブル変数[A]"0"がセットされ、スキーマ判断定義変数[E]には"null"がセットされる(ステップS607)。   Subsequently, the CPU 201 additionally sets a table variable [A] to the usage table definition variable [C]. Now, since nothing is set in the usage table definition variable [C], the usage table definition variable [C] is set to “0” in the RAM 203. Further, the CPU 201 sets a use table definition variable [C], and sets a schema determination definition variable [D] and a schema determination definition variable [E]. That is, in the RAM 203, the table variable [A] “0” is set to the schema determination definition variable [D], and “null” is set to the schema determination definition variable [E] (step S607).

CPU201の処理はステップS602に戻り、再び全利用テーブルの読み込みが終了したか否かが判断される。未だ、RAM203には得意先集計トランザクションテーブルが利用テーブルとして残されているので、処理はステップS603に移行する。   The process of the CPU 201 returns to step S602, and it is determined again whether or not reading of all the usage tables has been completed. Since the customer totaling transaction table is still left in the RAM 203 as a usage table, the process proceeds to step S603.

続いて、CPU201は、RAM203から1件の利用テーブル(得意先集計トランザクションテーブル)を読み込み、当該利用テーブルのテーブルIDを図8に示す利用テーブルIDテーブルから参照し、テーブル変数[A]を更新する(ステップS603)。ここで読み込まれる利用テーブルは得意先集計トランザクションテーブルであるため、RAM203内においてテーブル変数[A]は"3"に更新される。   Subsequently, the CPU 201 reads one usage table (customer aggregation transaction table) from the RAM 203, refers to the table ID of the usage table from the usage table ID table shown in FIG. 8, and updates the table variable [A]. (Step S603). Since the usage table read here is the customer aggregation transaction table, the table variable [A] is updated to “3” in the RAM 203.

続いて、CPU201は、変数[A]にセットされているテーブルID"3"のテーブル、即ち得意先集計トランザクションテーブルのスキーマIDをファクトテーブル定義テーブルから参照し、RAM203内においてスキーマID変数[B]をそのスキーマIDに更新する(ステップS604)。得意先集計トランザクションテーブルをファクトテーブルとした場合のスキーマIDは、ファクトテーブル定義テーブルにおいて"1"と定義されているため、スキーマID変数[B]は"1"に更新される。   Subsequently, the CPU 201 refers to the table of the table ID “3” set in the variable [A], that is, the schema ID of the customer aggregation transaction table from the fact table definition table, and the schema ID variable [B] in the RAM 203. Is updated to the schema ID (step S604). Since the schema ID when the customer aggregation transaction table is the fact table is defined as “1” in the fact table definition table, the schema ID variable [B] is updated to “1”.

続いて、CPU201は、セットされているスキーマID変数[B]は"0"であるか否かを判断する(ステップS605)。ここでは、スキーマID変数[B]は"1"にセットされているため、処理はステップS606に移行する。   Subsequently, the CPU 201 determines whether or not the set schema ID variable [B] is “0” (step S605). Here, since the schema ID variable [B] is set to “1”, the process proceeds to step S606.

続いて、CPU201は、セットされているスキーマID変数[B]は"null"であるか否かを判断する(ステップS606)。スキーマID変数[B]は"1"にセットされているため、処理はステップS608に移行する。   Subsequently, the CPU 201 determines whether or not the set schema ID variable [B] is “null” (step S606). Since the schema ID variable [B] is set to “1”, the process proceeds to step S608.

続いて、CPU201は、変数[E]がスキーマID変数[B]より大きい値をとるか、或いは変数[E]には"null"がセットされているかを判断する(ステップS608)。いま、変数[E]には"null"がセットされているため、処理はステップS609に移行する。ここで、本実施形態では、スキーマIDの値が0から9に向かってより容易なスキーマ構造となるように定義付けられている。これを受けて、スキーマID変数[B]が既にセットされている変数[E]の値より小さい値であれば、ステップS609に移行し、当該スキーマID変数[B]の値で変数[E]の値に更新しており、小さい値のスキーマID、即ち複雑なスキーマの指定が変数[E]に残るようにされている。   Subsequently, the CPU 201 determines whether the variable [E] has a value greater than the schema ID variable [B] or whether the variable [E] is set to “null” (step S608). Now, since “null” is set in the variable [E], the process proceeds to step S609. Here, in this embodiment, the schema ID value is defined so as to be an easier schema structure from 0 to 9. In response, if the schema ID variable [B] is smaller than the value of the variable [E] that has already been set, the process proceeds to step S609, and the variable [E] is set with the value of the schema ID variable [B]. The schema ID of a small value, that is, a complicated schema designation is left in the variable [E].

続いて、CPU201は、利用テーブル定義変数[C]、スキーマ判断定義変数[D]及びスキーマ判断定義変数[E]をセットする(ステップS609)。利用テーブル定義変数[C]は、現在のテーブル変数[A]が追加設定され、"0,3"と更新される。スキーマ判断定義変数[D]は現在のテーブル変数[A]"3"に更新され、スキーマ判断定義変数[E]はスキーマID変数[B]"1"に更新される。   Subsequently, the CPU 201 sets a use table definition variable [C], a schema determination definition variable [D], and a schema determination definition variable [E] (step S609). The current table variable [A] is additionally set in the use table definition variable [C], and is updated to “0, 3”. The schema determination definition variable [D] is updated to the current table variable [A] “3”, and the schema determination definition variable [E] is updated to the schema ID variable [B] “1”.

続いて、CPU201の処理はステップS602に戻り、再び利用テーブル情報に含まれる全利用テーブルのRAM203からの読み込みが完了したか否かが判断される。いま、CPU201によって全利用テーブルがRAM203から読み出された状態にあるので、処理は図6−2のステップS611に移行する。   Subsequently, the processing of the CPU 201 returns to step S602, and it is determined again whether or not reading of all the usage tables included in the usage table information from the RAM 203 has been completed. Now, since all the usage tables have been read from the RAM 203 by the CPU 201, the processing moves to step S611 in FIG.

CPU201は、スキーマ判断定義変数[D]とスキーマ判断定義変数[E]をRAM203から読み込み(ステップS611)、スキーマ判断定義変数[E]にセットされている内容が"null"、"0"及び"1以上"の何れであるかを判断する(ステップS612)。いま、スキーマ判断定義変数[E]には"1"がセットされているので、処理はステップS617に移行する。   The CPU 201 reads the schema judgment definition variable [D] and the schema judgment definition variable [E] from the RAM 203 (step S611), and the contents set in the schema judgment definition variable [E] are “null”, “0”, and “ It is determined whether it is “1 or more” (step S612). Now, since “1” is set in the schema judgment definition variable [E], the process proceeds to step S617.

続いて、CPU201は、利用テーブル定義変数[C]にセットされているテーブルIDの1つをRAM203から読み込み、RAM203内においてテーブル変数[G]にセットする(ステップS617)。ここでは、テーブル変数[G]に得意先マスタテーブルのテーブルID"0"がセットされたものとする。   Subsequently, the CPU 201 reads one of the table IDs set in the usage table definition variable [C] from the RAM 203, and sets it in the table variable [G] in the RAM 203 (step S617). Here, it is assumed that the table ID “0” of the customer master table is set in the table variable [G].

続いて、CPU201は、RAM203から利用テーブル定義変数[C]にセットされている全テーブルIDを読み込んだか否かを判断する(ステップS618)。現時点では、得意先集計トランザクションテーブルのテーブルID"3"が未だ読み込まれていないため、処理はステップS619に移行する。   Subsequently, the CPU 201 determines whether or not all table IDs set in the use table definition variable [C] have been read from the RAM 203 (step S618). At this time, since the table ID “3” of the customer aggregation transaction table has not been read yet, the process proceeds to step S619.

続いて、CPU201は、スキーマ判断定義変数[D]にセットされている得意先集計トランザクションテーブルのテーブルID"3"、テーブル変数[G]にセットされている得意先マスタテーブルのテーブルID"0"をキーにして、ファクトテーブル項目に「得意先集計トランザクションテーブル」、ディメンジョンテーブル項目に「得意先マスタテーブル」が登録されているレコードを図5(a)のスキーマ定義テーブルから検索する。   Subsequently, the CPU 201 sets the table ID “3” of the customer aggregation transaction table set in the schema determination definition variable [D] and the table ID “0” of the customer master table set in the table variable [G]. As a key, the schema definition table in FIG. 5A is searched for a record in which “customer aggregation transaction table” is registered in the fact table item and “customer master table” is registered in the dimension table item.

続いて、CPU201は、ステップS619の検索処理の結果、該当するレコードがスキーマ定義テーブルから検索されたか否かを判断する(ステップS620)。図5(a)のスキーマ定義テーブルには該当するレコードが存在するので、処理はステップS617に移行する。   Subsequently, the CPU 201 determines whether or not the corresponding record has been searched from the schema definition table as a result of the search processing in step S619 (step S620). Since the corresponding record exists in the schema definition table of FIG. 5A, the process proceeds to step S617.

CPU201は、再び利用テーブル変数[C]にセットされているテーブルIDの1つをRAM203から読み込み、RAM203内においてテーブル変数[G]にセットする(ステップS617)。ここでは、テーブル変数[G]が得意先集計トランザクションテーブルのテーブルID"3"に更新される。   The CPU 201 again reads one of the table IDs set in the usage table variable [C] from the RAM 203 and sets it in the table variable [G] in the RAM 203 (step S617). Here, the table variable [G] is updated to the table ID “3” of the customer aggregation transaction table.

続いて、CPU201は、RAM203から利用テーブル定義変数[C]にセットされている全テーブルIDを読み込んだか否かを判断する(ステップS618)。いま、得意先集計トランザクションテーブルのテーブルIDが読み込まれたことで全テーブルIDの読み込みが終了したので、処理はステップS621に移行する。   Subsequently, the CPU 201 determines whether or not all table IDs set in the use table definition variable [C] have been read from the RAM 203 (step S618). Now, since the reading of all the table IDs has been completed because the table ID of the customer totaling transaction table has been read, the process proceeds to step S621.

続いて、CPU201は、スキーマ判断定義変数[D]にセットされている内容に基づいて、検索対象とするデータベースのスキーマを決定する(ステップS621)。いま、スキーマ判断定義変数[D]には得意先集計トランザクションテーブルのテーブルID"3"がセットされているため、CPU201は、得意先集計トランザクションテーブルをファクトテーブルとした場合のスキーマID"1"をファクトテーブル定義テーブルから参照し、検索対象とするデータベースのスキーマとして決定する。   Subsequently, the CPU 201 determines a database schema to be searched based on the contents set in the schema determination definition variable [D] (step S621). Since the table ID “3” of the customer aggregation transaction table is set in the schema determination definition variable [D], the CPU 201 sets the schema ID “1” when the customer aggregation transaction table is a fact table. Refer to the fact table definition table and determine the schema of the database to be searched.

尚、ステップS620の判断において、該当するレコードがスキーマ定義テーブルに存在しないと判断された場合、検索対象とするデータベース構造はスキーマ0と決定される。本実施形態では、検索条件から利用テーブルを決定すると各利用テーブルを繋ぐ最も簡単に検索できそうなスキーマは何であるかを調べるが、スキーマ定義テーブルにおいて定義されたスキーマが直ぐに見つからず、この処理に長時間を要する虞がある場合には、スキーマ0のデータベース構造を検索対象として決定して即検索処理に移り、検索処理全体の最適化を図っている。   If it is determined in step S620 that the corresponding record does not exist in the schema definition table, the database structure to be searched is determined as schema 0. In this embodiment, when the usage table is determined from the search condition, the most easily searchable schema that connects the usage tables is examined. However, the schema defined in the schema definition table is not immediately found, and this processing is not performed. If there is a possibility that a long time is required, the database structure of the schema 0 is determined as a search target, and the process immediately moves to the search process to optimize the entire search process.

次に、CPU201は検索クエリを生成する。ここで、ステップS621においてスキーマ1が検索対象として決定されているので、次のような検索クエリが生成される。そして、CPU201は、当該検索クエリに基づいてデータ検索を実行する。
<検索クエリ>
SELECT 得意先M.得意先名,得意先集計TRN.上期販売数
FROM 得意先M,得意先集計TRN
WHERE 得意先M.得意先CD='1001'
AND (得意先M.得意先CD=得意先集計TRN.得意先CD)
Next, the CPU 201 generates a search query. Here, since schema 1 is determined as a search target in step S621, the following search query is generated. Then, the CPU 201 performs a data search based on the search query.
<Search query>
SELECT Customer M. Customer Name, Customer Aggregation TRN. Number of Sales in 1H
FROM customer M, customer total TRN
WHERE customer M. customer CD = '1001'
AND (customer M. customer CD = customer aggregation TRN. Customer CD)

本実施形態では、上記のように、検索条件に応じて検索対象となるデータベースのスキーマを決定することにより、検索クエリの生成や実行処理に要する時間の短縮化を図っているが、本実施形態のようにスキーマの決定を行わない場合、画一的なスキーマのデータベースが検索の対象となるので生成される検索クエリは次のように複雑なものとなり、検索クエリの処理を最適化することができない。
<検索クエリ>
SELECT 得意先M.得意先名,得意先集計TRN.上期販売数
FROM 得意先M,得意先集計TRN,実績TRN
WHERE 得意先M.得意先CD='1001'
AND (得意先.得意先CD = 実績TRN.得意先CD)
AND (実績TRN.得意先CD = 得意先集計TRN.得意先CD)
In the present embodiment, as described above, the schema of the database to be searched is determined according to the search condition, thereby reducing the time required for generating and executing a search query. If the schema is not determined as shown in the above, the database with a uniform schema will be the target of the search, so the generated search query will be complicated as follows and the search query processing can be optimized. Can not.
<Search query>
SELECT Customer M. Customer name, Customer total TRN. Number of first half sales
FROM Customer M, Customer Aggregation TRN, Actual TRN
WHERE customer M. customer CD = '1001'
AND (customer.customer CD = actual TRN.customer CD)
AND (actual TRN.customer CD = customer summary TRN.customer CD)

以上のように、本実施形態によれば、検索条件に応じて、異なる複数のデータテーブル(得意先マスタテーブル、商品マスタテーブル、実績トランザクションテーブル、得意先集計トランザクションテーブル及び商品集計トランザクションテーブル)からデータテーブルを選択し、選択したデータテーブルから成るスキーマパターンを決定している。従って、従来のようにスキーマパターンの最適化を図る上で同一のデータテーブルを複数作成する必要がなくなり、記憶容量の使用量を抑えることが可能となる。   As described above, according to this embodiment, data is obtained from a plurality of different data tables (customer master table, product master table, actual transaction table, customer aggregation transaction table, and product aggregation transaction table) according to the search conditions. A table is selected, and a schema pattern including the selected data table is determined. Therefore, it is not necessary to create a plurality of the same data tables in order to optimize the schema pattern as in the prior art, and it is possible to reduce the amount of storage capacity used.

また、本発明によれば、最適化されたスキーマパターンに応じた検索クエリを生成して実行しているので、スキーマパターンが最適化され、その結果、少ないデータテーブルで構成されるスキーマパターンのデータベースが検索対象となった場合、それに応じて検索クエリも余計な情報が省かれ、検索クエリの生成処理や実行処理も最適化することが可能となる。   In addition, according to the present invention, a search query corresponding to an optimized schema pattern is generated and executed, so that the schema pattern is optimized and, as a result, a schema pattern database including a small number of data tables. Accordingly, the search query is not subject to unnecessary information, and the search query generation process and execution process can be optimized accordingly.

また、本発明の目的は、前述した実施形態の機能を実現するソフトウェアのプログラムコードを記録した記憶媒体を、システム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU)が記憶媒体に格納されたプログラムコードを読み出し実行することによっても、達成されることは言うまでもない。   Another object of the present invention is to supply a storage medium storing software program codes for realizing the functions of the above-described embodiments to a system or apparatus, and the computer (or CPU or MPU) of the system or apparatus stores the storage medium. Needless to say, this can also be achieved by reading and executing the program code stored in.

この場合、記憶媒体から読み出されたプログラムコード自体が前述した実施形態の機能を実現することになり、プログラムコード自体及びそのプログラムコードを記憶した記憶媒体は本発明を構成することになる。   In this case, the program code itself read from the storage medium realizes the functions of the above-described embodiments, and the program code itself and the storage medium storing the program code constitute the present invention.

プログラムコードを供給するための記憶媒体としては、例えば、フレキシブルディスク、ハードディスク、光ディスク、光磁気ディスク、CD−ROM、CD−R、磁気テープ、不揮発性のメモリカード、ROM等を用いることができる。   As a storage medium for supplying the program code, for example, a flexible disk, a hard disk, an optical disk, a magneto-optical disk, a CD-ROM, a CD-R, a magnetic tape, a nonvolatile memory card, a ROM, or the like can be used.

また、コンピュータが読み出したプログラムコードを実行することにより、前述した実施形態の機能が実現されるだけでなく、そのプログラムコードの指示に基づき、コンピュータ上で稼動しているOS(基本システム或いはオペレーティングシステム)などが実際の処理の一部又は全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。   Further, by executing the program code read by the computer, not only the functions of the above-described embodiments are realized, but also an OS (basic system or operating system) running on the computer based on the instruction of the program code. Needless to say, a case where the functions of the above-described embodiment are realized by performing part or all of the actual processing and the processing is included.

さらに、記憶媒体から読み出されたプログラムコードが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書込まれた後、そのプログラムコードの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPU等が実際の処理の一部又は全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。   Further, after the program code read from the storage medium is written in a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer, the function is determined based on the instruction of the program code. It goes without saying that the CPU or the like provided in the expansion board or function expansion unit performs part or all of the actual processing and the functions of the above-described embodiments are realized by the processing.

本発明の一実施形態に係るデータベース検索システムの構成を模式的に示した図である。It is the figure which showed typically the structure of the database search system which concerns on one Embodiment of this invention. データベース検索サーバのハードウェア構成を示した図である。It is the figure which showed the hardware constitutions of the database search server. 検索対象となるデータベースの一構成であるデータテーブルを示した図である。It is the figure which showed the data table which is one structure of the database used as search object. 検索対象となる3つのスキーマ構成体のデータベースを示した図である。It is the figure which showed the database of three schema structure bodies used as search object. スキーマ定義テーブル及びファクト定義テーブルの構成を示した図である。It is the figure which showed the structure of a schema definition table and a fact definition table. データベース検索サーバによるデータ検索動作を示すフローチャートである。It is a flowchart which shows the data search operation | movement by a database search server. データベース検索サーバによるデータ検索動作を示すフローチャートである。It is a flowchart which shows the data search operation | movement by a database search server. 検索処理における利用項目と利用テーブルを説明するための図である。It is a figure for demonstrating the usage item and usage table in a search process. 利用テーブルIDテーブルの構成を示した図である。It is the figure which showed the structure of the utilization table ID table.

符号の説明Explanation of symbols

100 クライアントPC
200 データベース検索サーバ
300 DBサーバ
21 自由検索アプリケーション
22 自由検索DB
201 CPU
202 ROM
203 RAM
204 システムバス
205 入力コントローラ
206 ビデオコントローラ
207 メモリコントローラ
208 通信I/Fコントローラ
209 キーボード
210 CRTディスプレイ
211 外部メモリ
100 client PC
200 Database Search Server 300 DB Server 21 Free Search Application 22 Free Search DB
201 CPU
202 ROM
203 RAM
204 System Bus 205 Input Controller 206 Video Controller 207 Memory Controller 208 Communication I / F Controller 209 Keyboard 210 CRT Display 211 External Memory

Claims (4)

集計対象の項目を有したファクトテーブルと、当該ファクトテーブルと関連付けられた集計軸の項目を有したディメンションテーブルとの1対の関連付けを1つのレコードとして紐付けられ、データベースの論理構造である、当該レコードに対応したスキーマを複数定義したスキーマ定義テーブルを記憶する記憶手段と、
データの検索条件を入力する入力手段と、
前記入力手段で入力された検索条件に含まれる検索項目を有するファクトテーブル又はディメンジョンテーブルを決定する決定手段と、
前記決定手段で決定されたファクトテーブル又はディメンジョンテーブルをすべて備えるレコードが、前記スキーマ定義テーブルのレコードにあるか否かを判定する判定手段と、
前記判定手段で、前記決定手段で決定されたファクトテーブル又はディメンジョンテーブルをすべて備えるレコードが、前記スキーマ定義テーブルのレコードにないと判定した場合、すべての検索対象の項目を含むスキーマを検索対象として、前記入力手段で入力された検索条件に従ったクエリを生成する第1のクエリ生成手段と、
前記判定手段で、前記決定手段で決定されたファクトテーブル又はディメンジョンテーブルをすべて備えるレコードが、前記スキーマ定義テーブルのレコードにあると判定した場合、当該レコードに従ったスキーマを検索対象として、前記入力手段で入力された検索条件に応じたクエリを生成する第2のクエリ生成手段とを備えることを特徴とするデータベース検索装置。
A pair of associations between a fact table having an aggregation target item and a dimension table having an aggregation axis item associated with the fact table is linked as one record, and is a logical structure of the database. Storage means for storing a schema definition table that defines a plurality of schemas corresponding to records;
An input means for inputting data search conditions;
A determination unit for determining a fact table or a dimension table having a search item included in the search condition input by the input unit;
A determination means for determining whether or not a record including all the fact table or dimension table determined by the determination means is in the record of the schema definition table;
When the determination unit determines that a record including all the fact table or dimension table determined by the determination unit is not included in the record of the schema definition table, a schema including all search target items is set as a search target. First query generation means for generating a query according to the search condition input by the input means;
When the determination unit determines that the record including all of the fact table or dimension table determined by the determination unit is in the record of the schema definition table, the input unit uses the schema according to the record as a search target. And a second query generation means for generating a query corresponding to the search condition input in step (b).
前記決定手段で決定されたディメンジョンテーブルが1つであるか否かを判定するテーブル判定手段と、
前記テーブル判定手段により当該ディメンジョンテーブルが1つであると判定された場合、当該ディメンジョンテーブルで指定された項目のデータテーブルを検索対象として、前記入力手段で入力された検索条件に従ったクエリを生成する第3のクエリ生成手段とを更に備え、
当該ディメンジョンテーブルがマスタテーブルであり、前記テーブル判定手段により当該ディメンジョンテーブルが複数であると判定された場合、前記第1のクエリ生成手段によりクエリを生成することを特徴とする請求項1に記載のデータベース検索装置。
Table determining means for determining whether or not there is one dimension table determined by the determining means;
If the table determining means determines that there is only one dimension table, a query according to the search condition input by the input means is generated with the data table of the item specified in the dimension table as a search target And a third query generation means for
2. The query according to claim 1, wherein the dimension table is a master table, and the first query generation unit generates a query when the table determination unit determines that there are a plurality of the dimension tables. Database search device.
データベース検索装置におけるデータベース検索方法であって、
前記データベース検索装置の記憶手段が、集計対象の項目を有したファクトテーブルと、当該ファクトテーブルと関連付けられた集計軸の項目を有したディメンションテーブルとの1対の関連付けを1つのレコードとして紐付けられ、データベースの論理構造である、当該レコードに対応したスキーマを複数定義したスキーマ定義テーブルを記憶する記憶工程と、
前記データベース検索装置の入力手段が、データの検索条件を入力する入力工程と、
前記データベース検索装置の決定手段が、前記入力工程で入力された検索条件に含まれる検索項目を有するファクトテーブル又はディメンジョンテーブルを決定する決定工程と、
前記データベース検索装置の判定手段が、前記決定工程で決定されたファクトテーブル又はディメンジョンテーブルをすべて備えるレコードが、前記スキーマ定義テーブルのレコードにあるか否かを判定する判定工程と、
前記データベース検索装置の第1のクエリ生成手段が、前記判定工程で、前記決定工程で決定されたファクトテーブル又はディメンジョンテーブルをすべて備えるレコードが、前記スキーマ定義テーブルのレコードにないと判定した場合、すべての検索対象の項目を含むスキーマを検索対象として、前記入力手段で入力された検索条件に従ったクエリを生成する第1のクエリ生成工程と、
前記データベース検索装置の第2のクエリ生成手段が、前記判定工程で、前記決定工程で決定されたファクトテーブル又はディメンジョンテーブルをすべて備えるレコードが、前記スキーマ定義テーブルのレコードにあると判定した場合、当該レコードに従ったスキーマを検索対象として、前記入力工程で入力された検索条件に応じたクエリを生成する第2のクエリ生成工程とを備えることを特徴とするデータベース検索方法。
A database search method in a database search device,
The storage means of the database search device associates a pair of associations between a fact table having an aggregation target item and a dimension table having an aggregation axis item associated with the fact table as one record. Storing a schema definition table that defines a plurality of schemas corresponding to the record, which is a logical structure of the database;
An input step in which the input means of the database search device inputs data search conditions;
The determination unit of the database search device determines a fact table or a dimension table having a search item included in the search condition input in the input step;
The determination unit of the database search device determines whether a record including all the fact table or dimension table determined in the determination step is in the record of the schema definition table,
When the first query generation means of the database search device determines that the records including all the fact tables or dimension tables determined in the determination step are not included in the records of the schema definition table in the determination step, all A first query generation step of generating a query according to the search condition input by the input means, using a schema including the search target item as a search target;
When the second query generation unit of the database search device determines that the record including all the fact tables or dimension tables determined in the determination step is in the record of the schema definition table in the determination step, A database search method comprising: a second query generation step of generating a query according to a search condition input in the input step, using a schema according to a record as a search target.
データベース検索装置におけるデータベース検索方法をコンピュータに実行させるためのプログラムであって、
前記データベース検索装置の記憶手段が、集計対象の項目を有したファクトテーブルと、当該ファクトテーブルと関連付けられた集計軸の項目を有したディメンションテーブルとの1対の関連付けを1つのレコードとして紐付けられ、データベースの論理構造である、当該レコードに対応したスキーマを複数定義したスキーマ定義テーブルを記憶する記憶ステップと、
前記データベース検索装置の入力手段が、データの検索条件を入力する入力ステップと、
前記データベース検索装置の決定手段が、前記入力ステップで入力された検索条件に含まれる検索項目を有するファクトテーブル又はディメンジョンテーブルを決定する決定ステップと、
前記データベース検索装置の判定手段が、前記決定ステップで決定されたファクトテーブル又はディメンジョンテーブルをすべて備えるレコードが、前記スキーマ定義テーブルのレコードにあるか否かを判定する判定ステップと、
前記データベース検索装置の第1のクエリ生成手段が、前記判定ステップで、前記決定ステップで決定されたファクトテーブル又はディメンジョンテーブルをすべて備えるレコードが、前記スキーマ定義テーブルのレコードにないと判定した場合、すべての検索対象の項目を含むスキーマを検索対象として、前記入力手段で入力された検索条件に従ったクエリを生成する第1のクエリ生成ステップと、
前記データベース検索装置の第2のクエリ生成手段が、前記判定ステップで、前記決定ステップで決定されたファクトテーブル又はディメンジョンテーブルをすべて備えるレコードが、前記スキーマ定義テーブルのレコードにあると判定した場合、当該レコードに従ったスキーマを検索対象として、前記入力ステップで入力された検索条件に応じたクエリを生成する第2のクエリ生成ステップとをコンピュータに実行させるためのプログラム。
A program for causing a computer to execute a database search method in a database search device,
The storage means of the database search device associates a pair of associations between a fact table having an aggregation target item and a dimension table having an aggregation axis item associated with the fact table as one record. Storing a schema definition table that defines a plurality of schemas corresponding to the record, which is a logical structure of the database;
An input step in which the input means of the database search device inputs data search conditions;
A determination step of determining a fact table or a dimension table having a search item included in the search condition input in the input step;
The determination unit of the database search apparatus determines whether or not the record including all the fact table or dimension table determined in the determination step is in the record of the schema definition table,
If the first query generation means of the database search device determines that the records including all the fact tables or dimension tables determined in the determination step are not included in the records of the schema definition table in the determination step, all A first query generation step of generating a query according to the search condition input by the input means, using a schema including the search target item as a search target;
When the second query generation unit of the database search device determines that the record including all the fact tables or dimension tables determined in the determination step is in the record of the schema definition table in the determination step, A program for causing a computer to execute a second query generation step of generating a query according to a search condition input in the input step, using a schema according to a record as a search target.
JP2003395888A 2003-11-26 2003-11-26 Database search apparatus, database search method and program Expired - Fee Related JP4084740B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003395888A JP4084740B2 (en) 2003-11-26 2003-11-26 Database search apparatus, database search method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003395888A JP4084740B2 (en) 2003-11-26 2003-11-26 Database search apparatus, database search method and program

Publications (2)

Publication Number Publication Date
JP2005157773A JP2005157773A (en) 2005-06-16
JP4084740B2 true JP4084740B2 (en) 2008-04-30

Family

ID=34721531

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003395888A Expired - Fee Related JP4084740B2 (en) 2003-11-26 2003-11-26 Database search apparatus, database search method and program

Country Status (1)

Country Link
JP (1) JP4084740B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7603358B1 (en) * 2005-02-18 2009-10-13 The Macgregor Group, Inc. Compliance rules analytics engine

Also Published As

Publication number Publication date
JP2005157773A (en) 2005-06-16

Similar Documents

Publication Publication Date Title
CA2490212C (en) Searchable archive
RU2398273C2 (en) Combination of multidimensional expressions and deep data analysis extensions for extracting information from olap cubes
US10635996B2 (en) Reproducible selection of members in a hierarchy
US7904415B2 (en) Systems and computer program products to manage the display of data entities and relational database structures
KR101213798B1 (en) Complex data access
JP3058672B2 (en) Database management system
JP2000285128A (en) Job analytic system
US7447682B2 (en) Framework for retrieval and display of large result sets
JP4084740B2 (en) Database search apparatus, database search method and program
US20080033949A1 (en) Electronic apparatus and method therefor
JP4109988B2 (en) Database search apparatus, database search method, program, and computer-readable recording medium
US8626746B2 (en) Tracking modifications to values of various fields in a database serve
US11960466B2 (en) Methods and apparatus for data and data request management
JP7132056B2 (en) Departmental Profit and Loss Management Device, Departmental Profit and Loss Management Method, and Departmental Profit and Loss Management Program
JP2015162137A (en) Information processing system, processing method thereof, and program
JP2009015511A (en) Metadata management device, program, and metadata management method
JP2004341770A (en) Data management system and data management method
JP2022190978A (en) Commodity information management system in online store
JP2017107268A (en) Information processing apparatus, processing method, and program
JP2002251391A (en) System and method for managing data and computer program
JP2022026169A (en) Document navigation device, document navigation method, and document navigation program
JP2004070791A (en) Definition information creation method for multi dimensional database and its program
JPH04250526A (en) File processor
JP2006268783A (en) Data retrieval system, data retrieval method, and computer program
JP2004110589A (en) Information retrieval method and information retrieval system

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071023

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071225

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20080122

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080215

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20110222

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20110222

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120222

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120222

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130222

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20140222

Year of fee payment: 6

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees