JP5320787B2 - Search key optimization apparatus and search key optimization program - Google Patents
Search key optimization apparatus and search key optimization program Download PDFInfo
- Publication number
- JP5320787B2 JP5320787B2 JP2008076680A JP2008076680A JP5320787B2 JP 5320787 B2 JP5320787 B2 JP 5320787B2 JP 2008076680 A JP2008076680 A JP 2008076680A JP 2008076680 A JP2008076680 A JP 2008076680A JP 5320787 B2 JP5320787 B2 JP 5320787B2
- Authority
- JP
- Japan
- Prior art keywords
- search
- search key
- database
- key
- item
- 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.)
- Active
Links
Images
Description
本発明は、検索キー最適化装置及び検索キー最適化プログラムに係り、特にプログラムロジックがデータベースの検索に利用する検索キーを最適化する検索キー最適化装置及び検索キー最適化プログラムに関する。 The present invention relates to a search key optimizing device and a search key optimizing program, and more particularly to a search key optimizing device and a search key optimizing program for optimizing a search key used by a program logic for searching a database.
近年では、データベース(DB)を利用するシステム(プログラムロジック)が設計されるようになった。通常、プログラムロジックはDBへの高速アクセスを目的として設計時にインデックス(検索キー)が生成される。従来、インデックスは例えばプログラムロジックから生成されていた(例えば特許文献1及び2参照)。
しかしながら、プログラムロジックからインデックスを生成する場合は、プログラムロジックを前提としてインデックスを生成するため、プログラムロジック自体にDBアクセス時のレスポンス品質上(検索効率上)の問題がある場合、DBアクセス時のレスポンス品質を無視したインデックスを生成してしまうことがあった。 However, when generating an index from the program logic, the index is generated on the premise of the program logic. Therefore, if the program logic itself has a problem in response quality (in terms of search efficiency) at the time of DB access, a response at the time of DB access An index that ignores quality was sometimes generated.
したがって、DBアクセス時のレスポンス品質を確保する為には、プログラムロジックの設計者がプログラムロジックを解析し、DBアクセス時のレスポンス品質を確保する為に最適なインデックスを生成しなければならず、設計者の作業量が増加してしまうという問題があった。 Therefore, in order to ensure the response quality at the time of DB access, the program logic designer must analyze the program logic and generate an optimal index to ensure the response quality at the time of DB access. There is a problem that the amount of work of the worker increases.
本発明の一実施形態は、上記の点に鑑みなされたもので、設計者の作業量を増加させることなくデータベースアクセス時のレスポンス品質を確保可能な検索キー最適化装置及び検索キー最適化プログラムを提供することを目的とする。 An embodiment of the present invention has been made in view of the above points. A search key optimization device and a search key optimization program capable of ensuring response quality at the time of database access without increasing the amount of work of a designer are provided. The purpose is to provide.
上記課題を解決するため、本発明の一実施形態は、データベースの操作を行うプログラムロジックが前記データベースの検索に利用する検索キーを最適化する検索キー最適化装置であって、前記プログラムロジックから前記データベースの検索に利用する検索キーを1つ以上抽出する第一の検索キー抽出手段と、既に定義済みの検索キーが定義されているデータベース定義体から前記データベースの検索に利用する検索キーを1つ以上抽出する第二の検索キー抽出手段と、前記検索キーを構成する前記データベースの項目毎に、検索に利用されるときのレコードの絞り込みの程度により優先順位が設定されている優先順位情報を利用して、前記第1の検索キー抽出手段により抽出された前記検索キーの適性チェックを行い、単一で検索に利用されたときのレコードの絞り込みの程度が大きい項目から小さい項目の順番に、前記検索キーを構成する前記データベースの項目が並んでいるときに適正チェックが正常終了したと判定し、適性チェックが正常終了した前記検索キーにより前記データベース定義体を更新する検索キー適正チェック手段とを有する。 In order to solve the above-described problem, an embodiment of the present invention is a search key optimizing device for optimizing a search key used by a program logic that operates a database to search the database. A first search key extracting means for extracting one or more search keys to be used for searching the database, and one search key to be used for searching the database from a database definition body in which already defined search keys are defined. Using the second search key extracting means to be extracted as described above, and priority information in which the priority is set for each item of the database constituting the search key according to the degree of narrowing of records when used for search use to perform the suitability check of the search key extracted by the first retrieval key extraction means, the search in a single Was in the order of small item from the degree is large item options in record when that determines a proper check was successful when an item of the database constituting the retrieval key are arranged, suitability check is normally ended Search key validity checking means for updating the database definition body with the search key.
なお、本発明の一実施形態の構成要素、表現または構成要素の任意の組合せを、方法、装置、システム、コンピュータプログラム、記録媒体、データ構造などに適用したものも本発明の態様として有効である。 In addition, what applied the component, the expression, or arbitrary combinations of the component of one Embodiment of this invention to a method, an apparatus, a system, a computer program, a recording medium, a data structure, etc. is also effective as an aspect of this invention. .
本発明の一実施形態によれば、設計者の作業量を増加させることなくデータベースアクセス時のレスポンス品質を確保可能な検索キー最適化装置及び検索キー最適化プログラムを提供可能である。 According to an embodiment of the present invention, it is possible to provide a search key optimization device and a search key optimization program that can ensure response quality when accessing a database without increasing the amount of work of a designer.
次に、本発明を実施するための最良の形態を、以下の実施例に基づき図面を参照しつつ説明していく。なお、本実施例では、データベースの一例としてRDB(リレーショナルデータベース)を例に説明する。RDBは、1件のレコードを複数の項目(カラム)の集合体として表現し、データの集合をテーブルと呼ばれる表で表すデータ管理方式の一つである。RDBでは、個人番号や名前などの項目をインデックス(検索キー)として利用することで、レコードを容易に検索可能である。RDBでは、インデックスとして複数の項目から構成されるマルチカラムインデックス(複合項目検索キー)も利用される。RDBの操作には、例えばSQLと呼ばれる言語が一般的に使われる。 Next, the best mode for carrying out the present invention will be described based on the following embodiments with reference to the drawings. In this embodiment, RDB (relational database) will be described as an example of the database. RDB is one data management method in which one record is expressed as an aggregate of a plurality of items (columns) and a set of data is represented by a table called a table. In RDB, records can be easily searched by using items such as personal numbers and names as indexes (search keys). In RDB, a multi-column index (composite item search key) composed of a plurality of items is also used as an index. For the operation of RDB, for example, a language called SQL is generally used.
RDBを利用するシステム(プログラムロジック)では、通常、設計者が設計時にインデックスをデータベース定義体に定義しておく。しかしながら、設計時の思惑と実際にできあがったプログラムロジックとに差異が発生することは、しばしば起こり得る。 In a system (program logic) using RDB, a designer usually defines an index in a database definition body at the time of designing. However, it often happens that there is a difference between the design speculation and the actual program logic.
本実施例では、実際にできあがったプログラムロジックを解析し、最適なインデックスを自動生成することで、設計時の思惑と実際にできあがったプログラムロジックとの差異により発生するインデックスのギャップを埋めることができる。 In this embodiment, by analyzing the actual program logic and automatically generating the optimal index, it is possible to fill the index gap caused by the difference between the design logic and the actual program logic. .
図1は、本実施例の検索キー最適化装置のハードウェア構成図である。検索キー最適化装置は、それぞれバスBで相互に接続されている入力装置1,出力装置2,ドライブ装置3,補助記憶装置4,主記憶装置5,演算処理装置6およびインターフェース装置7で構成される。
FIG. 1 is a hardware configuration diagram of the search key optimizing apparatus according to the present embodiment. The search key optimizing device is composed of an
入力装置1はキーボードやマウスなどで構成され、各種信号を入力するために用いられる。出力装置2はディスプレイ装置などで構成され、各種ウインドウやデータ等を表示するために用いられる。インターフェース装置7は、モデム,LANカードなどで構成されており、ネットワークに接続する為に用いられる。
The
本実施例の検索キー最適化プログラムは、検索キー最適化装置を制御する各種プログラムの少なくとも一部である。検索キー最適化プログラムは、例えば記録媒体8の配布やネットワークからのダウンロードなどによって提供される。検索キー最適化プログラムを記録した記録媒体8は、CD−ROM、フレキシブルディスク、光磁気ディスク等の様に情報を光学的,電気的或いは磁気的に記録する記録媒体、ROM、フラッシュメモリ等の様に情報を電気的に記録する半導体メモリ等、様々なタイプの記録媒体を用いることができる。 The search key optimization program of this embodiment is at least a part of various programs for controlling the search key optimization device. The search key optimization program is provided by, for example, distribution of the recording medium 8 or downloading from a network. The recording medium 8 on which the search key optimization program is recorded is a recording medium such as a CD-ROM, a flexible disk, a magneto-optical disk, etc. for recording information optically, electrically or magnetically, a ROM, a flash memory, etc. Various types of recording media such as a semiconductor memory that electrically records information can be used.
また、検索キー最適化プログラムを記録した記録媒体8がドライブ装置3にセットされると、検索キー最適化プログラムは記録媒体8からドライブ装置3を介して補助記憶装置4にインストールされる。ネットワークからダウンロードされた検索キー最適化プログラムは、インターフェース装置7を介して補助記憶装置4にインストールされる。
When the recording medium 8 on which the search key optimization program is recorded is set in the
補助記憶装置4は、インストールされた検索キー最適化プログラムを格納すると共に、必要なファイル,データ等を格納する。主記憶装置5は、起動時に補助記憶装置4から検索キー最適化プログラムを読み出して格納する。そして、演算処理装置6は主記憶装置5に格納された検索キー最適化プログラムに従って、後述するような各種処理を実現している。
The auxiliary storage device 4 stores the installed search key optimization program and also stores necessary files, data, and the like. The
図2は本実施例の検索キー最適化装置の処理手順を表したフローチャートである。検索キー最適化装置は、プログラムロジックからのキー情報抽出を行う処理ロジック(プログラム)10,データベース定義体からのキー情報抽出を行う処理ロジック11,検索時一致率の設定を行う処理ロジック12,抽出したキー情報からの過不足チェックを行う処理ロジック13,抽出したキー情報の適正チェックを行う処理ロジック14,データベース定義体更新/再登録を行う処理ロジック15,プログラムロジック見直し/再登録を設計者に行わせる処理ロジック16を有する構成である。処理ロジック10〜16は例えばJCL(ジョブ制御言語)により実行を制御される。
FIG. 2 is a flowchart showing the processing procedure of the search key optimizing apparatus of this embodiment. The search key optimizing device includes a processing logic (program) 10 for extracting key information from program logic, a
プログラムロジックからのキー情報抽出を行う処理ロジック10はプログラムロジック21を読み出す。処理ロジック10は、プログラムロジック21からインデックスの候補となる候補インデックス情報23を抽出する。図3はプログラムロジックからインデックスの候補となる候補インデックス情報を抽出する処理を表した説明図である。
処理ロジック10は、プログラムロジック21に含まれるSQLなどのデータベースアクセス言語の記述からインデックスの候補となるインデックス候補情報23を以下の手順で抽出する。
The
まず、処理ロジック10はデータベース関連の命令として「EXEC SQL」〜「END−EXEC」の記述をプログラムロジック21から抽出する。抽出した記述に「DECLARE」及び「CURSOR」が含まれていれば処理ロジック10はインデックスの候補として抽出する。
First, the
処理ロジック10は抽出した記述の「WHERE」以降を検索条件として抽出し、検索条件から候補インデックス情報23を生成する。なお、「WHERE」は、検索条件を指定するものである。検索条件は、検索に利用する1つ以上の項目から構成されるインデックスと、前方一致や完全一致などの検索の手法とを表したものである。候補インデックスは一つ以上の項目から構成される。
The
処理ロジック10は候補インデックス情報23における項目の並びを記述順とし、条件設定優先順位に疑義がある場合、出力装置2等で設計者に警告を行う。条件設定優先順位とは、=,<>,BETWEEN,前方一致,・・・などである。なお、本実施例では前方一致以降の条件設定優先順位を原則使用不可としている。
The
処理ロジック10は抽出した記述に「ORDER BY」があり、データ並び替えがある場合、補足情報として抽出する。なお、候補インデックス情報23における項目以外でのデータ並び替えがあれば、処理ロジック10は出力装置2等で設計者に警告を行うようにしてもよい。
The
データベース定義体からのキー情報抽出を行う処理ロジック11は、データベース定義体22から既に定義されているインデックス情報を抽出する。処理ロジック11は、インデックス情報の抽出をテーブル毎に行い、インデックスを構成する項目及びキー重複許可有無をインデックス毎に、設定済インデックス情報24として抽出する。
検索時一致率の設定を行う処理ロジック12は、図4に示すように検索時一致率を設定する。図4は検索時一致率を設定する処理のフローチャートである。検索時一致率の設定を行う処理ロジック12は、ステップS1に進み、データベース定義体22から既に定義されているインデックス情報を抽出する。処理ロジック12は、インデックス情報の抽出をテーブル毎に行い、インデックスを構成する項目及びキー重複許可有無をインデックス毎に、設定済インデックス情報24として抽出する。
The
ステップS2に進み、処理ロジック12はデータベース29に格納されているデータからテーブル毎に指定した複合キー構成候補項目30毎のデータ分布状況31を抽出する。ここではステップS2の処理について図5を参照しつつ説明する。図5は、複合キー構成候補項目毎のデータ分布状況を表した構成図である。
In step S <b> 2, the
例えば処理ロジック12はデータベース29に格納されているデータからテーブル毎の格納レコード件数(全件)をユーティリティにて確認する。図5では300,000件となる。処理ロジック12は、複合キー構成候補項目毎のバラツキを計測する為に、項目毎の検索キー(範囲)を設定し、設定キー範囲内のレコード件数を確認して、平均件数を該当件数とする。
For example, the
例えば図5では複合キー構成候補項目「生年月日」について、「平成19年1月1日」,「昭和39年1月1日」,「昭和5年1月1日」など、数パターンの検索キーを設定し、検索結果である「10件」,「8件」,「5件」など、検索結果の平均件数である「9件」を該当件数とする。 For example, in FIG. 5, the composite key composition candidate item “birth date” has several patterns such as “January 1, 2007”, “January 1, 1939”, “January 1, 1959”, etc. A search key is set, and “9”, which is the average number of search results, such as “10”, “8”, “5”, which are search results, is set as the corresponding number.
処理ロジック12は、画面表示可能件数などを指標として操作性を踏まえ、該当件数からバラツキ「大」,「中」,「小」を判定する。例えば図5では、画面表示可能件数を20件とした場合、画面操作なしで検索結果を全件表示できる20件以下をバラツキ「小」としている。また、図5では、画面表示可能件数を20件とした場合、1〜4回の画面操作で検索結果を全件表示できる100件以下をバラツキ「中」とし、5回以上の画面操作で検索結果を全件表示できる100件超をバラツキ「大」としている。
The
ステップS3に進み、処理ロジック12は設定済インデックス情報24,複合キー構成候補項目毎のデータ分布状況31及び複合キー構成候補業務特性32から検索時一致率を設定する。複合キー構成候補業務特性32は、複合キー構成候補項目が業務上、完全一致で使用する場合が多いのか、前方一致で使用する場合が多いのか等、規定されている。
Proceeding to step S3, the
例えば図5では、複合キー構成候補項目「氏名カナ(氏名)」が前方一致、複合キー構成候補項目「生年月日」が完全一致、複合キー構成候補項目「性別」が検索後の振り分けのみに使用等、規定されている。 For example, in FIG. 5, the composite key composition candidate item “name kana (name)” matches forward, the composite key composition candidate item “birth date” matches exactly, and the composite key composition candidate item “gender” is only for sorting after the search. Use, etc. are stipulated.
処理ロジック12は、複合キー構成候補業務特性32に規定されている検索の手法「完全一致>前方一致>曖昧検索」及びバラツキ「小>中>大」の優先順位で検索時一致率25を設定する。検索時一致率25とは、複合キー構成候補項目毎の優先順位を言う。例えば本実施例では複合キー構成候補項目毎の優先順位を2桁の数字で設定する。重複を許さない複合キー構成候補項目は優先順位を「1x」(x:0〜9)で設定される。完全一致で使用する複合キー構成候補項目は優先順位を「2x」(x:0〜9)で設定される。前方一致で使用する複合キー構成候補項目は優先順位を「3x」(x:0〜9)で設定される。検索キーとして利用しない複合キー構成候補項目は優先順位を「9x」(x:0〜9)で設定される。
The
例えば、個人を特定するための一例の複合キー構成候補項目「個人番号:重複を許さない複合キー構成候補項目」は、優先順位を「10」に設定される。「住所:完全一致で使用する複合キー構成候補項目、バラツキ小」は、優先順位を「21」に設定される。「生年月日:完全一致で使用する複合キー構成候補項目、バラツキ小」は、優先順位を「22」に設定される。「氏名:前方一致で使用する複合キー構成候補項目、バラツキ大」は、優先順位を「31」に設定される。「性別:検索キーとして利用しない複合キー構成候補項目」は優先順位を「90」に設定される。 For example, an example composite key composition candidate item “personal number: composite key composition candidate item that does not allow duplication” for specifying an individual has a priority set to “10”. “Address: composite key composition candidate item used for complete match, small variation” has the priority set to “21”. “Birth date: Compound key configuration candidate item used for perfect match, small variation” has a priority set to “22”. “Name: composite key composition candidate item used for forward matching, large variation” has the priority set to “31”. “Gender: Compound key composition candidate item not used as search key” has a priority set to “90”.
なお、優先順位を設定する2桁の数字は小さいほど優先順位が高くなる。図5では平均件数が小さい(バラツキが小さい)複合キー構成候補項目の方が優先順位を高く設定される。 The smaller the 2-digit number that sets the priority, the higher the priority. In FIG. 5, the composite key composition candidate item having a smaller average number (small variation) is set with a higher priority.
抽出したキー情報からの過不足チェックを行う処理ロジック13及び抽出したキー情報の適正チェックを行う処理ロジック14は、前述の候補インデックス情報23,設定済インデックス情報24及び検索時一致率25に基づいて、マルチカラムインデックス最適化を行う。
The processing logic 13 for checking the excess / deficiency from the extracted key information and the
抽出したキー情報からの過不足チェックを行う処理ロジック13は、設定済インデックス情報24と突き合わせを行って候補インデックス情報23の過不足をチェックし、候補インデックス情報26とする。
The processing logic 13 that performs the excess / deficiency check from the extracted key information matches the
抽出したキー情報の適正チェックを行う処理ロジック14は、後述のように、候補インデックス情報26,設定済インデックス情報24及び検索時一致率25に基づいて候補インデックス情報26の適正チェックを行う。
As will be described later, the
例えば、候補インデックス情報26の適正チェックは設定済インデックス情報24と候補インデックス情報26との突き合わせを行い、検索時一致率25を利用して追加すべきインデックスがあるか、設定済みであるが使用されることのないインデックスがないかのチェックを行う。
For example, the appropriateness check of the
抽出したキー情報の適正チェックを行う処理ロジック14は適正チェックの結果に基づいて候補インデックス情報26を適正な候補インデックス情報27に更新する。また、処理ロジック14は適正チェックの結果に基づいて、プログラムロジック21の見直すべき内容28を抽出する。
The
ここでは、処理ロジック14が行う候補インデックス情報26の適正チェックについて具体例を挙げて説明する。図6は設定済インデックス情報,候補インデックス情報及び検索時一致率の一例を示す説明図である。
Here, the appropriateness check of the
設定済インデックス情報61は項目「個人番号」,「住所」,「氏名」,「生年月日」が既にインデックス情報として定義されている例である。また、候補インデックス情報62は項目「個人番号」,「住所」,「氏名」,「生年月日」の組み合わせにより構成される6つのインデックスの候補がプログラムロジック21から抽出された例である。
The
検索時一致率63は、項目「個人番号」,「住所」,「生年月日」,「氏名」,「性別」に優先順位「10」,「21」,「22」,「31」,「90」が設定された例である。以下の説明では図6の設定済インデックス情報61,候補インデックス情報62及び検索時一致率63を前提として説明する。
The
処理ロジック14は検索時一致率63を用いて、設定済インデックス情報61及び候補インデックス情報62の項目を、図7の設定済インデックス情報64及び候補インデックス情報65ようにコード化する。図7は、コード化後の設定済インデックス情報及び候補インデックス情報を示す説明図である。図7の設定済インデックス情報64及び候補インデックス情報65の項目は、検索時一致率63に設定されている優先順位と同じ優先順位を表す2桁の数字が設定されている。
The
処理ロジック14は候補インデックス情報65の6つのインデックスの候補毎に、項目の順番を図8の候補インデックス66のように、優先順位を表す2桁の数字の昇順に並び替える。図8は、優先順位に基づいた項目の並び替え後の候補インデックス情報を示す説明図である。
For each of the six index candidates in the candidate index information 65, the
処理ロジック14は、図7の候補インデックス情報65及び図8の候補インデックス情報66の6つのインデックスの候補毎に、項目の順番を比較すると共に、優先順位を表す2桁の数字をチェックし、後述の適正チェックを行う。
The
図7の候補インデックス情報65のインデックスの候補a)は、項目の順番が異なるためインデックスの候補から外される。処理ロジック14はプログラムロジック21の見直すべき内容28として、インデックスの候補a)の項目の順番「生年月日」,「氏名」を抽出する。
The index candidate a) of the candidate index information 65 in FIG. 7 is excluded from the index candidates because the order of the items is different. The
図7の候補インデックス情報65のインデックスの候補b)は、項目の順番が一致するためインデックスの候補に残される。図7の候補インデックス情報65のインデックスの候補c)は、検索キーとして利用しない優先順位を表す2桁の数字「90」が設定された項目「性別」が使用されているためインデックスの候補から項目「性別」が外される。なお、処理ロジック14はプログラムロジック21の見直すべき内容28として、インデックスの候補c)の項目「性別」の除外、検索後の内容チェックでの性別判定を抽出する。
The index candidate b) of the candidate index information 65 in FIG. 7 is left as an index candidate because the order of the items matches. The index candidate c) of the candidate index information 65 in FIG. 7 uses items “gender” set with a two-digit number “90” representing a priority order not used as a search key. “Gender” is removed. The
図7の候補インデックス情報65のインデックスの候補d)は、項目の順番が一致するためインデックスの候補に残される。図7の候補インデックス情報65のインデックスの候補e)は、項目の順番が異なるためインデックスの候補から外される。処理ロジック14はプログラムロジック21の見直すべき内容28として、インデックスの候補e)の項目の順番「住所」,「生年月日」,「氏名」を抽出する。
The index candidates d) of the candidate index information 65 in FIG. 7 are left as index candidates because the order of the items matches. The index candidate e) of the candidate index information 65 in FIG. 7 is excluded from the index candidates because the order of the items is different. The
また、図7の候補インデックス情報65のインデックスの候補f)は、他の項目との重複を許さない優先順位を表す2桁の数字「10」が設定された項目「個人番号」が、他の項目「氏名」と重複して使用されているためインデックスの候補から外される。なお、処理ロジック14はプログラムロジック21の見直すべき内容28として、仕様に根本的な問題がある可能性を抽出する。
Further, the index candidate f) of the candidate index information 65 in FIG. 7 includes an item “personal number” in which a two-digit number “10” representing a priority order not allowing duplication with other items is set. Since it is used redundantly with the item “name”, it is removed from the index candidates. The
図8の候補インデックス情報66は、処理ロジック14による適性チェックにより図9の候補インデックス67となる。図9は、適正チェック後の候補インデックスを示す説明図である。図9の候補インデックス情報67は、インデックスの候補d)がインデックスの候補a)と同じため、インデックスの候補a)に吸収されている。
The
処理ロジック14は設定済インデックス情報64と候補インデックス情報67との突き合わせを行い、図10の候補インデックス情報68及び設定済インデックス情報69のように追加候補のインデックスを決定する。図10は、追加候補のインデックスを決定する処理の説明図である。
The
処理ロジック14は、候補インデックス情報67の5つのインデックスの候補を候補インデックス情報68のように、項目に設定された優先順位で並び替える。また、処理ロジック14は設定済インデックス情報64に定義されているインデックスを設定済インデックス情報69のように、項目に設定された優先順位で並び替える。なお、インデックスの先頭を構成する項目(先頭構成項目)が同一のインデックスが複数ある場合はインデックスを構成する項目の数(構成項目数)が少ない順に並び替え、更に同一の構成項目数である場合、項目に設定された優先順位で並び替える。
The
処理ロジック14は、設定済インデックス情報69に無く、候補インデックス情報68にあるインデックスを追加候補のインデックスとして決定する。図10は、インデックスの候補b),インデックスの候補e)及びインデックスの候補a)が追加候補のインデックスとして決定された例である。
The
処理ロジック14は、インデックスの候補a),インデックスの候補b)及びインデックスの候補e)を追加候補のインデックスとして、図11のような設定予定インデックス情報70を生成する。図11は設定予定インデックス情報の一例を示す説明図である。
The
処理ロジック14は、設定予定インデックス情報70のインデックスが実際に使われる可能性があるか否かの判定を行う。インデックスa)及びインデックスg)は、先頭の項目が重なる他のインデックスが無いため、継続使用される。また、インデックスb),インデックスc)及びインデックスd)は、項目「住所」を先頭構成項目とした何れか1つのインデックスしか使用されないため、検索時一致率で一番有効と判断されるインデックスd)を採用し、インデックスb)及びインデックスc)を削除する。
The
また、インデックスe)及びインデックスf)は、項目「生年月日」を先頭構成項目とした何れか1つのインデックスしか使用されないため、検索時一致率で一番有効と判断されるインデックスf)を採用し、インデックスe)を削除する。 In addition, as index e) and index f), only one index with the item “birth date” as the first constituent item is used, and therefore index f) determined to be the most effective in the matching rate at the time of search is adopted. And delete the index e).
なお、先頭構成項目が同一のインデックス内で先頭構成項目以外の項目がバラバラの場合は、検索時一致率を基に新たなインデックス(全ての項目を網羅したインデックス)を作成する。 When items other than the head configuration item are disjoint within the same index of the first configuration item, a new index (an index covering all items) is created based on the matching rate at the time of search.
データベース定義体更新/再登録を行う処理ロジック15は、処理ロジック14により更新された適正な候補インデックス情報27を利用することで、データベース定義体22の更新/再登録を行う。また、プログラムロジック見直し/再登録を設計者に行わせる処理ロジック16は、処理ロジック14により抽出されたプログラムロジック21の見直すべき内容28を利用することで、プログラムロジック21の見直し/再登録を設計者に行わせるための警告を出力装置2等に表示する。
The
以上、本実施例によれば、DBアクセス時のレスポンス品質を意識しつつ、プログラムロジック21からインデックス(データベース定義体22)を生成することができ、設計者の作業量を増加させることなくデータベースアクセス時のレスポンス品質を確保可能である。
As described above, according to this embodiment, an index (database definition body 22) can be generated from the
本発明は、以下に記載する付記のような構成が考えられる。
(付記1)
データベースの操作を行うプログラムロジックが前記データベースの検索に利用する検索キーを最適化する検索キー最適化装置であって、
前記プログラムロジックから前記データベースの検索に利用する検索キーを1つ以上抽出する第一の検索キー抽出手段と、
既に定義済みの検索キーが定義されているデータベース定義体から前記データベースの検索に利用する検索キーを1つ以上抽出する第二の検索キー抽出手段と、
前記検索キーを構成する前記データベースの項目毎に、検索に利用されるときの優先順位が設定されている優先順位情報を利用して、前記第1の検索キー抽出手段により抽出された前記検索キーの適性チェックを行い、適性チェックが正常終了した前記検索キーにより前記データベース定義体を更新する検索キー適正チェック手段と
を有する検索キー最適化装置。
(付記2)
前記優先順位情報は、前記検索キーを構成する前記データベースの項目毎に、検索に利用されたときのレコードの絞り込みの程度が設定されており、
前記検索キー適正チェック手段は、単一で検索に利用されたときのレコードの絞り込みの程度が大きい項目から小さい項目の順番に、前記検索キーを構成する前記データベースの項目が並んでいるときに適正チェックが正常終了したと判定する付記1記載の検索キー最適化装置。
(付記3)
前記優先順位情報は更に、前記検索キーを構成する前記データベースの項目の内、検索に利用されたときにレコードを一意に絞り込む前記項目と、検索に利用しない前記項目とが設定されており、
前記検索キー適正チェック手段は、検索に利用されたときにレコードを一意に絞り込む前記項目と、検索に利用しない前記項目とを含むように構成される前記検索キーを不適切な検索キーとして抽出する付記2記載の検索キー最適化装置。
(付記4)
前記検索キー適正チェック手段は、不適切な検索キーとして抽出した前記検索キーを表示手段に表示すると共に、前記プログラムロジックを不適切なプログラムロジックとして前記表示手段に表示する付記3記載の検索キー最適化装置。
(付記5)
前記検索キー適正チェック手段は、複数の前記検索キーから、前記検索キーを構成する前記データベースの項目の内、先頭の項目が同じ前記検索キーを抽出し、抽出した前記検索キーから前記優先順位情報に基づき最も優先順位が高い前記検索キー以外を削除する付記1記載の検索キー最適化装置。
(付記6)
データベースの操作を行うプログラムロジックが前記データベースの検索に利用する検索キーを最適化する検索キー最適化装置を、
前記プログラムロジックから前記データベースの検索に利用する検索キーを1つ以上抽出する第一の検索キー抽出手段と、
既に定義済みの検索キーが定義されているデータベース定義体から前記データベースの検索に利用する検索キーを1つ以上抽出する第二の検索キー抽出手段と、
前記検索キーを構成する前記データベースの項目毎に、検索に利用されるときの優先順位が設定されている優先順位情報を利用して、前記第1の検索キー抽出手段により抽出された前記検索キーの適性チェックを行い、適性チェックが正常終了した前記検索キーにより前記データベース定義体を更新する検索キー適正チェック手段と
して機能させる為の検索キー最適化プログラム。
The present invention may have the following configurations as described below.
(Appendix 1)
A search key optimizing device for optimizing a search key used by a program logic for operating a database to search the database,
First search key extracting means for extracting one or more search keys used for searching the database from the program logic;
Second search key extraction means for extracting one or more search keys used for searching the database from a database definition body in which search keys that have already been defined are defined;
The search key extracted by the first search key extraction means using priority order information in which the priority order for use in the search is set for each item of the database constituting the search key A search key optimizing device comprising: a search key adequacy check unit that performs an aptitude check and updates the database definition body with the search key for which the aptitude check has been normally completed.
(Appendix 2)
In the priority information, for each item of the database constituting the search key, the degree of narrowing of records when used for search is set,
The search key appropriateness check means is appropriate when the items of the database constituting the search key are arranged in the order of items from a large item to a small item when a single record is used for search. The search key optimizing device according to
(Appendix 3)
The priority information further includes, among the items of the database constituting the search key, the item for uniquely narrowing down records when used for search, and the item not used for search,
The search key appropriateness check means extracts, as an inappropriate search key, the search key configured to include the item for uniquely narrowing down records when used for search and the item not used for search. The search key optimizing device according to
(Appendix 4)
The search key appropriateness check means displays the search key extracted as an inappropriate search key on a display means, and displays the program logic as an inappropriate program logic on the display means. Device.
(Appendix 5)
The search key appropriateness check means extracts, from the plurality of search keys, the search key having the same first item among the items of the database constituting the search key, and the priority order information from the extracted search key The search key optimizing device according to
(Appendix 6)
A search key optimization device for optimizing a search key used by a program logic for operating a database to search the database,
First search key extracting means for extracting one or more search keys used for searching the database from the program logic;
Second search key extraction means for extracting one or more search keys used for searching the database from a database definition body in which search keys that have already been defined are defined;
The search key extracted by the first search key extraction means using priority order information in which the priority order for use in the search is set for each item of the database constituting the search key A search key optimizing program for functioning as a search key adequacy check means for updating the database definition body with the search key for which aptitude check has been normally completed.
本発明は、具体的に開示された実施例に限定されるものではなく、特許請求の範囲から逸脱することなく、種々の変形や変更が可能である。なお、検索時一致率25の設定は設計者が過去の経験から手動で設定してもよい。
The present invention is not limited to the specifically disclosed embodiments, and various modifications and changes can be made without departing from the scope of the claims. Note that the search
1 入力装置
2 出力装置
3 ドライブ装置
4 補助記憶装置
5 主記憶装置
6 演算処理装置
7 インターフェース装置
8 記録媒体
10 プログラムロジックからのキー情報抽出を行う処理ロジック
11 データベース定義体からのキー情報抽出を行う処理ロジック
12 検索時一致率の設定を行う処理ロジック
13 抽出したキー情報からの過不足チェックを行う処理ロジック
14 抽出したキー情報の適正チェックを行う処理ロジック
15 データベース定義体更新/再登録を行う処理ロジック
16 プログラムロジック見直し/再登録を設計者に行わせる処理ロジック
21 プログラムロジック
22 データベース定義体
23,26,27 候補インデックス情報
24 設定済インデックス情報
25 検索時一致率
28 プログラムロジックの見直すべき内容
29 データベース
30 複合キー構成候補
31 複合キー構成候補項目毎のデータ分布状況
32 複合キー構成候補業務特性
DESCRIPTION OF
Claims (4)
前記プログラムロジックから前記データベースの検索に利用する検索キーを1つ以上抽出する第一の検索キー抽出手段と、
既に定義済みの検索キーが定義されているデータベース定義体から前記データベースの検索に利用する検索キーを1つ以上抽出する第二の検索キー抽出手段と、
前記検索キーを構成する前記データベースの項目毎に、検索に利用されるときのレコードの絞り込みの程度により優先順位が設定されている優先順位情報を利用して、前記第1の検索キー抽出手段により抽出された前記検索キーの適性チェックを行い、単一で検索に利用されたときのレコードの絞り込みの程度が大きい項目から小さい項目の順番に、前記検索キーを構成する前記データベースの項目が並んでいるときに適正チェックが正常終了したと判定し、適性チェックが正常終了した前記検索キーにより前記データベース定義体を更新する検索キー適正チェック手段と
を有する検索キー最適化装置。 A search key optimizing device for optimizing a search key used by a program logic for operating a database to search the database,
First search key extracting means for extracting one or more search keys used for searching the database from the program logic;
Second search key extraction means for extracting one or more search keys used for searching the database from a database definition body in which search keys that have already been defined are defined;
For each item of the database that constitutes the search key, the first search key extraction means uses priority information in which priority is set according to the degree of narrowing of records when used for search. Appropriateness of the extracted search key is checked, and the items of the database constituting the search key are arranged in the order from the item with the highest degree of narrowing down the records when used in a single search. A search key optimizing device comprising: a search key adequacy check unit that determines that the appropriateness check has been normally completed when it is in progress and updates the database definition body with the search key for which the appropriateness check has been normally completed.
前記検索キー適正チェック手段は、検索に利用されたときにレコードを一意に絞り込む前記項目と、検索に利用しない前記項目とを含むように構成される前記検索キーを不適切な検索キーとして抽出する請求項1記載の検索キー最適化装置。 The priority information further includes, among the items of the database constituting the search key, the item for uniquely narrowing down records when used for search, and the item not used for search,
The search key appropriateness check means extracts, as an inappropriate search key, the search key configured to include the item for uniquely narrowing down records when used for search and the item not used for search. The search key optimizing device according to claim 1 .
前記プログラムロジックから前記データベースの検索に利用する検索キーを1つ以上抽出する第一の検索キー抽出手段と、
既に定義済みの検索キーが定義されているデータベース定義体から前記データベースの検索に利用する検索キーを1つ以上抽出する第二の検索キー抽出手段と、
前記検索キーを構成する前記データベースの項目毎に、検索に利用されるときのレコードの絞り込みの程度により優先順位が設定されている優先順位情報を利用して、前記第1の検索キー抽出手段により抽出された前記検索キーの適性チェックを行い、単一で検索に利用されたときのレコードの絞り込みの程度が大きい項目から小さい項目の順番に、前記検索キーを構成する前記データベースの項目が並んでいるときに適正チェックが正常終了したと判定し、適性チェックが正常終了した前記検索キーにより前記データベース定義体を更新する検索キー適正チェック手段と
して機能させる為の検索キー最適化プログラム。 A search key optimization device for optimizing a search key used by a program logic for operating a database to search the database,
First search key extracting means for extracting one or more search keys used for searching the database from the program logic;
Second search key extraction means for extracting one or more search keys used for searching the database from a database definition body in which search keys that have already been defined are defined;
For each item of the database that constitutes the search key, the first search key extraction means uses priority information in which priority is set according to the degree of narrowing of records when used for search. Appropriateness of the extracted search key is checked, and the items of the database constituting the search key are arranged in the order from the item with the highest degree of narrowing down the records when used in a single search. A search key optimizing program for determining that the appropriateness check has been completed normally when it is present and functioning as a search key adequacy check means for updating the database definition with the search key for which the appropriateness check has been completed normally.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008076680A JP5320787B2 (en) | 2008-03-24 | 2008-03-24 | Search key optimization apparatus and search key optimization program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008076680A JP5320787B2 (en) | 2008-03-24 | 2008-03-24 | Search key optimization apparatus and search key optimization program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2009230578A JP2009230578A (en) | 2009-10-08 |
JP5320787B2 true JP5320787B2 (en) | 2013-10-23 |
Family
ID=41245863
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008076680A Active JP5320787B2 (en) | 2008-03-24 | 2008-03-24 | Search key optimization apparatus and search key optimization program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5320787B2 (en) |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH03111974A (en) * | 1989-09-26 | 1991-05-13 | Toshiba Corp | Data base inquiry processing system |
JPH04273534A (en) * | 1991-02-28 | 1992-09-29 | Hokkaido Nippon Denki Software Kk | Precompile system |
GB9526096D0 (en) * | 1995-12-20 | 1996-02-21 | British Telecomm | Specifying indexes for relational databases |
JPH1040089A (en) * | 1996-07-22 | 1998-02-13 | Nec Corp | Method for generating data transfer program |
JPH1063554A (en) * | 1996-08-20 | 1998-03-06 | Mitsubishi Electric Corp | Database constitution information management system |
US7146352B2 (en) * | 2003-06-23 | 2006-12-05 | Microsoft Corporation | Query optimizer system and method |
JP2007265319A (en) * | 2006-03-30 | 2007-10-11 | Hitachi Ltd | Data processing method and device |
-
2008
- 2008-03-24 JP JP2008076680A patent/JP5320787B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2009230578A (en) | 2009-10-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10572236B2 (en) | System and method for updating or modifying an application without manual coding | |
JP5241370B2 (en) | Table classification apparatus, table classification method, and table classification program | |
US7015911B2 (en) | Computer-implemented system and method for report generation | |
US8671084B2 (en) | Updating a data warehouse schema based on changes in an observation model | |
US7886028B2 (en) | Method and system for system migration | |
US20090055418A1 (en) | Automatic cascading copy operations in a database with referential integrity | |
JP4110154B2 (en) | Information processing apparatus, information processing apparatus control method, computer program, and storage medium | |
US8145580B2 (en) | Data management apparatus and method for managing data elements using a plurality of metadata elements | |
CN107710202A (en) | With the primary document of cloud of old Tool integration | |
JP5033322B2 (en) | Information management method and apparatus using connection relation information | |
JP2008123432A (en) | Software asset management system | |
US11176175B1 (en) | System and method for computing and managing datasets using hierarchical analytics | |
JP2007293723A (en) | Database managing system and managing method | |
US20160125001A1 (en) | Automatic screen generation device, automatic screen generation program, and automatic screen generation method | |
US20070016623A1 (en) | Data file editing device for computer systems | |
JP5320787B2 (en) | Search key optimization apparatus and search key optimization program | |
US20100306199A1 (en) | User-defined hierarchical categorization system and method for generating operational metrics | |
US20100138398A1 (en) | Update management apparatus and update management method | |
JP2011243066A (en) | Electronic document management device, display method, display program and record medium | |
JP2009104646A (en) | Database system and data management method | |
JP7246301B2 (en) | Program development support system and program development support method | |
JP2015167005A (en) | Document, validation check, compiler for producing development document, and document-based approval system having the same | |
KR20020045008A (en) | management system for information of drawing and operation method for this system | |
JP2008077285A (en) | Sql management system and sql management method and program | |
JP2007172281A (en) | File management program, file management device and file processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20101119 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20120910 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20120918 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20121116 |
|
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: 20130618 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130701 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5320787 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |