JP4084740B2 - Database search apparatus, database search method and program - Google Patents
Database search apparatus, database search method and program Download PDFInfo
- 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
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
しかしながら、特許文献1に記載のデータベースシステムにおいては、スキーマパターンを最適化して用いることは可能であるが、最適化の仕組みをデータベースのRDBMSの機能として持つためには非常に高価なデータベースの導入が必要となる。これらの高価なデータベースにおいてはキューブ等の名称で呼ばれるデータベースを構築しなくてはならないが、その場合同一のデータテーブルを複数作成する必要があり、無駄な記憶容量を必要とする。
However, in the database system described in
また、更には、特許文献1ではスキーマは最適化することが可能となるが、クエリの生成は最適化されないので簡単な検索を最適化されたスキーマを用いて行う場合でも画一的なクエリ生成を行うので、クエリ生成において無駄な処理を行うという欠点もあった。さらに、従来、スキーマ定義テーブルにおいて定義されたスキーマが直ぐに見つからず、この処理に長時間を要する虞があった。
Furthermore, although it is possible to optimize the schema in
本発明の目的は、複数のスキーマから適するスキーマを探す検索処理と、検索されたスキーマを用いた検索処理の検索処理全体としての処理時間を短くする仕組みを提供することである。
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
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.
データベース検索サーバ200に接続される各クライアント100は、所望の出力データ項目を指定する出力条件及びその検索条件を画面上で入力し、その入力内容をデータベース検索サーバ200に対して送信する。当該入力内容を受けたデータベース検索サーバ200は、出力条件に挙げられたデータのうち検索条件に合致するデータを自由検索DB22から取得する。なお、出力条件もデータを検索するための条件であるので、出力条件の概念に含まれる。従って、以下の説明では、出力条件も含む意味で検索条件という用語を用いるものとする。
Each
次に、データベース検索サーバ200は、取得したデータを例えばCSV(Comma Separated Value)データとしてクライアントPC100に返信し、当該クライアントPC100では検索結果を画面上で確認することが可能となる。
Next, the
図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
The
また、入力コントローラ(入力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
通信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
クライアントPC100のハードウェア構成もデータベース検索サーバ200と同様であり、外部メモリ211に格納されているプログラム等が異なるものである。
The hardware configuration of the client PC 100 is the same as that of the
次に、本実施形態において用いられるデータテーブルについて説明する。
本実施形態では、図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
得意先マスタテーブルは、得意先コードを記録した得意先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
スキーマ1のデータベースは、得意先マスタテーブル及び得意先集計トランザクションテーブルによって構成されており、本データベースを検索対象とした場合、得意先マスタテーブルと得意先集計トランザクションテーブルに含まれる項目のみを検索することができる。本データベース構造においては、得意先集計トランザクションテーブルをファクトテーブルとしており、得意先マスタテーブルと得意先集計トランザクションテーブルとは得意先CD項目をキーにして関連付けられている。
The database of
スキーマ2のデータベースは、商品マスタテーブル及び商品集計トランザクションテーブルによって構成されており、本データベースを検索対象とした場合、商品マスタテーブルと商品集計トランザクションテーブルに含まれる項目のみを検索することができる。本データベース構造においては、商品集計トランザクションテーブルをファクトテーブルとしており、商品マスタテーブルと商品集計トランザクションテーブルとは商品CD項目をキーにして関連付けられている。
The database of the
図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
図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
尚、図5(b)では、スキーマ0〜スキーマ2の3つのデータベース構成についてのみ例示した。上記5つ以外にもデータテーブルが増えた際には、データテーブルを組み合わせによる更に多様なデータベース構成を検索対象とすることができ、例えば、スキーマ3〜9のファクトテーブルについても(スキーマID=1〜9:機能限定スキーマのファクトテーブル)定義し、同時に図5(a)のスキーマ定義テーブルへの登録を行うことでバリエーションを増やすことが可能であることは言うまでもない。
In FIG. 5B, only three database configurations of
次に、データベース検索サーバ200によるデータ検索動作について、図6−1及び図6−2を参照しながら説明する。図6−1及び図6−2は、本実施形態に係るデータベース検索サーバ200の動作を示すフローチャートである。
本データベース検索動作において、ユーザの検索条件指定としては、例えば本願出願人による特願2002−382470号に記載されるように複数のデータテーブルで構成されるデータベースに対し、1以上のデータテーブルで1以上の項目名を指定して検索指定条件を入力し、同様に1以上のデータテーブルで1以上の項目名を指定して表示指定条件(検索出力条件)として検索を行う仕組みを適用することが可能である。
Next, the data search operation by the
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
本処理例では、得意先コード及び得意先名を指定した検索条件をクライアント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
CPU201は、クライアントPC100からの上記検索条件を受けて、ユーザの指定項目(得意先コード、得意先名)から利用テーブルを決定し(ステップS601)、得意先マスタテーブルを利用テーブル情報としてRAM203に記録する。利用テーブルの決定としては、どのテーブルの項目情報を指定したかが分かれば決定できるので、この場合は得意先マスタテーブルの項目を見ながら全ての条件を指定したケースが当てはまる。同様の項目を指定した場合でも他のテーブル、例えば得意先集計トランザクションテーブルの得意先CDを指定した場合には得意先集計トランザクションテーブルが利用テーブルに追加されることになる。同一のテーブルが複数回指定される場合には、重複しないように1つにしてしまう為に、利用テーブルの書き込み時同一テーブルは上書き等の処理を行う。ここでは得意先マスタテーブルのみが指定されたとして説明を続ける。
In response to the search condition from the
続いて、CPU201は、利用テーブル情報に含まれる全利用テーブルのRAM203からの読み込みが完了したか否かを判断する(ステップS602)。現時点では、未だ利用テーブルの読み込みが完了していないため、処理はステップS603に移行する。
Subsequently, the
続いて、CPU201は、RAM203から1件の利用テーブルを読み込み、当該利用テーブルのテーブルIDを図8に示す利用テーブルIDテーブルから参照し、テーブル変数[A]にセットする(ステップS603)。ここで読み込まれる利用テーブルは得意先マスタテーブルであるため、RAM203内においてテーブル変数[A]は"0"にセットされる。尚、利用テーブルIDテーブルは、例えばRAM203に記録されている。
Subsequently, the
続いて、CPU201は、テーブル変数[A]にセットされているテーブルID"0"のテーブル、即ち得意先マスタテーブルのスキーマIDをファクトテーブル定義テーブルから参照し、RAM203内においてそのスキーマIDをスキーマID変数[B]にセットする(ステップS604)。ここでは、ファクトテーブル定義テーブルにおいて、得意先マスタテーブルをファクトテーブルとした場合のスキーマIDは"null"と定義されているため、スキーマID変数[B]は"null"にセットされる。尚、ファクトテーブル定義テーブルは、例えばRAM203に記録されている。
Subsequently, the
続いて、CPU201は、セットされているスキーマID変数[B]は"0"であるか否かを判断する(ステップS605)。ここでは、スキーマID変数[B]は"null"にセットされているため、処理はステップS606に移行する。
Subsequently, the
続いて、CPU201は、セットされているスキーマID変数[B]は"null"であるか否かを判断する(ステップS606)。スキーマID変数[B]は"null"であるため、処理はステップS607に移行する。
Subsequently, the
続いて、CPU201は、利用テーブル定義変数[C]にテーブル変数[A]を追加設定する。いま、利用テーブル定義変数[C]には何も設定されていない状態であるので、RAM203内において利用テーブル定義変数[C]は"0"にセットされる。また、CPU201は、利用テーブル定義変数[C]をセットするとともに、スキーマ判断定義変数[D]とスキーマ判断定義変数[E]をセットする。即ち、RAM203内において、スキーマ判断定義変数[D]にはテーブル変数[A]"0"がセットされ、スキーマ判断定義変数[E]には"null"がセットされる(ステップS607)。
Subsequently, the
CPU201の処理はステップS602に戻り、再び全利用テーブルの読み込みが終了したか否かが判断される。いま、CPU201によって全利用テーブルがRAM203から読み出された状態にあるので、処理は図6−2のステップS611に移行する。
The process of the
CPU201は、スキーマ判断定義変数[D]とスキーマ判断定義変数[E]をRAM203から読み込み(ステップS611)、スキーマ判断定義変数[E]にセットされている内容が"null"、"0"及び"1以上"の何れであるかを判断する(ステップS612)。いま、スキーマ判断定義変数[E]には"null"がセットされているので、処理はステップS613に移行する。
The
続いて、CPU201は、RAM203から利用テーブル情報を読み込み、当該利用テーブル情報に含まれる利用テーブルの数をカウント変数[F]にRAM203内でセットし(ステップS613)、セットしたカウント変数[F]の値が"1"であるか否かを判断する(ステップS614)。いま、カウント変数[F]の値は"1"にセットされているため、検索条件にて指定されるマスタテーブル、即ち得意先マスタテーブルのみを対象とした検索処理が決定される(ステップS615)。
Subsequently, the
一方、カウント変数[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
続いて、CPU201は検索クエリを生成する。ここで、ステップS615において得意先マスタテーブルのみが検索対象と決定されているので、次のような検索クエリが生成される。尚、SELECT文では検索する項目名及びその項目が属するテーブル名が指定され、FROM文では検索先となるテーブル名が指定され、WHERE文には検索条件が指定される。
<検索クエリ>
SELECT 得意先M.得意先名
FROM 得意先M
WHERE 得意先M.得意先CD='1001'
Subsequently, the
<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
本処理例では、実績年月、得意先コード、商品コード、得意先名、商品名及び販売数を指定した検索条件をクライアント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
CPU201は、クライアントPCからの上記検索条件を受けて、ユーザの指定項目(実績年月、得意先コード、商品コード、得意先名、商品名及び販売数)から利用テーブルを決定し(ステップS601)、実績トランザクションテーブル、得意先マスタテーブル及び商品マスタテーブルを利用テーブル情報としてRAM203に記録する。
In response to the search condition from the client PC, the
続いて、CPU201は、利用テーブル情報に含まれる全利用テーブルのRAM203からの読み込みが完了したか否かを判断する(ステップS602)。現時点では、未だ利用テーブルの読み込みが完了していないため、処理はステップS603に移行する。
Subsequently, the
続いて、CPU201は、RAM203から1件の利用テーブルを読み込み、当該利用テーブルのテーブルIDを図8に示す利用テーブルIDテーブルから参照し、テーブル変数[A]にセットする(ステップS603)。ここで読み込まれる利用テーブルは実績トランザクションテーブルであることを想定すると、RAM203内においてテーブル変数[A]を"2"にセットする。
Subsequently, the
続いて、CPU201は、変数[A]にセットされているテーブルID"2"のテーブル、即ち実績トランザクションテーブルのスキーマIDをファクトテーブル定義テーブルから参照し、RAM203内においてそのスキーマIDをスキーマID変数[B]にセットする(ステップS604)。ここでは、ファクトテーブル定義テーブルにおいて、実績トランザクションをファクトテーブルとした場合のスキーマIDは"0"と定義されているため、スキーマID変数[B]は"0"にセットされる。
Subsequently, the
続いて、CPU201は、セットされているスキーマID変数[B]は"0"であるか否かを判断する(ステップS605)。ここでは、スキーマID変数[B]は"0"にセットされているため、処理はステップS610に移行する。
Subsequently, the
続いて、CPU201は、スキーマ判断定義変数[D]とスキーマ判断定義変数[E]をセットする(ステップS610)。スキーマ判断定義変数[D]にはテーブル変数[A]、即ち実績トランザクションテーブルのテーブルID"2"がセットされ、スキーマ判断定義変数[E]には"0"がセットされる。
Subsequently, the
CPU201は、スキーマ判断定義変数[D]とスキーマ判断定義変数[E]をRAM203から読み込み(ステップS611)、スキーマ判断定義変数[E]にセットされている内容が"null"、"0"及び"1以上"の何れかであるかを判断する(ステップS612)。いま、スキーマ判断定義変数[E]には"0"がセットされているので、処理はステップS616に移行する。
The
続いて、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
<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
本処理例では、得意先コード、得意先名及び上期販売数を指定した検索条件をクライアント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
CPU201は、クライアントPCからの上記検索条件を受けて、ユーザの指定項目(得意先CD、得意先名、上期販売数)から利用テーブルを決定し(ステップS601)、利用テーブルが得意先マスタテーブル及び得意先集計トランザクションテーブルであることを利用テーブル情報としてRAM203に記録する。
In response to the search condition from the client PC, the
続いて、CPU201は、利用テーブル情報に含まれる全利用テーブルのRAM203からの読み込みが完了したか否かを判断する(ステップS602)。現時点では、未だ利用テーブル情報の読み込みが完了していないため、処理はステップS603に移行する。
Subsequently, the
続いて、CPU201は、RAM203から1件の利用テーブルを読み込み、当該利用テーブルのテーブルIDを図8に示す利用テーブルIDテーブルから参照し、テーブル変数[A]にセットする(ステップS603)。ここで読み込まれる利用テーブルは得意先マスタテーブルであることを想定すると、RAM203内においてテーブル変数[A]は"0"にセットされる。
Subsequently, the
続いて、CPU201は、テーブル変数[A]にセットされているテーブルID"0"のテーブル、即ち得意先マスタテーブルのスキーマIDをファクト定義テーブルから参照し、RAM203内においてそのスキーマIDをスキーマID変数[B]にセットする(ステップS604)。ここでは、ファクトテーブル定義テーブルにおいて、得意先マスタテーブルをファクトテーブルとした場合のスキーマIDは"null"と定義されているため、スキーマID変数[B]は"null"にセットされる。
Subsequently, the
続いて、CPU201は、セットされているスキーマID変数[B]は"0"であるか否かを判断する(ステップS605)。ここでは、スキーマID変数[B]は"null"にセットされているため、処理はステップS606に移行する。
Subsequently, the
続いて、CPU201は、セットされているスキーマID変数[B]は"null"であるか否かを判断する(ステップS606)。スキーマID変数[B]は"null"であるため、処理はステップS607に移行する。
Subsequently, the
続いて、CPU201は、利用テーブル定義変数[C]にテーブル変数[A]を追加設定する。いま、利用テーブル定義変数[C]には何も設定されていない状態であるので、RAM203内において利用テーブル定義変数[C]は"0"にセットされる。また、CPU201は、利用テーブル定義変数[C]をセットするとともに、スキーマ判断定義変数[D]とスキーマ判断定義変数[E]をセットする。即ち、RAM203内において、スキーマ判断定義変数[D]にはテーブル変数[A]"0"がセットされ、スキーマ判断定義変数[E]には"null"がセットされる(ステップS607)。
Subsequently, the
CPU201の処理はステップS602に戻り、再び全利用テーブルの読み込みが終了したか否かが判断される。未だ、RAM203には得意先集計トランザクションテーブルが利用テーブルとして残されているので、処理はステップS603に移行する。
The process of the
続いて、CPU201は、RAM203から1件の利用テーブル(得意先集計トランザクションテーブル)を読み込み、当該利用テーブルのテーブルIDを図8に示す利用テーブルIDテーブルから参照し、テーブル変数[A]を更新する(ステップS603)。ここで読み込まれる利用テーブルは得意先集計トランザクションテーブルであるため、RAM203内においてテーブル変数[A]は"3"に更新される。
Subsequently, the
続いて、CPU201は、変数[A]にセットされているテーブルID"3"のテーブル、即ち得意先集計トランザクションテーブルのスキーマIDをファクトテーブル定義テーブルから参照し、RAM203内においてスキーマID変数[B]をそのスキーマIDに更新する(ステップS604)。得意先集計トランザクションテーブルをファクトテーブルとした場合のスキーマIDは、ファクトテーブル定義テーブルにおいて"1"と定義されているため、スキーマID変数[B]は"1"に更新される。
Subsequently, the
続いて、CPU201は、セットされているスキーマID変数[B]は"0"であるか否かを判断する(ステップS605)。ここでは、スキーマID変数[B]は"1"にセットされているため、処理はステップS606に移行する。
Subsequently, the
続いて、CPU201は、セットされているスキーマID変数[B]は"null"であるか否かを判断する(ステップS606)。スキーマID変数[B]は"1"にセットされているため、処理はステップS608に移行する。
Subsequently, the
続いて、CPU201は、変数[E]がスキーマID変数[B]より大きい値をとるか、或いは変数[E]には"null"がセットされているかを判断する(ステップS608)。いま、変数[E]には"null"がセットされているため、処理はステップS609に移行する。ここで、本実施形態では、スキーマIDの値が0から9に向かってより容易なスキーマ構造となるように定義付けられている。これを受けて、スキーマID変数[B]が既にセットされている変数[E]の値より小さい値であれば、ステップS609に移行し、当該スキーマID変数[B]の値で変数[E]の値に更新しており、小さい値のスキーマID、即ち複雑なスキーマの指定が変数[E]に残るようにされている。
Subsequently, the
続いて、CPU201は、利用テーブル定義変数[C]、スキーマ判断定義変数[D]及びスキーマ判断定義変数[E]をセットする(ステップS609)。利用テーブル定義変数[C]は、現在のテーブル変数[A]が追加設定され、"0,3"と更新される。スキーマ判断定義変数[D]は現在のテーブル変数[A]"3"に更新され、スキーマ判断定義変数[E]はスキーマID変数[B]"1"に更新される。
Subsequently, the
続いて、CPU201の処理はステップS602に戻り、再び利用テーブル情報に含まれる全利用テーブルのRAM203からの読み込みが完了したか否かが判断される。いま、CPU201によって全利用テーブルがRAM203から読み出された状態にあるので、処理は図6−2のステップS611に移行する。
Subsequently, the processing of the
CPU201は、スキーマ判断定義変数[D]とスキーマ判断定義変数[E]をRAM203から読み込み(ステップS611)、スキーマ判断定義変数[E]にセットされている内容が"null"、"0"及び"1以上"の何れであるかを判断する(ステップS612)。いま、スキーマ判断定義変数[E]には"1"がセットされているので、処理はステップS617に移行する。
The
続いて、CPU201は、利用テーブル定義変数[C]にセットされているテーブルIDの1つをRAM203から読み込み、RAM203内においてテーブル変数[G]にセットする(ステップS617)。ここでは、テーブル変数[G]に得意先マスタテーブルのテーブルID"0"がセットされたものとする。
Subsequently, the
続いて、CPU201は、RAM203から利用テーブル定義変数[C]にセットされている全テーブルIDを読み込んだか否かを判断する(ステップS618)。現時点では、得意先集計トランザクションテーブルのテーブルID"3"が未だ読み込まれていないため、処理はステップS619に移行する。
Subsequently, the
続いて、CPU201は、スキーマ判断定義変数[D]にセットされている得意先集計トランザクションテーブルのテーブルID"3"、テーブル変数[G]にセットされている得意先マスタテーブルのテーブルID"0"をキーにして、ファクトテーブル項目に「得意先集計トランザクションテーブル」、ディメンジョンテーブル項目に「得意先マスタテーブル」が登録されているレコードを図5(a)のスキーマ定義テーブルから検索する。
Subsequently, the
続いて、CPU201は、ステップS619の検索処理の結果、該当するレコードがスキーマ定義テーブルから検索されたか否かを判断する(ステップS620)。図5(a)のスキーマ定義テーブルには該当するレコードが存在するので、処理はステップS617に移行する。
Subsequently, the
CPU201は、再び利用テーブル変数[C]にセットされているテーブルIDの1つをRAM203から読み込み、RAM203内においてテーブル変数[G]にセットする(ステップS617)。ここでは、テーブル変数[G]が得意先集計トランザクションテーブルのテーブルID"3"に更新される。
The
続いて、CPU201は、RAM203から利用テーブル定義変数[C]にセットされている全テーブルIDを読み込んだか否かを判断する(ステップS618)。いま、得意先集計トランザクションテーブルのテーブルIDが読み込まれたことで全テーブルIDの読み込みが終了したので、処理はステップS621に移行する。
Subsequently, the
続いて、CPU201は、スキーマ判断定義変数[D]にセットされている内容に基づいて、検索対象とするデータベースのスキーマを決定する(ステップS621)。いま、スキーマ判断定義変数[D]には得意先集計トランザクションテーブルのテーブルID"3"がセットされているため、CPU201は、得意先集計トランザクションテーブルをファクトテーブルとした場合のスキーマID"1"をファクトテーブル定義テーブルから参照し、検索対象とするデータベースのスキーマとして決定する。
Subsequently, the
尚、ステップ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
次に、CPU201は検索クエリを生成する。ここで、ステップS621においてスキーマ1が検索対象として決定されているので、次のような検索クエリが生成される。そして、CPU201は、当該検索クエリに基づいてデータ検索を実行する。
<検索クエリ>
SELECT 得意先M.得意先名,得意先集計TRN.上期販売数
FROM 得意先M,得意先集計TRN
WHERE 得意先M.得意先CD='1001'
AND (得意先M.得意先CD=得意先集計TRN.得意先CD)
Next, the
<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.
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
201 CPU
202 ROM
203 RAM
204
Claims (4)
データの検索条件を入力する入力手段と、
前記入力手段で入力された検索条件に含まれる検索項目を有するファクトテーブル又はディメンジョンテーブルを決定する決定手段と、
前記決定手段で決定されたファクトテーブル又はディメンジョンテーブルをすべて備えるレコードが、前記スキーマ定義テーブルのレコードにあるか否かを判定する判定手段と、
前記判定手段で、前記決定手段で決定されたファクトテーブル又はディメンジョンテーブルをすべて備えるレコードが、前記スキーマ定義テーブルのレコードにないと判定した場合、すべての検索対象の項目を含むスキーマを検索対象として、前記入力手段で入力された検索条件に従ったクエリを生成する第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つであると判定された場合、当該ディメンジョンテーブルで指定された項目のデータテーブルを検索対象として、前記入力手段で入力された検索条件に従ったクエリを生成する第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.
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)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7603358B1 (en) * | 2005-02-18 | 2009-10-13 | The Macgregor Group, Inc. | Compliance rules analytics engine |
-
2003
- 2003-11-26 JP JP2003395888A patent/JP4084740B2/en not_active Expired - Fee Related
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 |