[go: up one dir, main page]

JP3732655B2 - Database management system, database management apparatus, and query processing method - Google Patents

Database management system, database management apparatus, and query processing method Download PDF

Info

Publication number
JP3732655B2
JP3732655B2 JP17440498A JP17440498A JP3732655B2 JP 3732655 B2 JP3732655 B2 JP 3732655B2 JP 17440498 A JP17440498 A JP 17440498A JP 17440498 A JP17440498 A JP 17440498A JP 3732655 B2 JP3732655 B2 JP 3732655B2
Authority
JP
Japan
Prior art keywords
processing unit
arithmetic processing
data
processing
distribution
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
JP17440498A
Other languages
Japanese (ja)
Other versions
JPH10326216A (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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP17440498A priority Critical patent/JP3732655B2/en
Publication of JPH10326216A publication Critical patent/JPH10326216A/en
Application granted granted Critical
Publication of JP3732655B2 publication Critical patent/JP3732655B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Multi Processors (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

【0001】
【産業上の利用分野】
本発明は、データベース処理技術に関し、特に並列データベース処理技術に関する。
【0002】
【従来の技術】
デ−タベ−ス管理システム(以下DBMSと略記)、特に、リレ−ショナルDBMSは、非手続き的な言語で表現された問合せを処理し、内部処理手順を決定し、内部処理手順に従って実行する。このデータベース言語としては、SQLが用いられる(Database Language SQL ISO 9075:1989)。従来の問合せ処理の主な方法には、予め設定した規則に基づいて単一の内部処理手順を決定するものと、各種統計情報を用いて選定された複数の候補処理手順から、コスト評価により、最適と思われるものを決定するものとがある。前者は、処理手順作成のための負荷は小さいけれども、一律に設定された規則の妥当性に問題があり、選ばれた内部処理手順の最適性にも問題がある。後者は、各種統計情報の管理し、複数の候補処理手順の作成し、それらのコスト評価のための負荷を算出して最適な処理手順を与える。上記両者の組合せ技術としては、例えば、Satoh,K.,et.al."Local and Global Optimization Mechanisms for Relational Database", Proc. VLDB, 1985.がある。該従来技術では、問い合わせの条件からデータ量を推定して処理手順を決めている。
【0003】
また、多くのDBMSは、問合せ解析処理と問合せ実行処理との2フェーズの処理を経て、問合せ処理が実現される。ホスト言語(COBOL、PL/I等)に問合せ言語を組み込む場合、当アプリケ−ションプログラム実行前に予め問合せを問合せ解析処理し、実行形式である1つの内部処理手順を作成している。この問合せ表現では、多くの場合、検索条件式にはホスト言語の変数が記述される。この変数に定数が代入されるのは、既に問合せ解析処理された結果の内部処理手順の実行時、すなわち、問合せ実行時である。この場合の問題点としては、変数に代入される値に従って複数の最適な処理手順が考えられることである。この問題を解決するために、問合せ実行処理時に複数の処理手順を作成しておき、問合せ実行時に変数に代入された値に従って処理手順を選択するものがある。コードの技術に関するものとしては、特開平1−194028号公報、および、Graefe,G.,et.al."Dynamic Query Evaluation Plans", Proc. ACM-SIGMOD, 1989.に記載されている技術がある。
【0004】
さらに、CPU性能、ディスク容量の延びを上回るような、トランザクション量の増大、データベース量の増大に対応して、スケーラブルな並列データベースシステムの提供がユーザから望まれている。データベースシステムに対するユーザの性能要件として、数万を超える同時実行ユーザ数への対応、テラバイト単位の検索トランザクションの出現、表サイズに比例しない応答時間の保証がある。並列データベースシステムは、近年のハードウェアコストの低減と相まって、注目を浴びている。並列データベースシステムについては、DeWitt,D.,et.al.:"Parallel Database Systems: The Future of High Performance Database Systems", CACM, Vol.35, No.6, 1992.に記載の技術がある。そのようなシステムでは、密結合あるいは疎結合にプロセッサを接続し、データベース処理を複数のプロセッサに静的/動的に処理を配分し、スケジュールする必要がある。並列度を増せば応答性能は向上するが、過度の並列度は逆にオーバヘッドの増大、他トランザクションの応答時間の延び等の影響がある。そのため、適度な並列度の設定が重要である。
【0005】
デ−タベ−ス処理において、処理対象となるデ−タは、二次記憶装置上に存在し、各デ−タベ−ス演算に対して大量デ−タの読み出しおよび転送が必要となる。並列デ−タベ−スシステムにおいても、転送するデ−タが大量となる場合、デ−タ転送時間がデ−タベ−スシステムの性能ネックとなる。そこで、二次記憶装置からデ−タを転送する時間を有効活用する方法が考えられる。これは、デ−タの転送時間と当該デ−タに対するデ−タベ−ス処理に要する時間とをオ−バラップさせるものであり、従来技術として良く知られている。この方式は、相互結合ネットワークで接続されるプロセッサ群間のデータ転送にも適用可能である。
【0006】
【発明が解決しようとする課題】
上記従来技術において、問合せ最適化処理とは、ユ−ザが入力した問合せからデ−タベ−スシステムの各種統計情報を基にし、最も効率の良い処理手順をDBMSが自動判定するものである。さらに、問合せの選択条件式に変数が埋め込まれている場合には、複数の処理手順を問合せ解析時に展開しておき、問合せ実行時に当変数に代入される値に従って処理手順を選択することによって、最適な処理手順が選択される。
【0007】
従来技術では、データベースへの問い合わせ要求を各プロセッサに分配して並列処理する技術は開示されているが、各プロセッサにおける処理負荷の不均衡を改善する手段は具体的に開示されていない。
【0011】
本発明の目的は、各プロセッサにおける問い合わせ要求処理負荷の不均衡が改善されるように、上記問い合わせ要求処理を各プロセッサへ送付することにある。
【0012】
【課題を解決するための手段】
本発明は、上記課題を解決するために、データベースを構成するデータを格納する記憶手段を備え、読み出し要求に従って、格納されたデータを読み出して出力する格納手段と、入力されたデータベース演算要求にしたがって、前記格納手段から入力されたデータについてデータベース演算処理を実行し、該データベース演算処理結果を出力する複数の演算手段と、入力された問い合わせ要求を解析し、前記問い合わせ要求から得たデータベース演算キーに対するハッシュ関数の評価値に基づいてデータ分配情報を生成し、前記データベース演算要求の対象となるデータを前記データ分配情報に基づいて前記格納手段から複数の前記演算手段に送り、前記データベース演算要求のデータベース演算処理結果を、前記データベース演算要求を送った演算手段から受け取り、前記問い合わせ要求の処理結果を出力する制御手段とを有する。
【0036】
【作用】
本発明の原理について、以下説明する。制御手段では、入力された問い合わせ要求を解析し、問い合わせ要求から得たデータベース演算キーに対するハッシュ関数の評価値に基づいてデータ分配情報を生成し、前記データベース演算要求の対象となるデータを前記データ分配情報に基づいて前記格納手段から複数の前記演算手段に送る。格納手段では、データベースを構成するデータを格納する記憶手段を備え、読み出し要求に従って、格納されたデータを読み出して出力する。演算手段では、入力されたデータベース演算要求にしたがって、格納手段から入力されたデータについてデータベース演算処理を実行し、該データベース演算処理結果を出力する。制御手段は、データベース演算要求のデータベース演算処理結果を、データベース演算要求を送った演算手段から受け取り、問い合わせ要求の処理結果を出力する。
【0048】
【実施例】
以下、本発明の実施例を図面に基づいて詳細に説明する。
【0049】
図2は、本実施例のデ−タベ−スシステムの概念図を示している。図2において、デ−タベ−スシステムは、ユ−ザが作成した、複数のアプリケ−ションプログラム(以下、APと略記する)10および11と、問合せ処理やリソ−ス管理等デ−タベ−スシステム全体の管理を行うDBMS20と、デ−タベ−ス処理において、入出力処理対象となるデ−タの読書きを行い、計算機システム全体の管理を受け持つオペレ−ティングシステム(以下では、オペレ−ティングシステムをOSと略記する)30と、デ−タベ−ス処理対象となるデ−タを格納するデ−タベ−ス40と、データベースの定義情報を管理するディクショナリ50とを有する。DBMS20は、他のデータベース管理システムと接続されている。ディクショナリ50には、本実施例において使用する結合カラムに関する最適化情報なども記憶されている。
【0050】
上記DBMS20は、システム全体の管理、制御に加えて、入出力の管理等を行うシステム制御部21と、問い合わせに関する論理処理を行う論理処理部22と、データベースの物理処理を実行する物理処理部23と、当DBMS20で処理対象となるデータを格納するデータベースバッファ24とを備える。また、論理処理部22は、問合せの構文解析、意味解析を行う問合せ解析220、適切な処理手順を生成する静的最適化処理221、処理手順に対応したコ−ドの生成を行なうコード生成222、静的最適化処理221で生成された処理手順候補から最適なものを選択する動的最適化処理223、および、当コードの解釈実行を行うコード解釈実行部224を備える。また、物理処理部23は、アクセスしたデ−タの条件判定、編集、レコード追加等を実現するデ−タアクセス処理230、データベースレコ−ドの読み書きを制御するデ−タベ−スバッファ制御231、入出力対象となるデ−タの格納位置を管理するマッピング処理232、および、システムで共用するリソースの排他制御を実現する排他制御233を備える。
【0051】
図3は、本発明が適用されるハードウェア構成の一例を示すものである。具体的には、図3は、プロセッサおよびディスク装置が1ノードを構成し、複数のノードを備える並列プロセッサシステムの適用構成例を示している。図3において、プロセッサ60〜65およびディスク装置70〜75が相互結合ネットワーク80で接続される。図3に示すハードウェア構成は、図2に示すデータベースシステムを複数のプロセッサで並列処理するための構成であり、各ノードに対してそれぞれ処理が分散される。
【0052】
上記各ノードごとに機能分散した場合の構成を図1に示す。図1は、本実施例が適用されたデ−タベ−スシステムの概要図を示している。以下に、並列データベースシステムの処理例を図1を参照して説明する。この例では、データベースに対する検索要求に並列処理を適用する。図1において、各ノードは、データを取り出して分配処理するソート機能と、複数のノードでそれぞれソートされたデータを結合処理するマージ機能とが各ノードごとに割り当てられている。ノードによりソート機能だけを備えるものや、ソート機能とマージ機能とを備えるものがある。デ−タベ−スは、ユ−ザから2次元のテ−ブル形式で見られる表から成るものとし、当該表は行あるいはロウごとにデータが存在するものである。また、ロウは、1つ以上の属性(これを「カラム」という)からなる。図1においては、データベースの表としてT1およびT2があり、ノード1(90)からノード4(91)に表T1が、ノード5(92)からノード8(93)に表T2が各々格納されており、これらの各ノードが分配ノードであり、分配ノードにおいて格納している表に基づいてデータ取り出し処理およびデータ分配処理が実行される。また、ノード9(94)からノード11(96)は、結合ノードであり、ノード1〜4およびノード5〜8から出力されるデータを受け取り、部分列ソート処理およびマージ処理をして完全列の作成を実行する。さらに、ノード12(97)は、問い合わせを受け付け、該問い合わせを解析し、問い合わせに対する処理を実行する分配ノードおよび結合ノードの数を決定する決定ノードである。また、ノード12(97)は、ノード9〜11から出力されたデータを受け取り出力する。これらのノード群は、相互結合ネットワーク80で接続され、ノード1〜4およびノード5〜8と、ノード9〜11とが並列に動作し、しかもノード1〜4およびノード5〜8でそれぞれ処理された結果は、すぐにノード9〜11で処理を行うというようなパイプライン的に動作する(以下、並列パイプライン動作と呼ぶ)。また、ノード9〜11とノード12とも同様にパイプライン動作する。以下では、ノード9〜11における部分列ソート処理をスロットソート処理といい、完全列作成処理をNウェイマージ処理と呼ぶ。スロットソート処理は、データが格納されるページを対象とするページ内のソート処理を指し、スロット順に読みだせば昇順にロウがアクセス可能とする。Nウェイマージ処理は、Nウェイのバッファを用いて、各マージ段でN本のソート連を入力にして最終的に1本のソート連を作成する。
【0053】
データベース検索処理のための問合せは、例えば、以下のようになる。
【0054】
SELECT T1.C3,T2.C3
FROM T1,T2
WHERE T1.C1=T2.C1
AND T1.C2=?
このような問い合わせが、ノード12において受け付けられると、ノード12において、最適な分配処理方法が選択され、各ノードに対してネットワークを介して指示される。上記の問い合わせにおいては、ノード1(90)からノード4(91)に表T1が、ノード5(92)からノード8(93)に表T2が各々格納されているので、各ノードにおいてデータ取り出し処理およびデータ分配処理が実行される。また、ノード9(94)からノード11(96)では、ノード1〜4およびノード5〜8から出力されるデータを逐次受け取り、ソート処理および結合処理を実行する。ノード12(97)では、ノード9〜11から出力されたデータを受け取り出力する。これによりデータベース検索は終了する。
【0055】
つぎに、上記各ノードの処理時間の関係について図4を参照して説明する。図4は、並列パイプライン動作を説明するための概要図を示す。図4において、100および101は、図1におけるノード1(90)からノード4(91)と、ノード5(92)からノード8(93)とにおける処理に対応し、データ取り出し処理およびデータ配分処理を実行する。110および111は、ノード9(94)からノード11(96)における処理に対応し、スロットソート処理、Nウェイマージ処理、突き合わせ処理が実行される。120は、ノード12(97)における処理に対応し、要求データ出力処理が実行される。時間軸に沿えば、データ取り出し処理およびデータ配分処理100および101で処理されたデータは、逐次スロットソート処理110および111に移り、パイプライン的に実行される。データ取り出し処理からスロットソート処理までを取り出しフェーズと呼ぶ。また、Nウェイマージ処理110および111は、それぞれのノードで単に並列に実行される。このNウェイマージ処理期間をマージフェーズと呼ぶ。さらに、突き合わせ処理の結果は要求データ出力処理120に逐次転送されてパイプライン的に実行される。この突き合わせから要求データ出力までを結合フェーズと呼ぶ。図4に示すタイムチャートは、図1に示す問合せ例を適用した場合の処理内容である。取り出しフェーズにおいて、ノード1(90)からノード4(91)における処理時間は、T1データ取り出し/データ分配処理時間130として示す。また、ノード5(92)からノード8(93)における処理時間は、T2データ取り出し/データ分配処理時間131で示し、相互結合ネットワーク80における転送時間をデータ分配転送時間140で示し、ノード9(94)からノード11(96)における処理時間は、T1/T2スロットソート処理時間150に示すように、各々実行される。図4において、取り出しフェーズは、スロットソート処理完了待ち合わせ180の時点までで終了する。また、マージフェーズにおいて、ノード9(94)からノード11(96)における処理時間は、T1/T2Nウェイマージ処理時間151に示す時間において実行される。このマージフェーズは、T1/T2Nウェイマージ処理待ち合わせ181までで終了する。結合フェーズは、ノード9(94)からノード11(96)における処理時間は、突き合わせ処理時間152で示し、相互結合ネットワーク80における処理時間は、結合結果転送時間160で示し、ノード12(97)における処理時間は、要求データ出力処理時間170で示し、各々その時間内に実行される。
【0056】
つぎに、図1におけるノード12の各ノード群への処理の振り分け方法について図5を参照して説明する。図5は、データ分配処理における各ノード群への振り分け方法を示す説明図である。前提として、データ取り出し/データ分配処理をするノード群は、プロセッサ200〜230とディスク装置201〜231とを備えるノード1〜10の10台からなる。また、結合処理をするノード群は、プロセッサ240〜250とディスク装置241〜251とを備えるノード11〜15の5台からなるとする。ディクショナリ50には、結合カラムに関する最適化情報51が格納されていている。該最適化情報51とは、データベースのデータを均等に分割するための情報であり、例えば、結合カラムに対するデータ件数は通常均一でないので、データ件数が均一になるように結合カラムで分割するようにするものである。図5に示すように、ノード1〜10に格納されているデータが、v1からv10の各分割範囲で均等にデータ分割可能であることを示す。この場合、ノード11〜15に均等にデータ分割するためにはv1〜v2、v3〜v4、v5〜v6、v7〜v8、v9〜v10の5区間にそれぞれノード番号11、12、13、14、15を対応付けるような分配処理手段を備えればよい。上記最適化情報が存在しない場合、適当なハッシュ関数を設定してデータ分配を行なえばよい。このようにして、図1におけるノード12では、分配処理手段を備えることにより、Nウェイマージ処理を行う際の各ノード群への処理の振り分けを行う。これにより、上記のような場合には、ノード11〜15に均等にデータ分割することができ、処理時間が均等になる。
【0057】
つぎに、Nウェイマージ処理を行う際の結合ノード数の決定方法について図6を参照して説明する。図6は、結合ノード数決定方法を説明するための概要図を示している。
【0058】
図1における並列結合処理の各フェーズ、各処理の処理時間をグラフ化し、図4に示す並列パイプライン動作概要に合わせてレイアウトしている。図6において、データ取り出し/データ分配処理が、ノード1〜8で実行され、300〜305の処理時間がそれぞれかかるものとする。ここでは、ノード5の処理時間304が最大処理時間であるとする。スロットソート処理時間は、結合処理ノード数Nと、予め決められたシステム特性(CPU性能、ディスク装置性能等)と、データベース演算方法とから導けることができ、スロットソート処理の性能特性は一般的に下記に示すような式で求めることができる。
【0059】
【数1】
E=a/N+b*N+c
パイプライン処理を行う際の効果を最大にするために、スロットソート処理の性能特性と最大処理時間304との交点となる結合ノード割当て数350をノード数として求めることができる。結合ノード割当て数350が決まると、Nウェイマージ処理時間320および突き合わせ処理時間330が、Nウェイマージ処理の性能特性と突き合わせ処理の性能特性とから同様に推定できる。これらの処理時間の合計が問い合わせに対する全体の処理時間となる。このように結合ノード数を決定し、データ取り出し/データ分配処理において分配されたデータを逐次マージして同時に処理することにより、全体の処理時間(問い合わせをしてから出力されるまでの応答時間)を短縮することができる。
【0060】
結合ノード数を決定する場合に用いられる性能特性の具体例を以下に示しておく。例えば、ロウ数が表T1および表T2とも10、000、000件あり、条件数がT1−1コ(全体ロウが1%に絞られる)とし、データ取り出し/データ分配処理をする分配ノード数が表T1および表T2ともそれぞれ16ノードで均等分割され、結合ノード数が8ノードで、プロセッサ性能が50MIPS(1秒間に5千万命令実行)で、ネットワーク転送レートが20Mバイト/秒であるとする。このような条件で実際のデータベース管理システムに処理させた結果もしくは性能モデルから算出した結果が以下のようになる。
【0061】
表T1および表T2の分配ノードの処理時間がそれぞれ180秒、T1/T2スロットソート処理時間が80秒、Nウェイマージ処理時間が380秒、突き合わせ処理時間が110秒、要求データ出力時間が10秒となる。これらの結果の処理性能に基づいて問い合わせに対する処理時間を推定する。
【0062】
つぎに、図6に示した結合ノード数決定方法を基にして、応答時間をさらに短縮するための処理時間調整方法(チューニング方法)について、図7、図8および図9を参照して説明する。以下に示す方法は、上記ノード12の分配処理手段において、各ノード群への処理の振り分けを決定する際にあらかじめ算出されて、その結果より振り分けを決定するものである。
【0063】
図7は、スロットソート前処理化の概要図を示す。データ取り出し/データ分配処理が、ノード1〜8で実行され、各300〜305の処理時間がそれぞれかかるものとする。ノードごとの処理時間には各表のデータ数によりバラツキが存在する。また、スロットソート処理は、結合処理ノード群で実行されるように設定されている。ノードごとの処理時間でバラツキがある場合には、データ取り出し/データ分配処理ノード群へスロットソート処理を移す処理手順を考える。図7に、スロットソートの前処理化として示すように、データ取り出し/データ分配処理がより早く終了したノードでスロットソート処理を行う。その処理によれば、結合ノード割当て数350のノードにおけるスロットソート処理時間が310から312に削減できる。その処理時間の差311においてNウェイマージ処理を移す。これは、スロットソート処理の連長を延ばすことにほかならない。これによって、Nウェイマージ処理時間が削減でき、結果的に応答時間が削減できる。
【0064】
図8は、スロットソート連長チューニング概要図を示している。例えば処理時間の制約があったときなどのように、その時間内で複数の処理を行う場合において、各ノードで実行する各データベース演算をパラメータ化し、期待する処理時間に基づいて時間調整(チューニング)をする方法について説明する。図6で求まる結合ノード割当て数350から最小限だけ結合処理ノードを増やし、応答時間の短縮を図る。この場合の結合ノード割当て数を351とする。結合ノード割当て数351とすると、スロットソート処理時間は310から312へ削減される。パイプライン効果を最大にするため、処理時間311においてNウェイマージ処理をスロットソート処理へ移す。これによって、Nウェイマージ処理のマージ回数が減り、処理時間が320と削減でき、結果的に応答時間が削減できる。
【0065】
図9は、Nウェイマージ回数チューニングの概要図を示す。結合ノード割当て数350で決まる突き合わせ処理時間330が要求データ出力処理時間340より小である場合には、Nウェイマージ処理の最終段のマージ処理を突き合わせ処理に移すようにできる。Nウェイマージ処理の最終段のマージ処理時間331と突き合わせ処理時間330との和が要求データ出力処理時間340を上回らなければ、当最終段のマージ処理を突き合わせ処理へ移す。これによって、応答時間が削減できる。
【0066】
つぎに、本実施例におけるデータベース管理システムの動作フローを説明する。図10、図11、図12、図13、図14および図15は、本実施例におけるDBMSの処理のフロ−チャ−トを示す。図10において、DBMSは、問合せ実行前に行われる問合せの解析処理(ステップ220)、静的最適化処理(ステップ221)およびコード生成(ステップ222)により問い合わせ解析を行う問合せ解析処理400と、変数に定数を代入し、処理手順を選択する動的最適化処理(ステップ223)および問合せのコード解釈実行(ステップ224)により問い合わせに対する実行処理を行う問合せ実行処理410とを行う。
【0067】
以下、各処理部の概要について述べる。
【0068】
(a)問合せ解析処理400
図10(a)および(c)において、問合せ解析(ステップ220)では、上記ノード12においてアプリケーションプログラムにより入力された問合せ文の構文解析、意味解析を実行する(ステップ2200)。図10(a)において静的最適化処理(ステップ221)では、上記ノード12において問合せで出現する条件式から条件を満足するデ−タの割合を推定し、予め設定している規則を基に、有効なアクセスパス候補(特にインデクスを選出する)を作成し、処理手順の候補を作成する。コード生成(ステップ222)では、上記ノード12において処理手順候補を実行形式に展開する。
【0069】
(b)問合せ実行処理410
図10(b)において、動的実行時最適化(ステップ223)では、上記ノード12において代入された定数に基づき、各ノード群で実行する処理手順を決定する。コード解釈実行(ステップ224)では、それぞれのノードにおいて処理手順を解釈し、実行する。
【0070】
つぎに、各処理部の詳細な処理フローの説明を行う。
【0071】
図10(d)において、動的最適化処理(ステップ221)では、問合せに出現する条件式の述語選択率推定し(ステップ2210)、インデクス等からなるアクセスパスの剪定をし(ステップ2211)、これらアクセスパスを組合せた処理手順候補の生成をする(ステップ2212)。
【0072】
図10(e)において、述語選択率推定(ステップ2210)では、問合せ条件式に変数が出現するか否かチェックする(ステップ22101)。変数が出現すれば、当条件式にカラム値分布情報があるかチェックする(ステップ22104)。存在すれば終了する。存在しなければ、条件式の種別に応じてディフォルト値を設定し(ステップ22105)、終了する。変数が出現しなければ、当条件式にカラム値分布情報があるかチェックする(ステップ22104)。存在しなければ、条件式の種別に応じてディフォルト値を設定し(ステップ22105)、終了する。存在すれば、カラム値分布情報を用いて選択率を算出する(ステップ22103)。
【0073】
図11において、アクセスパス剪定2212では、問合せ条件式で出現するカラムのインデクスをアクセスパス候補として登録する(ステップ22120)。つぎに、問合せでアクセス対象となる表が複数ノードに分割格納されているかチェックする(ステップ22121)。分割格納されていれば、パラレルテーブルスキャンをアクセスパス候補として登録する(ステップ22123)。分割格納されていなければ、テ−ブルスキャンをアクセスパス候補として登録する(ステップ22123)。各条件式の選択率が既に設定済みか否かチェックする(ステップ22124)。設定済みであれば、各表に関して選択率が最小となる条件式のインデクスをアクセスパスの最優先度とする(ステップ22125)。設定済みでなければ、各条件式の選択率の最大値/最小値を取得する(ステップ22126)。最後に、CPU性能、IO性能等のシステム特性より各アクセスパスの選択基準を算出し(ステップ22127)、単一あるいは複数のインデクスを組合せたアクセスパスでの選択率が上記選択基準を下回るものだけアクセスパス候補として登録する(ステップ22128)。
【0074】
図12において、処理手順候補生成2213は、問合せでアクセス対象となる表が複数ノードに分割格納されているかチェックする(ステップ22130)。分割格納されていれば、ステップ22135へ移行する。分割格納されていなければ、処理手順候補にソート処理が含まれているか否かをチェックする(ステップ22131)。含まれていれば、ステップ22135へ移行する。含まれていなければ、問合せでアクセス対象となる表のアクセスパスが唯一であるかチェックし(ステップ22132)、唯一であれば単一の処理手順を作成し(ステップ22133)、唯一でなければ複数の処理手順を作成し(ステップ22134)、終了する。ステップ22135では、結合可能な2ウェイ結合へ問合せを分解する。分割格納される表の格納ノード群に対応して、データ読みだし/データ分配処理手順を候補として登録する。また、スロットソート処理手順を候補として登録する(ステップ22136)。結合処理ノード群に対応して、スロットソート処理手順、Nウェイマージ処理手順および突き合わせ処理手順を候補として登録し、スロットソート連長およびマージ処理回数をパラメタ化しておく(ステップ22137)。要求データ出力ノードに要求データ出力処理手順を登録する(ステップ22138)。最後に、分解結果に対して評価がすべて終了すれば(ステップ22139)、終了する。
【0075】
図13において、コード生成222は、処理手順候補が唯一か否かをチェックする(ステップ2220)。唯一であれば、ステップ2223へ移行する。唯一でなければ、カラム値分布情報等からなる最適化情報を処理手順に埋込み(ステップ2221)、問合せ実行時に代入された定数に基づいて処理手順を選択するデータ構造を作成する(ステップ2222)。最後に、処理手順を実行形式へ展開する(ステップ2223)。
【0076】
図14において、動的最適化処理223は、作成されている処理手順が単一か否かをチェックする(ステップ22300)。単一であれば、終了する。単一でなければ、代入された定数を基に選択率を算出する(ステップ22301)。処理手順候補に並列な処理手順が含まれるか否かチェックする(ステップ22302)。含まれていなければ、アクセスパスの選択基準に従って処理手順を選択し(ステップ22313)、終了する。含まれていれば、ディクショナリから最適化情報(結合カラムのカラム値分布情報、アクセス対象となる表のロウ数、ページ数等)を入力し(ステップ22303)、データ取り出し/データ分配のための処理時間を各システム特性を考慮し、前述したように算出する(ステップ22304)。当処理時間から結合処理に割当てるノード数pを決定し、当処理手順a1を決定する(ステップ22305)。データ取り出し/データ分配処理時間にバラツキがあるか否かをチェックする(ステップ22306)。バラツキがあれば、データ取り出し/データ分配処理ノード群でスロットソート処理を実行する処理手順a2を設定する(ステップ22307)。つぎに、結合ノード割当て数pをα台だけ増した処理手順a3を設定する(ステップ22308)。要求データ処理時間が突き合わせ処理時間と1回分のNウェイマージ処理時間との和より大であれば(ステップ22309)、突き合わせ処理へ1回分のNウェイマージ処理を移した処理手順a4を設定する(ステップ22310)。処理手順a1〜a4で最適な処理手順を応答時間最小、各ノード負荷量最小、他トランザクション応答性能への影響小等の観点で選択する(ステップ22311)。データ分配情報を最適化情報を基にして作成する(ステップ22312)。最適化情報がなければ、ハッシュ関数の結合カラム評価値に従い、データ分配情報を作成する。アクセスパスの選択基準に従って処理手順を選択し(ステップ22313)、終了する。
【0077】
図15において、コード解釈実行処理224では、設定された各ノードにおいてそれぞれ対応する処理手順にしたがって処理を行う。
【0078】
まず、各ノードでは、データ取り出し/データ分配処理が設定されているか否かを判断する(ステップ22400)。データ取り出し/データ分配処理が設定されていれば、各ノードの記憶装置に格納されているデータベースにアクセスし、条件式を評価する(ステップ22401)。最適化情報を基に作成されたデータ分配情報に基づいて、データを取り出し、各結合ノードのバッファへ逐次データを分配する(ステップ22402)。各結合ノードのバッファが満杯か否かを判定し、満杯であれば、ページ形式で対応する結合ノードへ転送する。問い合わせに対応する全てのデータを取り出して分配すると処理が終了する(ステップ22404)。
【0079】
また、各ノードでは、スロットソート処理が設定されているか否かを判断する(ステップ22405)。スロットソート処理が設定されていれば、前記データ取り出し/データ分配処理ノードからのページ形式のデータを受信し、(ステップ22406)受信したデータについて順次スロットソート処理を行う(ステップ22407)。処理したスロットソート結果を一時保存しておき、スロットソート処理を終了する(ステップ22408)。
【0080】
また、Nウェイマージ処理が設定されているか否かを判断する(ステップ22409)。Nウェイマージ処理が設定されていれば、スロットソート結果に基づいてNウェイマージ処理を実行し(ステップ22410)、Nウェイマージ処理結果をバッファなどに一時保存し(ステップ22411)、Nウェイマージ処理を終了する。
【0081】
また、突き合わせ処理が設定されているか否かを判断する(ステップ22412)。突き合わせ処理が設定されていれば、Nウェイマージ処理結果のソートリストを突き合わせ、出力用バッファにデータを設定する(ステップ22413)。出力用バッファが満杯の場合には、ページ形式で要求データ出力ノードへ転送する(ステップ22415)。
【0082】
また、要求データ出力処理が設定されているか否かを判断する(ステップ22416)。要求データ出力処理が設定されていれば、結合ノードからページ形式のデータの転送があるかないかを判断する(ステップ22417)。ページ形式のデータの転送がある場合には、該ページ形式のデータを受信し(ステップ22418)、アプリケーションプログラムへ問い合わせ処理結果を出力し、ページ形式のデータ転送がない場合にはそのまま問い合わせ処理結果を出力する(ステップ22419)。
【0083】
また、上記コード解釈実行処理において、処理時間にバラツキがある場合などのときにデータ取り出し/データ分配処理ノード群でスロットソート処理を実行する場合には、データ取り出し/データ分配処理終了後、コード解釈実行処理224を再度実行し、スロットソート処理を行うようにする。
【0084】
さらに、ステップ22413でNウェイマージ処理結果が完全ソート列でなければ、最終段のマージと突き合わせ処理とを行う。
【0085】
以上のように処理することによりデータベース管理システムの問い合わせ応答時間を短縮することができる。
【0086】
図6に示す結合ノード割当て方法と、図7、図8および図9に示すチューニング方法とは、各々独立に適用してもよいし、また任意の組合せで適用してもよい。すなわち、動的最適化処理223では、すべての組合せが適用できる場合を想定している。さらに、データ取り出し処理においては、複数ディスク装置からなる並列入出力アクセス方法の適用と、一括入出力方法/先読み入出力方法の適用と、データ分配処理に最適化情報あるいはハッシュ関数によるデータ分配方法の適用と、Nウェイマージ処理に並列ソート方法の適用と、突き合わせ処理にノード間での突き合わせ処理方法の適用と、要求データ出力処理に複数のノードを割当て並列受け取り処理方法の適用等も考えられる。上記ステップ22309およびステップ22310では、1回分のNウェイマージ処理を仮定しているが、一般的にn回(n≧1)としてもよい。
【0087】
図4に示す並列パイプライン動作に関して、上記図6に示した結合ノード割当て方法と、図7、図8および図9に示すチューニング方法とを適用すると、取り出しフェーズ、マージフェーズ、結合フェーズの内、マージフェーズが省略可能となる場合も存在する。すなわち、スロットソート連長の延び、Nウェイマージ処理の移動により可能となる。この場合、問合せ実行処理でもマージフェーズの処理を省略する。
【0088】
本発明の問合せ処理方法は、統計情報を用いた規則とコスト評価との併用に限らず、適当なデ−タベ−ス参照特性情報を与える処理手順が得られるものであれば適用できる。例えば、コスト評価のみ、規則利用のみ、コスト評価と規則利用の併用等の最適化処理を行うDBMSにも適用できる。
【0089】
本発明は、密結合/疎結合マルチプロセッサシステム大型計算機のソフトウェアシステムを介して実現することも、また、各処理部のために専用プロセッサが用意された密結合/疎結合複合プロセッサシステムを介して実現することも可能である。また、単一プロセッサシステムでも、各処理手順のために並列なプロセスを割当てていれば、適用可能である。
【0090】
本実施例によれば、各ノードで実行するデータベース演算に対応して各ノード数を決定し、また、データの分割にバラツキが存在する場合、各ノードへデータを均等に分割させ、各ノードで実行する各データベース演算をパラメタ化し、期待する処理時間均等化させるので、各ノード間で処理時間の偏りがなく、円滑にパイプライン動作させることが可能となり、高速な問合せ処理が実現可能となる。
【0091】
【発明の効果】
本発明によれば、問い合わせ要求から得たデータベース演算キーに対するハッシュ関数の評価値に基づいてデータ分配情報を生成し、前記データベース演算要求の対象となるデータを前記データ分配情報に基づいて前記格納手段から複数の前記演算手段に送ることで、前記プロセッサにおける負荷の不均衡を軽減することができる。
【図面の簡単な説明】
【図1】 並列結合処理概要図
【図2】 データベースシステムの構成図
【図3】 ハードウェア構成図
【図4】 並列パイプライン動作の概要図
【図5】 データ分配処理概要図
【図6】 結合ノード割当て概要図
【図7】 スロットソート前処理化概要図
【図8】 スロットソート連長チューニング概要図
【図9】 Nウェイマージ回数チューニング概要図
【図10】 データベース管理システムのフローチャート
【図11】 データベース管理システムのフローチャート
【図12】 データベース管理システムのフローチャート
【図13】 データベース管理システムのフローチャート
【図14】 データベース管理システムのフローチャート
【図15】 データベース管理システムのフローチャート
【符号の説明】
10、11…アプリケーションプログラム、20…データベース管理システム、22…論理処理部、220…問合せ解析、221…静的最適化処理、222…コード生成、223…動的最適化処理、224…コード解釈実行、30…オペレーティングシステム、40…データベース、50…ディクショナリ、80…相互結合ネットワーク、90、91、92、93、94、95、96、97…ノード。
[0001]
[Industrial application fields]
The present invention relates to database processing technology, and in particular,Parallel database processing technologyAbout.
[0002]
[Prior art]
A database management system (hereinafter abbreviated as DBMS), in particular, a relational DBMS processes a query expressed in a non-procedural language, determines an internal processing procedure, and executes it according to the internal processing procedure. SQL is used as this database language (Database Language SQL ISO 9075: 1989). The main methods of conventional query processing include determining a single internal processing procedure based on preset rules and a plurality of candidate processing procedures selected using various statistical information, by cost evaluation, Some determine what seems to be optimal. In the former case, although the load for creating the processing procedure is small, there is a problem in the validity of the uniformly set rule, and there is also a problem in the optimality of the selected internal processing procedure. The latter manages various statistical information, creates a plurality of candidate processing procedures, calculates a load for cost evaluation thereof, and gives an optimal processing procedure. As a combination technique of the above, there is, for example, Satoh, K., et.al. “Local and Global Optimization Mechanisms for Relational Database”, Proc. VLDB, 1985. In the prior art, the processing procedure is determined by estimating the amount of data from the inquiry conditions.
[0003]
In addition, in many DBMSs, query processing is realized through two-phase processing of query analysis processing and query execution processing. When a query language is incorporated into a host language (COBOL, PL / I, etc.), the query is subjected to query analysis processing in advance before executing the application program, and one internal processing procedure that is an execution format is created. In this query expression, a host language variable is often described in the search condition expression. A constant is assigned to this variable when an internal processing procedure that has already been subjected to a query analysis process is executed, that is, when a query is executed. The problem in this case is that a plurality of optimum processing procedures can be considered according to the value substituted for the variable. In order to solve this problem, there is a method in which a plurality of processing procedures are created at the time of query execution processing, and processing procedures are selected according to values assigned to variables at the time of query execution. As for the code technology, there are technologies described in Japanese Patent Application Laid-Open No. 1-194028 and Graefe, G., et.al. “Dynamic Query Evaluation Plans”, Proc. ACM-SIGMOD, 1989. .
[0004]
Furthermore, it is desired by users to provide a scalable parallel database system in response to an increase in transaction volume and an increase in database volume that exceed the increase in CPU performance and disk capacity. User performance requirements for a database system include support for tens of thousands of concurrent users, the appearance of terabyte-based search transactions, and guaranteed response times that are not proportional to the table size. Parallel database systems are attracting attention, coupled with recent reductions in hardware costs. Regarding the parallel database system, there is a technique described in DeWitt, D., et.al .: “Parallel Database Systems: The Future of High Performance Database Systems”, CACM, Vol. 35, No. 6, 1992. In such a system, it is necessary to connect a processor in a tightly coupled or loosely coupled manner, and to allocate and schedule database processing to a plurality of processors statically / dynamically. If the degree of parallelism is increased, the response performance is improved. However, an excessive degree of parallelism is adversely affected by an increase in overhead and an increase in the response time of other transactions. Therefore, setting an appropriate degree of parallelism is important.
[0005]
In the database processing, the data to be processed exists on the secondary storage device, and it is necessary to read and transfer a large amount of data for each database operation. Even in a parallel database system, when a large amount of data is transferred, the data transfer time becomes a performance bottleneck of the database system. Therefore, a method of effectively utilizing the time for transferring data from the secondary storage device can be considered. This overlaps the data transfer time and the time required for the database processing for the data, and is well known in the prior art. This method can also be applied to data transfer between processor groups connected by an interconnection network.
[0006]
[Problems to be solved by the invention]
In the above prior art, the query optimization process is one in which the DBMS automatically determines the most efficient processing procedure based on various statistical information of the database system from the query input by the user. Furthermore, when a variable is embedded in the query selection conditional expression, multiple processing steps are expanded at the time of query analysis, and by selecting the processing procedure according to the value assigned to this variable at the time of query execution, The optimal processing procedure is selected.
[0007]
In the prior art, a technique for distributing a query request to a database to each processor and performing parallel processing is disclosed, but means for improving an imbalance in processing load in each processor is not specifically disclosed.
[0011]
The purpose of the present invention is toThe inquiry request processing is sent to each processor so that the imbalance of the inquiry request processing load in each processor is improved.There is.
[0012]
[Means for Solving the Problems]
In order to solve the above-mentioned problems, the present invention comprises a storage means for storing data constituting a database, and according to a read request, a storage means for reading out and outputting the stored data, and an input database operation request , Executing a database operation process on the data input from the storage unit, outputting a result of the database operation process, analyzing the input inquiry request, and obtaining the inquiry requestData distribution information is generated based on the evaluation value of the hash function for the database calculation key, and the data to be subjected to the database calculation request is sent from the storage unit to the plurality of calculation units based on the data distribution information,Control means for receiving the database operation processing result of the database operation request from the operation means that has sent the database operation request, and outputting the processing result of the inquiry request.
[0036]
[Action]
The principle of the present invention will be described below. The control means analyzes the input inquiry request and obtains it from the inquiry request.Data distribution information is generated based on the evaluation value of the hash function with respect to the database operation key, and data to be subjected to the database operation request is sent from the storage unit to the plurality of operation units based on the data distribution information.The storage means includes storage means for storing data constituting the database, and reads and outputs the stored data in accordance with a read request. The calculation means executes database calculation processing on the data input from the storage means in accordance with the input database calculation request, and outputs the database calculation processing result. The control means receives the database operation processing result of the database operation request from the operation means that sent the database operation request, and outputs the processing result of the inquiry request.
[0048]
【Example】
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[0049]
FIG. 2 shows a conceptual diagram of the database system of this embodiment. In FIG. 2, the database system includes a plurality of application programs (hereinafter abbreviated as AP) 10 and 11 created by the user, and a database such as query processing and resource management. The DBMS 20 that manages the entire system and the operating system (hereinafter referred to as the operating system) that reads and writes the data to be input / output processed in the database processing and is responsible for the management of the entire computer system. (The operating system is abbreviated as OS) 30, a database 40 for storing data to be subjected to database processing, and a dictionary 50 for managing database definition information. The DBMS 20 is connected to another database management system. The dictionary 50 also stores optimization information related to the join columns used in this embodiment.
[0050]
The DBMS 20 includes a system control unit 21 that performs input / output management in addition to management and control of the entire system, a logical processing unit 22 that performs logical processing related to an inquiry, and a physical processing unit 23 that executes physical processing of a database. And a database buffer 24 for storing data to be processed by the DBMS 20. The logic processing unit 22 also includes a query analysis 220 that performs query syntax analysis and semantic analysis, a static optimization process 221 that generates an appropriate processing procedure, and a code generation 222 that generates code corresponding to the processing procedure. A dynamic optimization process 223 for selecting an optimal process procedure candidate generated in the static optimization process 221 and a code interpretation execution unit 224 for interpreting and executing the code. In addition, the physical processing unit 23 includes a data access process 230 that realizes condition determination, editing, and record addition of the accessed data, a database buffer control 231 that controls reading and writing of database records, an input A mapping process 232 for managing the storage location of data to be output and an exclusive control 233 for realizing exclusive control of resources shared by the system are provided.
[0051]
FIG. 3 shows an example of a hardware configuration to which the present invention is applied. Specifically, FIG. 3 shows an application configuration example of a parallel processor system in which a processor and a disk device constitute one node and a plurality of nodes. In FIG. 3, processors 60 to 65 and disk devices 70 to 75 are connected by an interconnection network 80. The hardware configuration shown in FIG. 3 is a configuration for parallel processing of the database system shown in FIG. 2 by a plurality of processors, and the processing is distributed to each node.
[0052]
FIG. 1 shows a configuration when the functions are distributed for each of the above nodes. FIG. 1 shows a schematic diagram of a database system to which this embodiment is applied. Hereinafter, a processing example of the parallel database system will be described with reference to FIG. In this example, parallel processing is applied to a search request for a database. In FIG. 1, each node is assigned to each node a sorting function for extracting and distributing data and a merging function for combining data sorted by a plurality of nodes. Some nodes have only a sort function, and others have a sort function and a merge function. The database consists of a table that can be viewed by the user in a two-dimensional table format, and the table has data for each row or row. A row is composed of one or more attributes (this is referred to as “column”). In FIG. 1, there are T1 and T2 as database tables. Table T1 is stored from node 1 (90) to node 4 (91), and table T2 is stored from node 5 (92) to node 8 (93). Each of these nodes is a distribution node, and data extraction processing and data distribution processing are executed based on a table stored in the distribution node. Nodes 9 (94) to 11 (96) are combined nodes, receive data output from nodes 1 to 4 and 5 to 8, and perform partial column sort processing and merge processing to complete columns. Execute creation. Further, the node 12 (97) is a decision node that receives an inquiry, analyzes the inquiry, and determines the number of distribution nodes and combination nodes that execute processing for the inquiry. The node 12 (97) receives and outputs the data output from the nodes 9-11. These node groups are connected by an interconnection network 80. Nodes 1 to 4 and nodes 5 to 8 and nodes 9 to 11 operate in parallel and are processed by nodes 1 to 4 and nodes 5 to 8, respectively. The result is a pipeline operation in which processing is immediately performed in the nodes 9 to 11 (hereinafter referred to as a parallel pipeline operation). Similarly, the nodes 9 to 11 and the node 12 perform the pipeline operation. Hereinafter, the partial column sorting process in the nodes 9 to 11 is referred to as a slot sort process, and the complete column creation process is referred to as an N-way merge process. The slot sort process refers to a sort process within a page that targets a page in which data is stored. If reading is performed in the slot order, rows can be accessed in ascending order. The N-way merge process uses an N-way buffer to input N sort sequences at each merge stage and finally create one sort sequence.
[0053]
A query for database search processing is, for example, as follows.
[0054]
SELECT T1. C3, T2. C3
FROM T1, T2
WHERE T1. C1 = T2. C1
AND T1. C2 =?
When such an inquiry is received at the node 12, the optimal distribution processing method is selected at the node 12, and each node is instructed via the network. In the above inquiry, the table T1 is stored from the node 1 (90) to the node 4 (91), and the table T2 is stored from the node 5 (92) to the node 8 (93). And data distribution processing is executed. Further, the nodes 9 (94) to 11 (96) sequentially receive the data output from the nodes 1 to 4 and the nodes 5 to 8, and execute the sort process and the join process. The node 12 (97) receives and outputs the data output from the nodes 9-11. This completes the database search.
[0055]
Next, the relationship between the processing times of the respective nodes will be described with reference to FIG. FIG. 4 shows a schematic diagram for explaining the parallel pipeline operation. In FIG. 4, reference numerals 100 and 101 correspond to the processes in node 1 (90) to node 4 (91) and node 5 (92) to node 8 (93) in FIG. Execute. 110 and 111 correspond to the processing from the node 9 (94) to the node 11 (96), and the slot sort processing, N-way merge processing, and matching processing are executed. 120 corresponds to the processing in the node 12 (97), and the requested data output processing is executed. Along the time axis, the data processed in the data extraction processing and data distribution processing 100 and 101 is sequentially transferred to slot sorting processing 110 and 111 and executed in a pipeline manner. The process from the data extraction process to the slot sort process is called an extraction phase. Further, the N-way merge processing 110 and 111 is simply executed in parallel at each node. This N-way merge processing period is called a merge phase. Further, the result of the matching process is sequentially transferred to the request data output process 120 and executed in a pipeline manner. This process from matching to request data output is called a combination phase. The time chart shown in FIG. 4 shows the processing contents when the query example shown in FIG. 1 is applied. In the retrieval phase, the processing time from node 1 (90) to node 4 (91) is shown as T1 data retrieval / data distribution processing time 130. Also, the processing time from the node 5 (92) to the node 8 (93) is indicated by the T2 data fetch / data distribution processing time 131, the transfer time in the interconnection network 80 is indicated by the data distribution transfer time 140, and the node 9 (94 ) To node 11 (96) are executed as indicated by T1 / T2 slot sort processing time 150, respectively. In FIG. 4, the take-out phase ends until the slot sort process completion wait 180. In the merge phase, the processing time from the node 9 (94) to the node 11 (96) is executed at the time indicated by the T1 / T2N way merge processing time 151. This merge phase ends with the T1 / T2N way merge process waiting 181. In the joining phase, the processing time in the node 9 (94) to the node 11 (96) is indicated by the matching processing time 152, the processing time in the mutual connection network 80 is indicated by the joining result transfer time 160, and in the node 12 (97). The processing time is indicated by a request data output processing time 170, and each is executed within that time.
[0056]
Next, a method for distributing processing to each node group of the node 12 in FIG. 1 will be described with reference to FIG. FIG. 5 is an explanatory diagram showing a distribution method to each node group in the data distribution processing. As a premise, a node group that performs data extraction / data distribution processing includes ten nodes 1 to 10 including processors 200 to 230 and disk devices 201 to 231. In addition, it is assumed that the node group that performs the combining process includes five nodes 11 to 15 including processors 240 to 250 and disk devices 241 to 251. The dictionary 50 stores optimization information 51 related to the joined columns. The optimization information 51 is information for equally dividing the data in the database. For example, since the number of data for the combined column is not usually uniform, the data is divided by the combined column so that the number of data is uniform. To do. As shown in FIG. 5, it is shown that the data stored in the nodes 1 to 10 can be equally divided in the divided ranges from v1 to v10. In this case, in order to equally divide the data into the nodes 11 to 15, the node numbers 11, 12, 13, 14, and 5 are divided into five sections of v1 to v2, v3 to v4, v5 to v6, v7 to v8, and v9 to v10, respectively. Distribution processing means for associating 15 may be provided. If the optimization information does not exist, data distribution may be performed by setting an appropriate hash function. In this manner, the node 12 in FIG. 1 includes the distribution processing means, and distributes the processing to each node group when performing the N-way merge processing. Thereby, in the above case, data can be equally divided into the nodes 11 to 15, and the processing time becomes equal.
[0057]
Next, a method for determining the number of coupled nodes when performing N-way merge processing will be described with reference to FIG. FIG. 6 is a schematic diagram for explaining a method for determining the number of coupled nodes.
[0058]
Each phase of parallel connection processing in FIG. 1 and the processing time of each processing are graphed and laid out according to the outline of the parallel pipeline operation shown in FIG. In FIG. 6, it is assumed that data extraction / data distribution processing is executed in the nodes 1 to 8 and processing times of 300 to 305 are required. Here, it is assumed that the processing time 304 of the node 5 is the maximum processing time. The slot sort processing time can be derived from the number N of coupled processing nodes, predetermined system characteristics (CPU performance, disk device performance, etc.), and a database calculation method. It can be obtained by the following formula.
[0059]
[Expression 1]
E = a / N + b * N + c
In order to maximize the effect at the time of performing pipeline processing, the combined node allocation number 350 that is the intersection of the performance characteristics of the slot sort processing and the maximum processing time 304 can be obtained as the number of nodes. When the combined node allocation number 350 is determined, the N-way merge processing time 320 and the matching processing time 330 can be similarly estimated from the performance characteristics of the N-way merge processing and the performance characteristics of the matching process. The total of these processing times is the total processing time for the inquiry. By determining the number of coupled nodes in this way, and sequentially merging the data distributed in the data extraction / data distribution processing and processing them simultaneously, the overall processing time (response time from inquiry to output) Can be shortened.
[0060]
Specific examples of performance characteristics used when determining the number of coupled nodes are shown below. For example, the number of rows is 10,000,000 in both Table T1 and Table T2, the number of conditions is T1-1 (the total number of rows is narrowed down to 1%), and the number of distribution nodes for data retrieval / data distribution processing is Both Table T1 and Table T2 are equally divided into 16 nodes, the number of coupled nodes is 8, the processor performance is 50 MIPS (50 million instructions executed per second), and the network transfer rate is 20 Mbytes / second. . The result of processing by the actual database management system under such conditions or the result calculated from the performance model is as follows.
[0061]
The processing time of the distribution nodes in Table T1 and Table T2 is 180 seconds, T1 / T2 slot sort processing time is 80 seconds, N-way merge processing time is 380 seconds, matching processing time is 110 seconds, and request data output time is 10 seconds. It becomes. Based on the processing performance of these results, the processing time for the query is estimated.
[0062]
Next, a processing time adjustment method (tuning method) for further shortening the response time based on the method for determining the number of coupled nodes shown in FIG. 6 will be described with reference to FIG. 7, FIG. 8, and FIG. . The method described below is calculated in advance when the distribution processing means of the node 12 determines the distribution of processing to each node group, and the distribution is determined from the result.
[0063]
FIG. 7 shows a schematic diagram of slot sorting pre-processing. It is assumed that data extraction / data distribution processing is executed in the nodes 1 to 8 and processing times of 300 to 305 are required. The processing time for each node varies depending on the number of data in each table. Further, the slot sort process is set to be executed by the combination process node group. If there is a variation in processing time for each node, consider a processing procedure for transferring the slot sort processing to the data extraction / data distribution processing node group. As shown in FIG. 7 as pre-processing of slot sorting, slot sorting processing is performed at a node where data extraction / data distribution processing is completed earlier. According to this processing, the slot sort processing time in the node having the combined node allocation number 350 can be reduced from 310 to 312. The N-way merge processing is shifted in the processing time difference 311. This is nothing but extending the length of the slot sort process. Thereby, the N-way merge processing time can be reduced, and as a result, the response time can be reduced.
[0064]
FIG. 8 shows a slot sort sequence length tuning outline diagram. For example, when multiple processing is performed within the time, such as when there is a restriction on processing time, each database operation executed at each node is parameterized and time adjustment (tuning) based on the expected processing time The method of doing will be described. The number of join processing nodes is increased as much as possible from the join node allocation number 350 obtained in FIG. 6 to shorten the response time. In this case, the number of combined node assignments is 351. Assuming that the combined node allocation number is 351, the slot sort processing time is reduced from 310 to 312. In order to maximize the pipeline effect, the N-way merge process is shifted to the slot sort process at the processing time 311. As a result, the number of merges in the N-way merge process is reduced, the processing time can be reduced to 320, and as a result, the response time can be reduced.
[0065]
FIG. 9 shows a schematic diagram of N-way merge frequency tuning. When the matching processing time 330 determined by the combined node allocation number 350 is shorter than the request data output processing time 340, the merge processing at the final stage of the N-way merge processing can be shifted to the matching processing. If the sum of the merge processing time 331 at the final stage of the N-way merge process and the matching process time 330 does not exceed the requested data output processing time 340, the merge process at the final stage is shifted to the matching process. Thereby, the response time can be reduced.
[0066]
Next, the operation flow of the database management system in the present embodiment will be described. 10, FIG. 11, FIG. 12, FIG. 13, FIG. 14 and FIG. 15 show a flowchart of DBMS processing in this embodiment. In FIG. 10, the DBMS includes a query analysis process 400 that performs query analysis by query analysis processing (step 220), static optimization processing (step 221), and code generation (step 222) performed before query execution, A constant optimization is performed, and a dynamic optimization process (step 223) for selecting a processing procedure and a query execution process 410 for performing an execution process on the query by code interpretation execution (step 224) of the query are performed.
[0067]
The outline of each processing unit will be described below.
[0068]
(A) Query analysis processing 400
10A and 10C, in the query analysis (step 220), syntax analysis and semantic analysis of the query sentence input by the application program in the node 12 are executed (step 2200). In FIG. 10A, in the static optimization process (step 221), the ratio of data satisfying the condition is estimated from the conditional expression appearing in the query in the node 12, and based on the preset rule. Create valid access path candidates (especially, select an index) and create processing procedure candidates. In the code generation (step 222), the processing procedure candidates are expanded into an execution format in the node 12.
[0069]
(B) Query execution processing 410
In FIG. 10B, in the dynamic runtime optimization (step 223), the processing procedure to be executed in each node group is determined based on the constant substituted in the node 12. In the code interpretation execution (step 224), the processing procedure is interpreted and executed in each node.
[0070]
Next, a detailed processing flow of each processing unit will be described.
[0071]
In FIG. 10D, in the dynamic optimization process (step 221), the predicate selection rate of the conditional expression appearing in the query is estimated (step 2210), the access path consisting of an index or the like is pruned (step 2211), A processing procedure candidate is generated by combining these access paths (step 2212).
[0072]
In FIG. 10E, in the predicate selection rate estimation (step 2210), it is checked whether or not a variable appears in the query conditional expression (step 22101). If a variable appears, it is checked whether there is column value distribution information in the conditional expression (step 22104). Exit if it exists. If it does not exist, a default value is set according to the type of conditional expression (step 22105), and the process ends. If no variable appears, it is checked whether the conditional expression includes column value distribution information (step 22104). If it does not exist, a default value is set according to the type of conditional expression (step 22105), and the process ends. If it exists, the selectivity is calculated using the column value distribution information (step 22103).
[0073]
In FIG. 11, in the access path pruning 2212, the index of the column appearing in the query conditional expression is registered as an access path candidate (step 22120). Next, it is checked whether the table to be accessed by the query is divided and stored in a plurality of nodes (step 22121). If stored separately, the parallel table scan is registered as an access path candidate (step 22123). If not stored separately, the table scan is registered as an access path candidate (step 22123). It is checked whether the selection rate of each conditional expression has already been set (step 22124). If already set, the index of the conditional expression that minimizes the selection rate for each table is set as the highest priority of the access path (step 22125). If not set, the maximum value / minimum value of the selection rate of each conditional expression is acquired (step 22126). Finally, the selection criteria for each access path is calculated from the system characteristics such as CPU performance and IO performance (step 22127), and the selection rate in the access path combining a single index or a plurality of indexes is less than the above selection criteria. Registration as an access path candidate (step 22128).
[0074]
In FIG. 12, the processing procedure candidate generation 2213 checks whether the table to be accessed in the query is divided and stored in a plurality of nodes (step 22130). If it is stored separately, the process proceeds to step 22135. If it is not stored separately, it is checked whether or not sort processing is included in the processing procedure candidate (step 22131). If it is included, the process proceeds to step 22135. If not included, it is checked whether the access path of the table to be accessed by the query is unique (step 22132). If it is unique, a single processing procedure is created (step 22133). Is created (step 22134), and the process ends. In step 22135, the query is broken down into two-way joins that can be joined. Corresponding to the storage node group of the table to be divided and stored, the data reading / data distribution processing procedure is registered as a candidate. Further, the slot sort processing procedure is registered as a candidate (step 22136). Corresponding to the combination processing node group, the slot sort processing procedure, the N-way merge processing procedure and the matching processing procedure are registered as candidates, and the slot sort continuous length and the number of merge processing are parameterized (step 22137). The request data output processing procedure is registered in the request data output node (step 22138). Finally, when all the evaluations on the decomposition result are completed (step 22139), the process ends.
[0075]
In FIG. 13, the code generation 222 checks whether or not the processing procedure candidate is unique (step 2220). If it is unique, the process proceeds to step 2223. If not unique, optimization information consisting of column value distribution information or the like is embedded in the processing procedure (step 2221), and a data structure for selecting the processing procedure is created based on the constants assigned during query execution (step 2222). Finally, the processing procedure is expanded into an execution format (step 2223).
[0076]
In FIG. 14, the dynamic optimization process 223 checks whether or not the created processing procedure is single (step 22300). If it is single, it ends. If not single, the selectivity is calculated based on the assigned constant (step 22301). It is checked whether or not parallel processing procedures are included in the processing procedure candidates (step 22302). If not included, a processing procedure is selected according to the access path selection criteria (step 22313), and the process ends. If included, the optimization information (column value distribution information of the join column, the number of rows in the table to be accessed, the number of pages, etc.) is input from the dictionary (step 22303), and processing for data retrieval / data distribution The time is calculated as described above in consideration of each system characteristic (step 22304). From this processing time, the number p of nodes to be allocated to the joining process is determined, and this processing procedure a1 is determined (step 22305). It is checked whether or not there is a variation in the data extraction / data distribution processing time (step 22306). If there is variation, a processing procedure a2 for executing slot sorting processing in the data fetch / data distribution processing node group is set (step 22307). Next, a processing procedure a3 is set in which the number of combined nodes allocated p is increased by α (step 22308). If the requested data processing time is longer than the sum of the matching processing time and one N-way merge processing time (step 22309), a processing procedure a4 is set in which one N-way merge processing is transferred to the matching processing ( Step 22310). In the processing procedures a1 to a4, the optimum processing procedure is selected from the viewpoints of minimum response time, minimum load on each node, and small influence on other transaction response performance (step 2211). Data distribution information is created based on the optimization information (step 22312). If there is no optimization information, data distribution information is created according to the combined column evaluation value of the hash function. A processing procedure is selected according to the access path selection criteria (step 22313), and the process ends.
[0077]
In FIG. 15, in the code interpretation execution processing 224, processing is performed in accordance with the corresponding processing procedure in each set node.
[0078]
First, each node determines whether or not data extraction / data distribution processing is set (step 22400). If the data retrieval / data distribution process is set, the database stored in the storage device of each node is accessed and the conditional expression is evaluated (step 22401). Data is extracted based on the data distribution information created based on the optimization information, and the data is sequentially distributed to the buffers of the respective joining nodes (step 22402). It is determined whether or not the buffer of each joining node is full. If the buffer is full, it is transferred to the corresponding joining node in page format. When all the data corresponding to the inquiry is extracted and distributed, the process ends (step 22404).
[0079]
Each node determines whether slot sort processing is set (step 22405). If slot sort processing is set, page format data from the data fetch / data distribution processing node is received (step 22406), and slot sort processing is sequentially performed on the received data (step 22407). The processed slot sort result is temporarily stored, and the slot sort process is terminated (step 22408).
[0080]
Also, it is determined whether or not N-way merge processing is set (step 22409). If the N-way merge process is set, the N-way merge process is executed based on the slot sort result (step 22410), the N-way merge process result is temporarily stored in a buffer or the like (step 22411), and the N-way merge process is executed. Exit.
[0081]
Further, it is determined whether or not the matching process is set (step 22412). If the matching process is set, the sort list of the N-way merge process result is matched, and data is set in the output buffer (step 22413). If the output buffer is full, it is transferred to the request data output node in page format (step 22415).
[0082]
Further, it is determined whether or not the request data output process is set (step 22416). If the requested data output process is set, it is determined whether or not there is a page format data transfer from the joining node (step 22417). If there is a page format data transfer, the page format data is received (step 22418), and the query processing result is output to the application program. If there is no page format data transfer, the query processing result is output as it is. It outputs (step 22419).
[0083]
Further, in the above-described code interpretation execution process, when the slot sorting process is executed in the data extraction / data distribution processing node group when the processing time varies, the code interpretation is performed after the data extraction / data distribution process is completed. The execution process 224 is executed again to perform the slot sort process.
[0084]
Furthermore, if the N-way merge process result is not a complete sort column in step 22413, the final stage merge and matching process are performed.
[0085]
By processing as described above, the inquiry response time of the database management system can be shortened.
[0086]
The joining node assignment method shown in FIG. 6 and the tuning methods shown in FIGS. 7, 8, and 9 may be applied independently or in any combination. That is, the dynamic optimization process 223 assumes a case where all combinations can be applied. Further, in the data fetching process, the application of a parallel input / output access method comprising a plurality of disk devices, the application of a batch input / output method / prefetch input / output method, and a data distribution method using optimized information or a hash function for data distribution processing Application, application of a parallel sorting method to N-way merge processing, application of a matching processing method between nodes to matching processing, application of a parallel reception processing method by assigning a plurality of nodes to request data output processing, and the like are also conceivable. In step 22309 and step 22310, one way N-way merge processing is assumed, but it may be generally n times (n ≧ 1).
[0087]
With respect to the parallel pipeline operation shown in FIG. 4, when the joining node allocation method shown in FIG. 6 and the tuning method shown in FIGS. 7, 8, and 9 are applied, among the extraction phase, merge phase, and joining phase, There are cases where the merge phase can be omitted. That is, it is possible by extending the slot sort sequence length and moving the N-way merge process. In this case, the merge phase process is omitted even in the query execution process.
[0088]
The query processing method of the present invention is not limited to the combined use of the rule using statistical information and cost evaluation, but can be applied as long as a processing procedure for providing appropriate database reference characteristic information can be obtained. For example, the present invention can also be applied to a DBMS that performs optimization processing such as cost evaluation only, rule usage only, or cost evaluation and rule usage combined.
[0089]
The present invention can be realized through a tightly coupled / loosely coupled multiprocessor system software system of a large computer, or through a tightly coupled / loosely coupled complex processor system in which a dedicated processor is prepared for each processing unit. It can also be realized. Further, even a single processor system is applicable if a parallel process is assigned for each processing procedure.
[0090]
According to the present embodiment, the number of nodes is determined corresponding to the database operation executed at each node, and if there is a variation in the data division, the data is divided equally into each node, Since each database operation to be executed is parameterized and the expected processing time is equalized, there is no bias in processing time between the nodes, and a pipeline operation can be performed smoothly, and high-speed query processing can be realized.
[0091]
【The invention's effect】
According to the invention, obtained from an inquiry requestBy generating data distribution information based on the evaluation value of the hash function for the database calculation key, and sending the data subject to the database calculation request from the storage unit to the plurality of calculation units based on the data distribution information,The load imbalance in the processor can be reduced.
[Brief description of the drawings]
[Fig. 1] Outline of parallel join processing
[Figure 2] Configuration diagram of the database system
FIG. 3 Hardware configuration diagram
[Figure 4] Outline of parallel pipeline operation
[Figure 5] Outline of data distribution process
[Fig. 6] Outline of node allocation
[Fig. 7] Overview of pre-slot sorting
[Figure 8] Overview of slot sort run length tuning
[Fig. 9] N-way merge count tuning overview diagram
FIG. 10 is a flowchart of the database management system.
FIG. 11 is a flowchart of the database management system.
FIG. 12 is a flowchart of the database management system.
FIG. 13 is a flowchart of the database management system.
FIG. 14 is a flowchart of the database management system.
FIG. 15 is a flowchart of the database management system.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 10, 11 ... Application program, 20 ... Database management system, 22 ... Logic processing part, 220 ... Query analysis, 221 ... Static optimization processing, 222 ... Code generation, 223 ... Dynamic optimization processing, 224 ... Code interpretation execution , 30 ... operating system, 40 ... database, 50 ... dictionary, 80 ... interconnection network, 90, 91, 92, 93, 94, 95, 96, 97 ... node.

Claims (9)

データの演算処理を行う複数の演算処理部と、
データベースから取り出したデータを前記複数の演算処理部に分配する分配処理部と、
入力された問合せに対する演算処理を実行する演算処理部を決定する決定処理部と、を有し、
前記決定処理部は、
処理時間と演算処理部数との対応関係を用いて、前記分配処理部における処理時間に対応する演算処理部数を特定し、前記問合せに対する演算処理を実行する前記特定した演算処理部数の演算処理部を決定する決定手段と、
前記データベースのデータ数を均等に分割するための演算キーの最適化情報に従い、前記問合せに対する演算処理を実行する前記特定した演算処理部数の演算処理部各々に割り当てる演算キーの分割範囲が記述されたデータ分配情報を、前記分配処理部に設定する設定手段と、
前記問合せに対する演算処理を実行する前記特定した演算処理部数の演算処理部各々から受け取ったデータを出力する問合結果出力手段と、を有し、
前記分配処理部は、
前記データベースから取り出したデータを、自身に設定されているデータ分配情報において当該データの演算キーが属する分割範囲に割り当てられた演算処理部へ分配する分配手段を有し、
前記演算処理部は、
前記分配処理部から分配されたデータを演算処理し、その結果を前記決定処理部に出力する演算結果出力手段を有すること
を特徴とするデータベース管理システム
A plurality of arithmetic processing units for performing arithmetic processing of data;
A distribution processing unit for distributing data extracted from the database to the plurality of arithmetic processing units;
A determination processing unit that determines an arithmetic processing unit that performs arithmetic processing on the input query,
The determination processing unit
Using the correspondence relationship between the processing time and the number of arithmetic processing units, the number of arithmetic processing units corresponding to the processing time in the distribution processing unit is specified, and the arithmetic processing unit of the specified number of arithmetic processing units that executes the arithmetic processing for the query A decision means to decide;
According to calculation key optimization information for equally dividing the number of data in the database, the division range of the calculation key to be assigned to each of the calculation processing units of the specified number of calculation processing units executing the calculation processing for the query is described Setting means for setting data distribution information in the distribution processing unit;
Query result output means for outputting data received from each of the arithmetic processing units of the specified number of arithmetic processing units for executing arithmetic processing for the query,
The distribution processing unit includes:
Distributing means for distributing the data extracted from the database to the operation processing unit assigned to the division range to which the operation key of the data belongs in the data distribution information set in itself,
The arithmetic processing unit includes:
Computation result output means for computing the data distributed from the distribution processing unit and outputting the result to the decision processing unit
A database management system characterized by
データの演算処理を行う複数の演算処理部と、
データベースから取り出したデータを前記複数の演算処理部に分配する分配処理部と、
入力された問合せに対する演算処理を実行する演算処理部を決定する決定処理部と、を有し、
前記決定処理部は、
処理時間と演算処理部数との対応関係を用いて、前記分配処理部における処理時間に対応する演算処理部数を特定し、前記問合せに対する演算処理を実行する前記特定した演算処理部数の演算処理部を決定する決定手段と、
前記演算処理部数の各演算処理部に前記データベースのデータの演算キーに対するハッシュ値が均等に割り当てられているデータ分配情報を、前記分配処理部に設定する設定手段と、
前記問合せに対する演算処理を実行する前記特定した演算処理部数の演算処理部各々から受け取ったデータを出力する問合結果出力手段と、を有し、
前記分配処理部は、
前記データベースから取り出したデータを、自身に設定されているデータ分配情報において当該データの演算キーに対するハッシュ値が割り当てられている演算処理部へ分配する分配手段を有し、
前記演算処理部は、
前記分配処理部から分配されたデータを演算処理し、その結果を前記決定処理部に出力する演算結果手段を有すること
を特徴とするデータベース管理システム
A plurality of arithmetic processing units for performing arithmetic processing of data;
A distribution processing unit for distributing data extracted from the database to the plurality of arithmetic processing units;
A determination processing unit that determines an arithmetic processing unit that performs arithmetic processing on the input query,
The determination processing unit
Using the correspondence relationship between the processing time and the number of arithmetic processing units, the number of arithmetic processing units corresponding to the processing time in the distribution processing unit is specified, and the arithmetic processing unit of the specified number of arithmetic processing units that executes the arithmetic processing for the query A decision means to decide;
Setting means for setting, in the distribution processing unit, data distribution information in which hash values for the calculation keys of the data in the database are evenly assigned to the respective arithmetic processing units of the number of arithmetic processing units;
Query result output means for outputting data received from each of the arithmetic processing units of the specified number of arithmetic processing units for executing arithmetic processing for the query,
The distribution processing unit includes:
Distributing means for distributing the data extracted from the database to an operation processing unit to which a hash value for the operation key of the data is assigned in the data distribution information set in itself,
The arithmetic processing unit includes:
Computation processing means for computing the data distributed from the distribution processing unit and outputting the result to the decision processing unit
A database management system characterized by
請求項1または2記載のデータベース管理システムであって、
前記決定処理部は、
前記分配処理部が複数あり、各前記分配処理部における処理時間にばらつきがある場合 、前記各分配処理部において取り出したデータの並べ替え要求を生成し、当該要求を、最も処理時間が遅い前記分配処理部以外の前記分配処理部のうちの少なくとも1の分配処理部に設定する並替要求設定手段をさらに備え、
前記並べ替え要求を設定された分配処理部の前記分配手段は、
前記並べ替え要求に従って、取り出したデータを並べ替えた後、前記割り当てられた演算処理部に分配すること
を特徴とするデータベース管理システム
The database management system according to claim 1 or 2, wherein
The determination processing unit
When there are a plurality of distribution processing units and the processing time in each of the distribution processing units varies, a request for rearranging the data extracted in each of the distribution processing units is generated, and the request is sent to the distribution unit with the slowest processing time. A reordering request setting means for setting in at least one distribution processing unit of the distribution processing units other than the processing unit;
The distribution means of the distribution processing unit to which the rearrangement request is set,
According to the rearrangement request, after the retrieved data is rearranged, it is distributed to the assigned arithmetic processing unit.
A database management system characterized by
データの演算処理を行う複数の演算処理部と、データベースから取り出したデータを前記複数の演算処理部に分配する分配処理部と、入力された問合せに対する演算処理を実行する演算処理部を決定する決定処理部と、を有するデータベース管理システムにおける問合せ処理方法であって、
前記決定処理部において、処理時間と演算処理部数との対応関係を用いて、前記分配処理部における処理時間に対応する演算処理部数を特定し、前記問合せに対する演算処理を実行する前記特定した演算処理部数の演算処理部を決定するステップと、
前記決定処理部において、前記データベースのデータ数を均等に分割するための演算キーの最適化情報に従い、前記問合せに対する演算処理を実行する前記特定した演算処理部数の演算処理部各々に割り当てる演算キーの分割範囲が記述されたデータ分配情報を、前記分配処理部に設定するステップと、
前記分配処理部において、前記データベースから取り出したデータを、自身に設定されているデータ分配情報において当該データの演算キーが属する分割範囲に割り当てられた演算処理部へ分配するステップと、
前記演算処理部において、前記分配処理部から分配されたデータを演算処理し、その結果を前記決定処理部に出力するステップと、
前記決定処理部において、前記問合せに対する演算処理を実行する前記特定した演算処理部数の演算処理部各々から受け取ったデータを出力するステップと、を備えること
を特徴とする問合せ処理方法
Decision to determine a plurality of arithmetic processing units that perform arithmetic processing of data, a distribution processing unit that distributes the data extracted from the database to the plurality of arithmetic processing units, and an arithmetic processing unit that performs arithmetic processing on the input query A query processing method in a database management system having a processing unit,
In the determination processing unit, using the correspondence relationship between the processing time and the number of arithmetic processing units, the number of arithmetic processing units corresponding to the processing time in the distribution processing unit is specified, and the specified arithmetic processing for executing the arithmetic processing for the query Determining an arithmetic processing unit for the number of copies;
In the determination processing unit, according to optimization information of an operation key for equally dividing the number of data in the database, an operation key assigned to each operation processing unit of the specified number of operation processing units for executing the operation processing for the query Setting data distribution information in which a division range is described in the distribution processing unit;
In the distribution processing unit, distributing the data extracted from the database to the calculation processing unit assigned to the division range to which the calculation key of the data belongs in the data distribution information set in itself;
The arithmetic processing unit performs arithmetic processing on the data distributed from the distribution processing unit, and outputs the result to the determination processing unit;
The decision processing unit includes a step of outputting data received from each of the specified number of arithmetic processing units for performing arithmetic processing on the query.
A query processing method characterized by
データの演算処理を行う複数の演算処理部と、データベースから取り出したデータを前記複数の演算処理部に分配する分配処理部と、入力された問合せに対する演算処理を実行する演算処理部を決定する決定処理部と、を有するデータベース管理システムにおける問合わせ処理方法であって、
前記決定処理部において、処理時間と演算処理部数との対応関係を用いて、前記分配処理部における処理時間に対応する演算処理部数を特定し、前記問合せに対する演算処理を実行する前記特定した演算処理部数の演算処理部を決定するステップと、
前記演算処理部数の各演算処理部に前記データベースのデータの演算キーに対するハッシュ値が均等に割り当てられているデータ分配情報を、前記分配処理部に設定する分配情報設定ステップと、
前記分配処理部において、前記データベースから取り出したデータを、自身に設定されているデータ分配情報において当該データの演算キーに対するハッシュ値が割り当てられている演算処理部へ分配するステップと、
前記演算処理部において、前記分配処理部から分配されたデータを演算処理し、その結果を前記決定処理部に出力するステップと、
前記決定処理部において、前記問合せに対する演算処理を実行する前記特定した演算処理部数の演算処理部各々から受け取ったデータを出力するステップと、を備えること
を特徴とする問合せ処理方法
Decision to determine a plurality of arithmetic processing units that perform arithmetic processing of data, a distribution processing unit that distributes the data extracted from the database to the plurality of arithmetic processing units, and an arithmetic processing unit that performs arithmetic processing on the input query A query processing method in a database management system having a processing unit,
In the determination processing unit, using the correspondence relationship between the processing time and the number of arithmetic processing units, the number of arithmetic processing units corresponding to the processing time in the distribution processing unit is specified, and the specified arithmetic processing for executing the arithmetic processing for the query Determining an arithmetic processing unit for the number of copies;
A distribution information setting step for setting, in the distribution processing unit, data distribution information in which hash values for the calculation keys of the data in the database are evenly allocated to the calculation processing units of the number of calculation processing units;
In the distribution processing unit, distributing the data extracted from the database to a calculation processing unit to which a hash value for the calculation key of the data is assigned in the data distribution information set to itself;
The arithmetic processing unit performs arithmetic processing on the data distributed from the distribution processing unit, and outputs the result to the determination processing unit;
The decision processing unit includes a step of outputting data received from each of the specified number of arithmetic processing units for performing arithmetic processing on the query.
A query processing method characterized by
請求項4または5記載の問合せ処理方法であって、
前記決定処理部において、前記分配情報設定ステップの次に、前記分配処理部が複数あり、各前記分配処理部における処理時間にばらつきがある場合、前記各分配処理部におい て取り出したデータの並べ替え要求を生成し、当該要求を、最も処理時間が遅い前記分配処理部以外の前記分配処理部のうちの少なくとも1の分配処理部に設定するステップをさらに備え、
前記並べ替え要求を設定された分配処理部の前記演算処理部へ分配するステップにおいて、取り出したデータを、前記並べ替え要求に従って並べ替えた後、前記演算処理部へ分配すること
を特徴とする問合せ処理方法
The inquiry processing method according to claim 4 or 5, wherein
In the determination processing unit, the next of the distribution information setting step, the there are a plurality of distribution processing unit, if there are variations in the processing time in each said distribution processing unit, sorting data to which the taken out Te respective distribution processor odor Generating a request and setting the request to at least one distribution processing unit other than the distribution processing unit other than the distribution processing unit having the slowest processing time,
In the step of distributing the rearrangement request to the arithmetic processing unit of the set distribution processing unit, the retrieved data is rearranged according to the rearrangement request and then distributed to the arithmetic processing unit.
A query processing method characterized by
データの演算処理を行う複数の演算処理部と、データベースから取り出したデータを、当該データの演算キーおよび自身に設定されたデータ分配情報に従って演算処理部に分配する複数の分配処理部と、を有するデータベース管理システムに用いられ、入力された問合せに対する演算処理を実行する演算処理部を決定するデータベース管理装置であって、
処理時間と演算処理部数との対応関係を用いて、前記分配処理部における処理時間に対応する演算処理部数を特定し、前記問合せに対する演算処理を実行する前記特定した演算処理部数の演算処理部を決定する手段と、
前記データベースのデータを均等に分割するための演算キーの最適化情報に従い、前記問合せに対する演算処理を実行する前記特定した演算処理部数の演算処理部各々に割り当てる演算キーの分割範囲が記述されたデータ分配情報を、前記分配処理部に設定する手段と、を有すること
を特徴とするデータベース管理装置
A plurality of arithmetic processing units that perform arithmetic processing of data, and a plurality of distribution processing units that distribute the data extracted from the database to the arithmetic processing unit according to the operation key of the data and the data distribution information set in itself A database management apparatus that is used in a database management system and determines an arithmetic processing unit that performs arithmetic processing on an input query,
Using the correspondence relationship between the processing time and the number of arithmetic processing units, the number of arithmetic processing units corresponding to the processing time in the distribution processing unit is specified, and the arithmetic processing unit of the specified number of arithmetic processing units that executes the arithmetic processing for the query Means to determine,
Data describing division ranges of calculation keys to be assigned to the respective calculation processing units of the specified number of calculation processing units for executing calculation processing for the query in accordance with calculation key optimization information for equally dividing the data of the database Means for setting distribution information in the distribution processing unit.
A database management device characterized by the above .
データの演算処理を行う複数の演算処理部と、データベースから取り出したデータを、当該データの演算キーおよび自身に設定されたデータ分配情報に従って演算処理部に分配する複数の分配処理部と、を有するデータベース管理システムに用いられ、入力された問合せに対する演算処理を実行する演算処理部を決定するデータベース管理装置における問合せ処理方法であって、
処理時間と演算処理部数との対応関係を用いて、前記分配処理部における処理時間に対応する演算処理部数を特定し、前記問合せに対する演算処理を実行する前記特定した演算処理部数の演算処理部を決定するステップと、
前記データベースのデータ数を均等に分割するための演算キーの最適化情報に従い、前記問合せに対する演算処理を実行する前記特定した演算処理部数の演算処理部各々に割り当てる演算キーの分割範囲が記述されたデータ分配情報を、前記分配処理部に設定するステップと、を有すること
を特徴とする問合せ処理方法
A plurality of arithmetic processing units that perform arithmetic processing of data, and a plurality of distribution processing units that distribute the data extracted from the database to the arithmetic processing unit according to the operation key of the data and the data distribution information set in itself A query processing method in a database management device used in a database management system to determine an arithmetic processing unit that performs arithmetic processing on an input query,
Using the correspondence relationship between the processing time and the number of arithmetic processing units, the number of arithmetic processing units corresponding to the processing time in the distribution processing unit is specified, and the arithmetic processing unit of the specified number of arithmetic processing units that executes the arithmetic processing for the query A step to determine;
According to calculation key optimization information for equally dividing the number of data in the database, the division range of the calculation key to be assigned to each of the calculation processing units of the specified number of calculation processing units for executing the calculation processing for the query is described Setting data distribution information in the distribution processing unit.
A query processing method characterized by
データの演算処理を行う複数の演算処理部と、データベースから取り出したデータを、当該データの演算キーに対するハッシュ値および自処理部に設定されたデータ分配情報に従って演算処理部に分配する複数の分配処理部と、を有するデータベース管理システムに用いられ、入力された問合せに対する演算処理を実行する演算処理部を決定するデータベース管理装置における問合せ処理方法であって、
処理時間と演算処理部数との対応関係を用いて、前記分配処理部における処理時間に対応する演算処理部数を特定し、前記問合せに対する演算処理を実行する前記特定した演算処理部数の演算処理部を決定するステップと、
前記演算処理部数の各演算処理部に前記データベースのデータの演算キーに対するハッシュ値が均等に割り当てられているデータ分配情報を、前記分配処理部に設定するステップと、を有すること
を特徴とする問合せ処理方法
A plurality of arithmetic processing units for performing data arithmetic processing, and a plurality of distribution processes for distributing the data extracted from the database to the arithmetic processing units according to the hash value for the operation key of the data and the data distribution information set in the processing unit A query processing method in a database management apparatus for determining an arithmetic processing unit that executes arithmetic processing on an input query, and is used in a database management system having
Using the correspondence relationship between the processing time and the number of arithmetic processing units, the number of arithmetic processing units corresponding to the processing time in the distribution processing unit is specified, and the arithmetic processing unit of the specified number of arithmetic processing units that executes the arithmetic processing for the query A step to determine;
Setting, in the distribution processing unit, data distribution information in which hash values for the operation keys of the data in the database are evenly assigned to the respective arithmetic processing units of the number of arithmetic processing units.
A query processing method characterized by
JP17440498A 1998-06-22 1998-06-22 Database management system, database management apparatus, and query processing method Expired - Fee Related JP3732655B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP17440498A JP3732655B2 (en) 1998-06-22 1998-06-22 Database management system, database management apparatus, and query processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP17440498A JP3732655B2 (en) 1998-06-22 1998-06-22 Database management system, database management apparatus, and query processing method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP00780493A Division JP3266351B2 (en) 1993-01-20 1993-01-20 Database management system and query processing method

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2000012280A Division JP2000148557A (en) 2000-01-01 2000-01-20 Database management system and query processing method

Publications (2)

Publication Number Publication Date
JPH10326216A JPH10326216A (en) 1998-12-08
JP3732655B2 true JP3732655B2 (en) 2006-01-05

Family

ID=15977980

Family Applications (1)

Application Number Title Priority Date Filing Date
JP17440498A Expired - Fee Related JP3732655B2 (en) 1998-06-22 1998-06-22 Database management system, database management apparatus, and query processing method

Country Status (1)

Country Link
JP (1) JP3732655B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3777872B2 (en) * 1999-05-18 2006-05-24 日本電気株式会社 Query parallel processing system and machine-readable recording medium recording program
US10579634B2 (en) * 2012-08-30 2020-03-03 Citus Data Bilgi Islemleri Ticaret A.S. Apparatus and method for operating a distributed database with foreign tables

Also Published As

Publication number Publication date
JPH10326216A (en) 1998-12-08

Similar Documents

Publication Publication Date Title
JP3266351B2 (en) Database management system and query processing method
US6556988B2 (en) Database management apparatus and query operation therefor, including processing plural database operation requests based on key range of hash code
Armenatzoglou et al. Amazon Redshift re-invented
US6505187B1 (en) Computing multiple order-based functions in a parallel processing database system
US5325525A (en) Method of automatically controlling the allocation of resources of a parallel processor computer system by calculating a minimum execution time of a task and scheduling subtasks against resources to execute the task in the minimum time
US5758144A (en) Database execution cost and system performance estimator
US7984043B1 (en) System and method for distributed query processing using configuration-independent query plans
US6477523B1 (en) Selectivity prediction with compressed histograms in a parallel processing database system
Sukhwani et al. A hardware/software approach for database query acceleration with FPGAs
Wang et al. Elastic pipelining in an in-memory database cluster
Gates et al. Apache Pig's Optimizer.
Michiardi et al. Cache-based multi-query optimization for data-intensive scalable computing frameworks
Coppola et al. High-performance data mining with skeleton-based structured parallel programming
JPH06309284A (en) Query processing load balancing method
JP3732655B2 (en) Database management system, database management apparatus, and query processing method
JP3538322B2 (en) Database management system and query processing method
JP3668243B2 (en) Database management system
JP4422697B2 (en) Database management system and query processing method
JP3667997B2 (en) Database management device
JP3819694B2 (en) Database management system and query processing method
JP3819695B2 (en) Database management system and query processing method
Chen et al. Parallel XPath query based on cost optimization
JP2001147847A (en) Database management system and query processing method
JP2000148557A (en) Database management system and query processing method
Bruno et al. Recurring Job Optimization for Massively Distributed Query Processing.

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050419

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20051013

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

Free format text: PAYMENT UNTIL: 20091021

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20091021

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20101021

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees