JP6316503B2 - Computer system, accelerator, and database processing method - Google Patents

Computer system, accelerator, and database processing method Download PDF

Info

Publication number
JP6316503B2
JP6316503B2 JP2017518648A JP2017518648A JP6316503B2 JP 6316503 B2 JP6316503 B2 JP 6316503B2 JP 2017518648 A JP2017518648 A JP 2017518648A JP 2017518648 A JP2017518648 A JP 2017518648A JP 6316503 B2 JP6316503 B2 JP 6316503B2
Authority
JP
Japan
Prior art keywords
database
processing
aggregation
grouping
data
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
JP2017518648A
Other languages
Japanese (ja)
Other versions
JPWO2016185542A1 (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
Publication of JPWO2016185542A1 publication Critical patent/JPWO2016185542A1/en
Application granted granted Critical
Publication of JP6316503B2 publication Critical patent/JP6316503B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor

Description

本発明は、データ記憶部およびデータベース集約処理部を有するストレージ装置を利用したデータ処理方法、計算機システム及びストレージシステムに関する。   The present invention relates to a data processing method, a computer system, and a storage system using a storage device having a data storage unit and a database aggregation processing unit.

データベース検索処理を代表とするデータ処理システムでは、データ処理の高速化を目的として、データ処理サーバで行っていた処理の一部分を大容量記憶媒体(ストレージ)の近傍に配置したハードウェアアクセラレータへオフロードする構成が提案されている(例えば、特許文献1)。   In data processing systems such as database search processing, a part of the processing performed on the data processing server is offloaded to a hardware accelerator located near the mass storage medium (storage) for the purpose of speeding up the data processing. The structure which performs is proposed (for example, patent document 1).

従来のデータ処理サーバで行っていたフィルタリング処理や、プロジェクション処理、グルーピング処理、あるいは集約演算処理を、上記ハードウェアアクセラレータへオフロードすることで、データ処理サーバの負荷を軽減し、検索時間などの処理時間を大幅に短縮する技術が知られている(非特許文献1)。   By offloading the filtering processing, projection processing, grouping processing, or aggregation calculation processing that was performed by the conventional data processing server to the hardware accelerator, the load on the data processing server is reduced and processing such as search time is performed. A technique for significantly reducing the time is known (Non-Patent Document 1).

さらに、データ処理サーバでは、ジョイン処理や、マージソート処理もハードウェアアクセラレータにオフロードすることが検討されている(特許文献2)。データベースの処理を高速化する技術としては、機能レベルでのパイプライン化や、機能の並列化を行うことが知られている(特許文献1、2)。   Furthermore, in the data processing server, it has been studied to offload join processing and merge sort processing to a hardware accelerator (Patent Document 2). As a technique for speeding up database processing, it is known to perform pipeline processing at the function level and parallelization of functions (Patent Documents 1 and 2).

特開平5−128164号公報Japanese Patent Laid-Open No. 5-128164 米国特許出願公開第2012/0047126号明細書US Patent Application Publication No. 2012/0047126

Louis Woods, Zsolt Isvan, Gustavo Alonso:”Ibex-An Intelligent Storage Engine with support for advanced SQL Off-loading”, Proc. VLDB Endowment (PVLDB), 2014Louis Woods, Zsolt Isvan, Gustavo Alonso: “Ibex-An Intelligent Storage Engine with support for advanced SQL Off-loading”, Proc. VLDB Endowment (PVLDB), 2014

しかしながら、上記非特許文献1では、データベースの処理単位が“行”であり、処理単位が小さくデータベースの処理性能を向上させることが困難であった。さらに、非特許文献1においては、データベースを格納したSSD(Solid State Drive)からハードウェアアクセラレータに直接データを入力している為、データベースの処理性能が、SSDの読み出し性能により処理の制約を受けてしまい、ハードウェアアクセラレータへのデータ供給の速度がボトルネックになるという課題があった。   However, in Non-Patent Document 1, the database processing unit is “row”, and it is difficult to improve the database processing performance because the processing unit is small. Furthermore, in Non-Patent Document 1, data is directly input to a hardware accelerator from an SSD (Solid State Drive) that stores a database, so the database processing performance is subject to processing restrictions due to the SSD reading performance. Therefore, there has been a problem that the speed of data supply to the hardware accelerator becomes a bottleneck.

他方、上述のグルーピング処理では、ハッシュ演算を用いる例が知られている。ハッシュ演算を用いてグルーピングをした際には、異なるグループが同じハッシュ値を持ち、ハッシュ値の衝突(シノニム)が発生することがある。   On the other hand, in the above grouping process, an example using a hash operation is known. When grouping is performed using a hash operation, different groups may have the same hash value, and hash value collision (synonym) may occur.

シノニムが発生した場合、ハードウェアアクセラレータでハッシュ値の再計算を行うと次の行(データ)の計算が待たされるため、ハードウェアアクセラレータの処理性能が低下する、という問題があった。   When a synonym occurs, if the hardware accelerator recalculates the hash value, the calculation of the next line (data) is awaited, and the processing performance of the hardware accelerator is reduced.

そこで、本発明は上記問題点に鑑みてなされたもので、サーバと連携してデータベースの集約演算の性能を向上させるハードウェアを提供することを目的とする。   Therefore, the present invention has been made in view of the above problems, and an object of the present invention is to provide hardware that improves the performance of database aggregation operations in cooperation with a server.

本発明は、プロセッサと、メモリと、を含むサーバと、前記サーバに接続されてデータベース処理を行うアクセラレータと、前記アクセラレータに接続されてデータベースを格納するストレージ装置と、を有する計算機システムであって、前記サーバは、クエリを受け付けてデータベースコマンドを生成し、処理対象のデータベースの範囲と、前記データベースの範囲を分割してひとつのデータベースコマンドで処理する単位サイズを決定して、前記アクセラレータに指令するサーバコマンド処理部と、前記アクセラレータの出力を集計して前記クエリに対する処理結果を生成する再集約部と、を有し、前記アクセラレータは、前記サーバコマンド処理部からの指令に基づいて、前記単位サイズで前記ストレージ装置からデータベースの処理対象データを読み込み、前記処理対象データを所定の処理単位に分轄して、前記所定の処理単位ごとにグルーピング処理と、スタッキング処理と、集約処理とを含むデータベース処理を実行して集約結果を出力するデータベース処理部を有し、前記再集約部は、前記処理対象のデータベースの範囲についての集約結果を前記アクセラレータから受け付けると、当該集約結果を集計して前記クエリに対する処理結果として生成する。   The present invention is a computer system having a server including a processor, a memory, an accelerator connected to the server for database processing, and a storage device connected to the accelerator for storing a database. The server receives a query, generates a database command, determines a database range to be processed and a unit size to be processed by one database command by dividing the database range, and instructs the accelerator A command processing unit, and a re-aggregation unit that aggregates the output of the accelerator and generates a processing result for the query, and the accelerator has the unit size based on a command from the server command processing unit. Database processing from the storage device The processing target data is divided into predetermined processing units, database processing including grouping processing, stacking processing, and aggregation processing is executed for each predetermined processing unit, and an aggregation result is output. Having a database processing unit, the re-aggregation unit, when receiving an aggregation result for the range of the database to be processed from the accelerator, aggregates the aggregation result and generates it as a processing result for the query.

本発明によれば、サーバとアクセラレータが協調してデータベース処理を実行することにより、サーバの負荷軽減とアクセラレータのデータベース処理性能を向上させることができる。また、アクセラレータは、データベースコマンド単位で集約処理を実行し、サーバは、複数のデータベースコマンドに対する集約結果の再集約処理を行うことで、データベース処理システムの処理性能を向上することができる。   According to the present invention, the server and the accelerator execute database processing in cooperation, thereby reducing the load on the server and improving the database processing performance of the accelerator. In addition, the accelerator executes the aggregation process in units of database commands, and the server can improve the processing performance of the database processing system by performing the aggregation process of the aggregation results for a plurality of database commands.

本発明の第1の実施例を示し、データベース処理システムの構成の一例を示すブロック図である。It is a block diagram which shows a 1st Example of this invention and shows an example of a structure of a database processing system. 本発明の第1の実施例を示し、FPGAの構成の一例を示すブロック図である。1 is a block diagram illustrating an example of a configuration of an FPGA according to a first embodiment of this invention. FIG. 本発明の第1の実施例を示し、データベースに対するクエリと処理内容の一例を示す図である。It is a figure which shows the 1st Example of this invention and shows an example of the query with respect to a database, and a processing content. 本発明の第1の実施例を示し、データベースに対するデータベースコマンドの一例を示す図である。It is a figure which shows a 1st Example of this invention and shows an example of the database command with respect to a database. 本発明の第1の実施例を示し、DBサーバのコマンド発行とFPGAのコマンド処理の一例を示す図である。It is a figure which shows the 1st Example of this invention and shows an example of command issuing of DB server, and command processing of FPGA. 本発明の第1の実施例を示し、データベースのページフォーマットの一例を示す図である。It is a figure which shows 1st Example of this invention and shows an example of the page format of a database. 本発明の第1の実施例を示し、FPGAのデータベース処理部の構成の一例を示すブロック図である。It is a block diagram which shows the 1st Example of this invention and shows an example of a structure of the database process part of FPGA. 本発明の第1の実施例を示し、FPGAで行われるパイプライン処理の一例を示すタイミングチャートである。It is a timing chart which shows a 1st Example of this invention and shows an example of the pipeline process performed by FPGA. 本発明の第1の実施例を示し、FPGAの各処理における出力データ量の一例を示す図である。It is a figure which shows the 1st Example of this invention and shows an example of the output data amount in each process of FPGA. 本発明の第1の実施例を示し、FPGAの処理とサーバの処理の一例を示す図である。It is a figure which shows a 1st Example of this invention and shows an example of a process of FPGA and a process of a server. 本発明の第1の実施例を示し、グルーピング列のグルーピングの手法の一例を示す図である。It is a figure which shows the 1st Example of this invention and shows an example of the method of grouping of a grouping row | line | column. 本発明の第1の実施例を示し、グルーピング処理の一例を示すフローチャートである。It is a flowchart which shows a 1st Example of this invention and shows an example of a grouping process. 本発明の第1の実施例を示し、スタッキング演算による固定小数点データの格納方法の一例を示す図である。It is a figure which shows the 1st Example of this invention and shows an example of the storage method of fixed point data by a stacking calculation. 本発明の第1の実施例を示し、スタッキング演算用レジスタの一例を示すブロック図である。FIG. 3 is a block diagram illustrating an example of a stacking calculation register according to the first embodiment of this invention. 本発明の第1の実施例を示し、スタッキング処理の一例を示すフローチャートである。It is a flowchart which shows a 1st Example of this invention and shows an example of a stacking process. 本発明の第1の実施例を示し、スタッキング演算の一例を示す図である。It is a figure which shows the 1st Example of this invention and shows an example of a stacking calculation. 本発明の第1の実施例を示し、スタッキング演算で使用されるコマンドの一例を示す図である。It is a figure which shows a 1st Example of this invention and shows an example of the command used by a stacking calculation. 本発明の第1の実施例を示し、集約結果の一例を示す図である。It is a figure which shows the 1st Example of this invention and shows an example of an aggregation result. 本発明の第1の実施例を示し、集約処理の一例を示すタイミングチャートである。It is a timing chart which shows a 1st Example of this invention and shows an example of an aggregation process. 本発明の第1の実施例を示し、シノニムのフォーマットの一例を示す図である。It is a figure which shows the 1st Example of this invention and shows an example of the format of a synonym. 本発明の第1の実施例を示し、データベースサーバで行われる処理の一例を示すフローチャートである。It is a flowchart which shows a 1st Example of this invention and shows an example of the process performed by a database server. 本発明の第1の実施例を示し、DBサーバによる再集約処理の一例を示す図である。It is a figure which shows the 1st Example of this invention and shows an example of the re-aggregation process by DB server. 本発明の第1の実施例を示し、ハッシュテーブルの一例を示す図である。It is a figure which shows 1st Example of this invention and shows an example of a hash table. 本発明の第1の実施例を示し、グルーピング列テーブルの一例を示す図である。It is a figure which shows 1st Example of this invention and shows an example of a grouping row | line | column table. 本発明の第1の実施例を示し、グループハッシュテーブルの一例を示す図である。It is a figure which shows 1st Example of this invention and shows an example of a group hash table. 本発明の第2の実施例を示し、シノニム多発時のデータサイズを縮小する例を示す図である。It is a figure which shows the 2nd Example of this invention and shows the example which reduces the data size at the time of synonym frequent occurrence.

以下、本発明の実施形態について添付図面を用いて説明する。   Embodiments of the present invention will be described below with reference to the accompanying drawings.

図1は、本発明に係るデータベース処理機能を有するFPGA(Field Programable Grid Array)2及びデータベース(以下DB)30を格納するストレージ装置3と、データベース管理システム(DataBase Manaagement System、以下DBMSとする)20が稼働するデータベースサーバ(以下、DBサーバ)1と、を含むデータベースシステムの一例を示すブロック図である。   1 shows a storage device 3 for storing a field programmable grid array (FPGA) 2 having a database processing function according to the present invention and a database (hereinafter referred to as DB) 30, and a database management system (hereinafter referred to as a DBMS) 20. 1 is a block diagram showing an example of a database system including a database server (hereinafter, referred to as a DB server) 1 on which is operated.

DBサーバ1は、演算を実行するホストCPU11と、プログラムやデータを格納するホストメモリ12と、PCIスイッチ4を介してハードウェアアクセラレータとしてのFPGA2及びストレージ装置3に接続されるホストインターフェース13と、を含む。また、ホストインターフェース13は、PCIあるいはPCIexpressに準拠したインターフェースである。   The DB server 1 includes a host CPU 11 that executes arithmetic operations, a host memory 12 that stores programs and data, and a host interface 13 that is connected to the FPGA 2 as a hardware accelerator and the storage device 3 via the PCI switch 4. Including. The host interface 13 is an interface conforming to PCI or PCI express.

DBサーバ1では、ホストメモリ12にロードされたDBMS20がホストCPU11によって実行され、図示しないクライアント計算機からのアクセス要求(クエリ)に応じて、FPGA2にデータベースコマンドを発行する。   In the DB server 1, the DBMS 20 loaded in the host memory 12 is executed by the host CPU 11 and issues a database command to the FPGA 2 in response to an access request (query) from a client computer (not shown).

ストレージ装置3に搭載されたFPGA2は、SRAM200に加えてCPU126を含み、データベースコマンドに基づいてデータベース処理(フィルタ処理、グルーピング処理、プロジェクション処理、集約処理等)を実行するデータベース処理部250を有するハードウェアアクセラレータとして機能する。なお、FPGA2とストレージ装置3が独立して構成されて、それぞれがPCIスイッチ4に接続される構成であっても良い。   The FPGA 2 mounted on the storage device 3 includes a CPU 126 in addition to the SRAM 200, and includes a database processing unit 250 that executes database processing (filter processing, grouping processing, projection processing, aggregation processing, etc.) based on database commands. Functions as an accelerator. Note that the FPGA 2 and the storage device 3 may be configured independently, and each may be connected to the PCI switch 4.

ストレージ装置3は、DB30を格納する記憶媒体としてSSD137とDRAM136とを有し、これらの記憶媒体を制御する制御部129は、SSDインターフェース130と、DRAMインターフェース131の2つが含まれる。   The storage device 3 includes an SSD 137 and a DRAM 136 as storage media for storing the DB 30, and a control unit 129 that controls these storage media includes an SSD interface 130 and a DRAM interface 131.

ストレージ装置3とFPGA2は、SSDインターフェース130及びDRAMインターフェース131で接続される。   The storage device 3 and the FPGA 2 are connected by an SSD interface 130 and a DRAM interface 131.

本実施例1のストレージ装置3では、不揮発性記憶媒体のSSD137にDB30を格納しておき、制御部129は、処理対象のDB30の範囲についてSSD137からDRAM136に読み込んでおく。   In the storage apparatus 3 according to the first embodiment, the DB 30 is stored in the SSD 137 of the nonvolatile storage medium, and the control unit 129 reads the range of the DB 30 to be processed from the SSD 137 into the DRAM 136.

そして、FPGA2は、SSD137に比して読み出し速度が高速なDRAM136から所定の処理サイズ(例えば、数メガバイト)ずつデータを読み込むことで、SSD137の読み出し速度の制限を受けることなく、DRAM136からDB30の処理対象となるデータを高速に読み出すことができる。   The FPGA 2 reads data from the DRAM 136, which has a higher reading speed than the SSD 137, by a predetermined processing size (for example, several megabytes), so that the processing from the DRAM 136 to the DB 30 is not limited by the reading speed of the SSD 137. The target data can be read at high speed.

ただし、本発明では、DB30の処理対象の部分のサイズが、FPGA2が演算処理を行う単位よりも大である。すなわち、DB30の処理対象の部分を一旦DRAM136へ読み込んだ後、DRAM136から所定のサイズずつFPGA2へデータを入力する。   However, in the present invention, the size of the processing target portion of the DB 30 is larger than the unit in which the FPGA 2 performs arithmetic processing. That is, after a portion to be processed in the DB 30 is once read into the DRAM 136, data is input from the DRAM 136 to the FPGA 2 by a predetermined size.

<DBMS>
次に、DBMS20について説明する。DBサーバ1で稼働するDBMS20には、結果格納領域115と、メッセージ格納領域116と、シノニム格納領域117と、再集約モジュール118と、グルーピング及び集約モジュール120と、コマンド生成部103と、コマンド格納部123と、要求コマンドキュー121と、完了コマンドキュー122とを含む。グルーピング及び集約モジュール120には、FPGA2の集約処理でシノニムが発生したDB30のグルーピングを再度行うための、グルーピングと集約のモジュールを有する。
<DBMS>
Next, the DBMS 20 will be described. The DBMS 20 operating on the DB server 1 includes a result storage area 115, a message storage area 116, a synonym storage area 117, a re-aggregation module 118, a grouping and aggregation module 120, a command generation unit 103, and a command storage unit. 123, a request command queue 121, and a completion command queue 122. The grouping and aggregation module 120 includes a grouping and aggregation module for re-grouping the DB 30 in which a synonym is generated in the FPGA 2 aggregation processing.

DBMS20は、数TBまたは数GBのDB30を数MB毎に分割して、FPGA2にDB30の集約処理を指令する。このため、DBサーバ1は、DB30のうち集約処理の対象となるデータの範囲と、集約処理の内容からデータベースコマンドを生成する。   The DBMS 20 divides the DB 30 of several TB or several GB into several MBs, and instructs the FPGA 2 to perform aggregation processing of the DB 30. For this reason, the DB server 1 generates a database command from the range of data targeted for aggregation processing in the DB 30 and the contents of the aggregation processing.

DBMS20は、クライアント計算機から受信したアクセス要求からコマンド生成部103でデータベースコマンドを生成して、コマンド格納部123に格納する。また、コマンド生成部103はコマンド格納部123に格納したデータベースコマンドの格納位置を示すコマンドポインタを要求コマンドキュー121に設定する。DBMS20は、要求コマンドキュー121に入力されたコマンドポインタに対応するデータベースコマンドを順次FPGA2へ投入する。これらのコマンド生成部103、コマンド格納部123、要求コマンドキュー121がサーバコマンド処理モジュール1030を構成する。   The DBMS 20 generates a database command from the access request received from the client computer by the command generation unit 103 and stores it in the command storage unit 123. Further, the command generation unit 103 sets a command pointer indicating the storage position of the database command stored in the command storage unit 123 in the request command queue 121. The DBMS 20 sequentially inputs database commands corresponding to the command pointers input to the request command queue 121 to the FPGA 2. These command generation unit 103, command storage unit 123, and request command queue 121 constitute a server command processing module 1030.

DBMS20は、FPGA2から受信したデータベースコマンドの集約結果を受け付けて、結果格納領域115に格納する。DBMS20は、FPGA2が実行したデータベースコマンドで集約したグループの数と、シノニムが発生した数と、演算オーバーフローの情報等をメッセージとして受け付けて、メッセージ格納領域116に格納する。DBMS20は、FPGA2のデータベースコマンドの実行でシノニムが発生した情報(シノニム114)を受け付けた場合には、シノニム格納領域117に格納する。また、DBMS20は、FPGA2から実行完了の通知を受信したデータベースコマンドを、完了コマンドキュー122へ格納する。   The DBMS 20 accepts the database command aggregation result received from the FPGA 2 and stores it in the result storage area 115. The DBMS 20 accepts, as a message, the number of groups aggregated by the database command executed by the FPGA 2, the number of synonyms generated, information on operation overflow, and the like, and stores them in the message storage area 116. When the DBMS 20 receives the information (synonym 114) in which the synonym is generated by executing the database command of the FPGA 2, the DBMS 20 stores it in the synonym storage area 117. Further, the DBMS 20 stores the database command that has received the notification of execution completion from the FPGA 2 in the completion command queue 122.

<FPGA>
図2は、FPGA2の構成の一例を示すブロック図である。FPGA2は、データベースコマンドに基づいてデータベース処理を制御するCPU126と、データベース処理を行うハードウェアの機能ブロックを有する。
<FPGA>
FIG. 2 is a block diagram illustrating an example of the configuration of the FPGA 2. The FPGA 2 includes a CPU 126 that controls database processing based on a database command, and hardware functional blocks that perform database processing.

FPGA2のデータベース処理部250を構成する機能ブロックは、DB30のうち処理対象データをDRAM136から読み込むデータ読み込み部(以下、DATA I/F)105と、処理対象データについてフィルタ処理を実施するフィルタ処理部(以下、Filter)106−0、106−1と、処理対象データについてフィルタ処理を実施するフィルタ処理部(以下、Filter)106−0、106−1と、処理対象データについて射影処理を実施するプロジェクション処理部(以下、Projection)107−0、107−1と、フィルタ処理と射影処理の結果についてデータのグルーピング(グループ化)を行うグルーピング処理部(以下、Grouping)108−0、108−1と、フィルタ処理と射影処理の結果について演算を行うスタック処理部(以下、Stacking)109−0、109−1と、グループ化及び演算の結果を集約する集約処理部(以下、Aggregation)111、とを含む。   The functional blocks constituting the database processing unit 250 of the FPGA 2 include a data reading unit (hereinafter, DATA I / F) 105 that reads processing target data from the DRAM 136 in the DB 30, and a filter processing unit that performs filtering processing on the processing target data ( Hereinafter, Filter) 106-0 and 106-1, filter processing units (hereinafter referred to as Filter) 106-0 and 106-1 that perform filter processing on the processing target data, and projection processing that performs projection processing on the processing target data. Sections (hereinafter referred to as “Projections”) 107-0 and 107-1, grouping processing sections (hereinafter referred to as “Grouping”) 108-0 and 108-1 that perform data grouping (grouping) on the results of the filter processing and the projection processing, and filters Processing and projection Stack processing unit about the results performs calculation (hereinafter, Stacking) includes a 109-0,109-1, aggregation processing unit that aggregates the results of grouping and operation (hereinafter, Aggregation) 111, and.

FPGA2のCPU126は、コマンドキュー124からコマンドポインタを取得し、DMA(図示省略)を起動してDBサーバ1のコマンド格納部123からコマンドレジスタ104へデータベースコマンドを転送する。   The CPU 126 of the FPGA 2 acquires a command pointer from the command queue 124, activates DMA (not shown), and transfers the database command from the command storage unit 123 of the DB server 1 to the command register 104.

次に、FPGA2のCPU126は、SSD137からDRAM136にデータベースコマンドで指定されたDB30の処理対象部分のデータを転送する。DB30の処理単位であるページデータがDRAM136に格納されると、CPU126はレジスタ104に集約処理開始の信号を書き込む。   Next, the CPU 126 of the FPGA 2 transfers the data of the processing target portion of the DB 30 designated by the database command from the SSD 137 to the DRAM 136. When page data, which is a processing unit of DB 30, is stored in the DRAM 136, the CPU 126 writes an aggregation processing start signal in the register 104.

次に、CPU126は、DRAMインターフェース131からDATAインターフェース105にDRAM136のデータ転送を開始する。DRAMインターフェース131は、データインターフェース105の、4ブロックに分割されたSRAM D0〜D3(201〜204)に、DB30のページデータをそれぞれ格納する。なお、SRAM D0〜D3(201〜204)は、図1に示したFPGA2のSRAM200の所定の領域を割り当てたものである。なお、以下で説明する他のSRAM P0、P1、G0についてもSRAM200の所定の領域を割り当てたものである。   Next, the CPU 126 starts data transfer of the DRAM 136 from the DRAM interface 131 to the DATA interface 105. The DRAM interface 131 stores the page data of the DB 30 in the SRAMs D0 to D3 (201 to 204) divided into four blocks of the data interface 105, respectively. Note that the SRAMs D0 to D3 (201 to 204) are assigned with predetermined areas of the SRAM 200 of the FPGA 2 shown in FIG. It should be noted that other SRAMs P0, P1, and G0 described below are assigned predetermined areas of the SRAM 200.

DATAインターフェース105に格納されたDB30のページデータは、フィルタ処理とプロジェクション処理を行うパイプライン処理へページ単位で投入される。このページ単位のパイプライン処理は、Filter#0(106−0)とProjection#0(107−0)のパイプラインと、Filter#1(106−1)と、Projection#1(107−1)の2段のパイプラインで構成した例を示す。なお、Filter#0(106−0)と、Filter#1(106−1)の総称はFilter106として示す。他の構成要素も同様である。   The page data of the DB 30 stored in the DATA interface 105 is input on a page-by-page basis to pipeline processing that performs filtering processing and projection processing. This page-by-page pipeline processing includes the pipelines of Filter # 0 (106-0) and Projection # 0 (107-0), Filter # 1 (106-1), and Projection # 1 (107-1). An example of a two-stage pipeline is shown. The generic name of Filter # 0 (106-0) and Filter # 1 (106-1) is shown as Filter 106. The same applies to other components.

ページ単位のパイプライン処理の結果は、グルーピング処理とスタッキング処理の並列処理へ投入される。この並列処理は、Projection#0(107−0)が出力する行データをGrouping#0(108−0)とStacking#0(109−0)で並列処理し、Projection#1(107−1)が出力する行データをGrouping#1(108−1)とStacking#1(109−1)で並列処理する。   The result of page-by-page pipeline processing is input to parallel processing of grouping processing and stacking processing. In this parallel processing, row data output by Projection # 0 (107-0) is processed in parallel by Grouping # 0 (108-0) and Stacking # 0 (109-0), and Projection # 1 (107-1) The row data to be output are processed in parallel by Grouping # 1 (108-1) and Stacking # 1 (109-1).

Arbiter110は、Grouping#0(108−0)とStacking#0(109−0)の結果と、Grouping#1(108−1)とStacking#1(109−1)の結果と、を順次受け付けて、Aggregation(111)に入力する。   The Arbiter 110 sequentially receives the results of Grouping # 0 (108-0) and Stacking # 0 (109-0), and the results of Grouping # 1 (108-1) and Stacking # 1 (109-1), Input to Aggregation (111).

Aggregation111は、グルーピング処理とスタッキング処理の並列処理の結果を入力としてデータベースコマンドで設定された集約処理を実行し、集約結果112と、メッセージ113と、シノニム114と、完了コマンド(1コマンド処理完了通知)138とを出力する。これら、集約結果112と、メッセージ113と、シノニム114及び完了コマンド138の出力は、PCIスイッチ4を介してDBサーバ1に送信される。   The Aggregation 111 executes the aggregation process set by the database command with the result of the parallel processing of the grouping process and the stacking process as an input, and executes the aggregation process 112, the message 113, the synonym 114, and the completion command (1 command process completion notification). 138 is output. The output of the aggregation result 112, the message 113, the synonym 114, and the completion command 138 is transmitted to the DB server 1 via the PCI switch 4.

DBサーバ1のDBMS20は、後述するように、完了コマンドキュー122に格納された完了コマンド138と、結果格納領域115の集約結果と、シノニム格納領域117を用いて、再集約モジュール118による再集約と、シノニムが発生したデータについてグルーピング及び集約モジュール120によるグルーピングと集約処理を行う。DBサーバ1は、この処理を複数回(データベースサイズ/一度のコマンドでFPGA2が処理するデータサイズ=ページ単位)まで繰り返して、全てのDB30を処理する。   The DBMS 20 of the DB server 1 performs re-aggregation by the re-aggregation module 118 using the completion command 138 stored in the completion command queue 122, the aggregation result of the result storage area 115, and the synonym storage area 117, as will be described later. Then, grouping and aggregation processing by the grouping and aggregation module 120 is performed on the data in which the synonym is generated. The DB server 1 processes all the DBs 30 by repeating this processing a plurality of times (database size / data size processed by the FPGA 2 with one command = page unit).

なお、グルーピング及び集約モジュール120は、シノニム格納領域117にシノニムの情報が書き込まれたときに処理を実行し、グルーピング及び集約処理を行ったデータを再集約モジュール118へ出力する。   The grouping / aggregation module 120 executes processing when synonym information is written in the synonym storage area 117, and outputs the grouped and aggregated data to the re-aggregation module 118.

再集約モジュール118は、結果格納領域115の集約結果とグルーピング及び集約モジュール120の出力に基づいて、グルーピング化列毎に集約結果を集計してクエリの結果を応答する。なお、グルーピング化列は、後述するように、処理対象データの複数の列を行方向で結合し、ハッシュ値の演算対象となるデータである。   The re-aggregation module 118 aggregates the aggregation results for each grouping column based on the aggregation result in the result storage area 115 and the output of the grouping and aggregation module 120, and responds to the query result. As will be described later, the grouping column is data that is a hash value calculation target by combining a plurality of columns of processing target data in the row direction.

図3は、DB30に対するクエリと処理内容の一例を示す図である。図3の例では、DBサーバ1が受信するクエリの一例としてとしてDB30のベンチマークTPC―H Query3を示している。   FIG. 3 is a diagram illustrating an example of a query and processing content for the DB 30. In the example of FIG. 3, the benchmark TPC-H Query 3 of the DB 30 is shown as an example of the query received by the DB server 1.

図3のQueryに出現するselect文がProjection処理301であり、Queryにより取り出すデータ列を記している。図2のFPGA2において、Projection(プロジェクション処理部)#0(107−0)及びProjection#1(107−1)がProjection処理301を行う。   A select statement appearing in the query of FIG. 3 is the projection process 301, which describes a data string to be extracted by the query. In the FPGA 2 of FIG. 2, Projection (projection processing unit) # 0 (107-0) and Projection # 1 (107-1) perform the Projection process 301.

図3のQueryに出現するWhere文がFiltering処理302であり、Where文の条件に一致した行を抽出する。図2のFPGA2において、Filter(フィルタ処理部)#0(106−0)及びFilter#1(106−1)がFiltering処理302を行う。   The WHERE statement that appears in the query of FIG. 3 is the filtering process 302, and a line that matches the condition of the WHERE statement is extracted. In the FPGA 2 of FIG. 2, Filter (filter processing unit) # 0 (106-0) and Filter # 1 (106-1) perform the filtering process 302.

図3のQueryに出現するGroup by文がGrouping処理303であり、Groupingで指定した列によりグルーピングを行う。図2のFPGA2において、Grouping(グルーピング処理部)#0(108−0)及びGrouping#1(108−1)がGrouping処理303を行う。   A Group by statement appearing in the query shown in FIG. 3 is a grouping process 303, and grouping is performed by a column designated by the grouping. In the FPGA 2 of FIG. 2, the Grouping (grouping processing unit) # 0 (108-0) and the Grouping # 1 (108-1) perform the Grouping process 303.

図3のQueryに出現するSum文がAggregation処理305であり、集約演算を行う。図2のFPGA2において、Aggregation111が行う集約演算処理305には、合計、最大値、最小値、カウント等が含まれる。   The Sum statement that appears in the query of FIG. 3 is the aggregation process 305, and performs an aggregation operation. In the FPGA 2 of FIG. 2, the aggregation calculation processing 305 performed by the aggregation 111 includes a total, a maximum value, a minimum value, a count, and the like.

図3のQueryに出現するSumの()内がStacking処理306であり、列に対する数値演算を行う。図2のFPGA2において、Stacking(スタッキング処理部)#0(109−0)及びStacking#1(109−1)がStacking処理306を行う。Stacking#0(109−0)、Stacking#1(109−1)が行う数値演算には、加算、減算、乗算が含まれる。尚、行の並べ替えを行うOrder byがordering処理304であり、この処理はDBサーバ1で実行するものとする。   The inside of () of the Sum that appears in the query of FIG. In the FPGA 2 of FIG. 2, Stacking (stacking processing unit) # 0 (109-0) and Stacking # 1 (109-1) perform the Stacking process 306. Numerical operations performed by Stacking # 0 (109-0) and Stacking # 1 (109-1) include addition, subtraction, and multiplication. Note that Order by for rearranging rows is the ordering process 304, and this process is executed by the DB server 1.

図4は、FPGA2に対するデータベースコマンドの一例を示す図である。DB30の格納先のSSD137の情報としては、読み出し開始アドレス401と、読み出すデータサイズ402、とが含まれる。また、図示はしないが、ひとつのコマンドでFPGA2が処理するDB30のサイズ(単位サイズ:8MB)を指定しても良い。   FIG. 4 is a diagram illustrating an example of a database command for the FPGA 2. The information of the storage destination SSD 137 of the DB 30 includes a read start address 401 and a read data size 402. Although not shown, the size (unit size: 8 MB) of the DB 30 processed by the FPGA 2 may be specified with one command.

Filtering106の設定情報としては、DB30におけるフィルタ対象列403と、フィルタ条件404とが含まれる。Projection107の設定情報としては、取り出し列405が含まれる。Grouping108の設定情報としては、グルーピング化列406が含まれる。   The setting information of the filtering 106 includes a filter target column 403 and a filter condition 404 in the DB 30. The setting information of the Projection 107 includes an extraction column 405. The grouping column 406 is included as the setting information of the Grouping 108.

Stacking109の設定情報としては、演算対象列407と、演算子408と、直値409とが含まれる。Aggregation(集約処理部)111の設定情報としては、演算子410を含むが含まれる。   The setting information of Stacking 109 includes a calculation target column 407, an operator 408, and a direct value 409. The setting information of the aggregation (aggregation processing unit) 111 includes an operator 410.

図5は、サーバコマンド処理モジュール1030の処理と、FPGA2の集約処理(DATA I/F(105)〜Aggregation111)の関係を示すタイムチャートである。   FIG. 5 is a time chart showing the relationship between the processing of the server command processing module 1030 and the aggregation processing (DATA I / F (105) to Aggregation 111) of FPGA2.

サーバコマンド処理モジュール1030は、DBサーバ1が受信したクエリから、FPGA2が処理する複数(または1以上)のデータベースコマンド(501〜504)を生成し、データベースコマンドをコマンド格納部123に格納する。サーバコマンド処理モジュール1030は、データベースコマンドの格納が完了すると、要求コマンドキュー121にコマンドを格納した領域のポインタを書込み、FPGA2のCPU126に対してドアベルレジスタ(図示省略)を介してデータベースコマンドをスタックしたことを通知(図中の時刻505〜508)する。   The server command processing module 1030 generates a plurality (or one or more) of database commands (501 to 504) to be processed by the FPGA 2 from the query received by the DB server 1, and stores the database commands in the command storage unit 123. When the storage of the database command is completed, the server command processing module 1030 writes the pointer of the area storing the command in the request command queue 121 and stacks the database command on the CPU 126 of the FPGA 2 via the doorbell register (not shown). Is notified (time 505 to 508 in the figure).

CPU126は、図示しないDMAを起動して、要求コマンドキュー121のポインタが指し示すコマンド格納部123のデータベースコマンドを、DBサーバ1からレジスタ104に転送する。   The CPU 126 activates a DMA (not shown) and transfers the database command in the command storage unit 123 indicated by the pointer of the request command queue 121 from the DB server 1 to the register 104.

FPGA2では、上記データベースコマンドの取得と並行して、CPU126がSSD137からDRAM136にDB30の処理対象データを転送する。CPU126は、DB30処理単位のページデータがDRAM136に格納されると、レジスタ104に集約処理開始の信号を書き込み、DRAM136からDATA I/F105にデータ転送を開始し、4面あるSRAM0〜3にDB30のページ単位でデータ(ページデータ)を格納する。   In the FPGA 2, in parallel with the acquisition of the database command, the CPU 126 transfers the processing target data in the DB 30 from the SSD 137 to the DRAM 136. When the page data of the DB30 processing unit is stored in the DRAM 136, the CPU 126 writes an aggregation processing start signal to the register 104, starts data transfer from the DRAM 136 to the DATA I / F 105, and stores the data of the DB30 in the four SRAMs 0 to 3. Data (page data) is stored in units of pages.

DATA I/F105に書き込まれた複数のページデータは、順次Filter106に投入され、Projection107、Grouping108、Stacking109、Aggregation111の各処理部で演算が行われる。   A plurality of page data written in the DATA I / F 105 is sequentially input to the filter 106, and operations are performed in the processing units of the projection 107, the grouping 108, the stacking 109, and the aggregation 111.

FPGA2の各演算が完了すると、CPU126は、DBサーバ1に対して完了コマンド138を発行して、1コマンド処理の完了を通知(図中512、513、514)する。そして、1コマンド処理の完了通知を受信したDBサーバ1は、当該完了通知が指し示すデータベースコマンドを完了コマンドキュー122に登録する。   When each operation of the FPGA 2 is completed, the CPU 126 issues a completion command 138 to the DB server 1 to notify the completion of one command processing (512, 513, and 514 in the figure). The DB server 1 that has received the one-command processing completion notification registers the database command indicated by the completion notification in the completion command queue 122.

DBサーバ1の再集約モジュールは、1コマンド単位の完了通知(512、513、514)を受け取り、結果格納領域115のグルーピング化列を用いて、グループハッシュテーブル119を生成し、グルーピング処理と再集約処理を後述するように行う。   The re-aggregation module of the DB server 1 receives the completion notification (512, 513, 514) for each command, generates the group hash table 119 using the grouping column of the result storage area 115, and performs grouping processing and re-aggregation. Processing is performed as described below.

図6は、DB30のページフォーマットの一例を示す。DB30はページ単位で構成され、ページデータの先頭にページヘッダ601が格納される。ページヘッダ601に続いて行データ602が1行目〜M行目まで順に格納されており、ページデータの終端から順番に行の先頭アドレスを指し示す行ポインタ603が格納される。   FIG. 6 shows an example of the page format of the DB 30. The DB 30 is configured in units of pages, and a page header 601 is stored at the top of the page data. Following the page header 601, row data 602 is stored in order from the first row to the Mth row, and a row pointer 603 indicating the head address of the row is stored in order from the end of the page data.

FPGA2のFilter106と、Projection107は、行ポインタ603と図4に示したデータベースコマンドの設定情報(403、405)を用いて、必要な列データを取得する。   The Filter 106 and the Projection 107 of the FPGA 2 acquire necessary column data using the row pointer 603 and the database command setting information (403, 405) shown in FIG.

図7は、FPGA2のデータベース処理部250の回路構成の詳細な例を示すブロック図である。DRAM136から読み出されたDB30のページデータは、DATA I/F105を介して、SRAM201〜204(SRAM D0〜D3)にページ単位で格納される。   FIG. 7 is a block diagram illustrating a detailed example of the circuit configuration of the database processing unit 250 of the FPGA 2. The page data of the DB 30 read from the DRAM 136 is stored in units of pages in the SRAMs 201 to 204 (SRAMs D0 to D3) via the DATA I / F 105.

SRAM201は一組のSRAMで構成されて、同一のデータを2つのSRAM(例えばD1_0、D1−1)で保持し、並列処理を行うFilter106と、Projection107にそれぞれ同一のデータを供給する。他の、SRAM202〜204も同様である。   The SRAM 201 is composed of a set of SRAMs, holds the same data in two SRAMs (for example, D1_0, D1-1), and supplies the same data to the filter 106 and the projection 107 that perform parallel processing. The same applies to the other SRAMs 202 to 204.

SRAM201〜204からFilter106とProjection107に供給されるデータは、セレクタ707、708、709、710によって選択される。Filter106の処理結果は、Projection107へ入力される。ここで、Filter106は、レジスタ104に設定されたデータベースコマンド(図4)のうちフィルタ対象列403とフィルタ条件404のフィルタ情報に基づいて処理を実行する。同様に、Projection107では、レジスタ104に設定されたプロジェクション情報に基づいて処理を実行する。   Data supplied from the SRAM 201 to 204 to the filter 106 and the projection 107 is selected by selectors 707, 708, 709, and 710. The processing result of the filter 106 is input to the project 107. Here, the filter 106 executes processing based on the filter information in the filter target column 403 and the filter condition 404 in the database command (FIG. 4) set in the register 104. Similarly, the projection 107 executes processing based on the projection information set in the register 104.

Projection107により処理された結果は、DB30の1ページ単位で、SRAM P0(205)と、SRAM P1(206)に格納される。SRAM P0(205)、SRAM P1(206)のProjection結果を用いて、Grouping108−0、108−1と、Stacking109−0、109−1がそれぞれ並列処理を実行する。   The results processed by the Projection 107 are stored in the SRAM P0 (205) and the SRAM P1 (206) in units of one page in the DB 30. Using the projection results of SRAM P0 (205) and SRAM P1 (206), Grouping 108-0 and 108-1 and Stacking 109-0 and 109-1 execute parallel processing, respectively.

Grouping108−0、108−1では、データベースコマンドのグルーピング化列406と、ハッシュテーブル728_0、728_1と、グルーピング列テーブル729_0、729_1を用いて演算が行われる。ハッシュテーブル728には、グルーピング対象のデータのハッシュ値が格納される。グルーピング列テーブル729には、グループ化された列データが格納される。これらのハッシュテーブル728及びグルーピング列テーブル729は、FPGA2のSRAM200内の所定の領域に設定される。   In the Grouping 108-0 and 108-1, the calculation is performed using the grouping column 406 of the database command, the hash tables 728_0 and 728_1, and the grouping column tables 729_0 and 729_1. In the hash table 728, hash values of grouping target data are stored. The grouping column table 729 stores grouped column data. These hash table 728 and grouping column table 729 are set in predetermined areas in the SRAM 200 of the FPGA 2.

Stacking109−0、109−1では、データベースコマンドの演算対象列407、演算子408、直値409に基づいて演算が行われる。   In Stacking 109-0 and 109-1, the calculation is performed based on the calculation target column 407, the operator 408, and the direct value 409 of the database command.

これらのGrouping108とStacking109の出力は、Arbiter110により順次受け付けられ、SRAM G0(207)に書き込まれる。SRAM G0(207)の内容は、Aggregation111の集約演算の結果によって書き換えられる。   The outputs of these Grouping 108 and Stacking 109 are sequentially received by the Arbiter 110 and written to the SRAM G0 (207). The contents of the SRAM G0 (207) are rewritten by the result of the aggregation calculation of the aggregation 111.

Aggregation111は、1コマンドのデータ処理が完了すると、集約結果112と、メッセージ113と、シノニム114とをDBサーバ1に出力する。メッセージ113には、集約したグループの数と、シノニムが発生した数と、演算オーバーフローの情報が格納されている。   When the data processing for one command is completed, the aggregation 111 outputs the aggregation result 112, the message 113, and the synonym 114 to the DB server 1. The message 113 stores the number of aggregated groups, the number of occurrences of synonyms, and operation overflow information.

図8は、FPGA2で行われるパイプライン処理のタイミングチャートを示している。時刻T0(801)においては、DATA I/F105がSRAM D0にページ1(図中P−1)のデータを書き込む。   FIG. 8 shows a timing chart of pipeline processing performed in the FPGA 2. At time T0 (801), the DATA I / F 105 writes the data of page 1 (P-1 in the figure) to the SRAM D0.

時刻T1(802)において、DATA I/F105がSRAM D1にページ2(P−2)のデータを書き込み、Filter106−0、106−1がSRAM D0のデータを用いてFiltering処理を行う。   At time T1 (802), the DATA I / F 105 writes the data of page 2 (P-2) to the SRAM D1, and the filters 106-0 and 106-1 perform the filtering process using the data of the SRAM D0.

時刻T2(803)においては、DATA I/F105がSRAM D2にページ3(P−3)のデータを書き込み、Filter106−0、106−1がSRAM D1のデータ(P−2)を用いてFiltering処理を行い、Projection107−0、107−1がSRAM D0(P−1)のデータを用いてProjeciton処理を行う。Filtering処理とProjeciton処理は、ページデータの行単位で実行される。   At time T2 (803), the DATA I / F 105 writes the data of page 3 (P-3) to the SRAM D2, and the filters 106-0 and 106-1 perform the filtering process using the data (P-2) of the SRAM D1. The Projections 107-0 and 107-1 perform the Projection processing using the data of the SRAM D0 (P-1). The Filtering process and the Projection process are executed for each line of page data.

また、プロジェクション処理の1行目のデータがSRAM P0に書き込まれる時刻T21においては、Grouping108−0、108−1と、Stacking109−0、109−1が開始される。これにより、Projection処理と並行して、SRAM P0に書き込まれたプロジェクション処理の結果に基づいてGrouping処理とStacking処理が並列して実行される。なお、他のGrouping処理とStacking処理も、SRAM P0、P1に1行のデータが書き込まれるまで待機する。   Further, at time T21 when data in the first row of the projection processing is written into the SRAM P0, Grouping 108-0 and 108-1 and Stacking 109-0 and 109-1 are started. Thereby, in parallel with the projecting process, the grouping process and the stacking process are executed in parallel based on the result of the projection process written in the SRAM P0. Other Grouping processing and Stacking processing also wait until one row of data is written in the SRAMs P0 and P1.

SRAM P0、P1にデータが書き込まれると、Aggregation111がAggregation処理を行い、SRAM G0に集約処理の結果を書き込む。   When data is written to the SRAMs P0 and P1, the aggregation 111 performs an aggregation process and writes the result of the aggregation process to the SRAM G0.

時刻T3(804)においては、DATA I/F105がSRAM D3にページ4(P−4)のデータを書き込み、Filter(106−0、106−1)がSRAM D2のデータ(P−3)を用いてFiltering処理を行う。また、Projection107−0、107−1がSRAM D1のデータ(P−2)を用いてProjeciton処理を行う。   At time T3 (804), the DATA I / F 105 writes the data of page 4 (P-4) to the SRAM D3, and the Filter (106-0, 106-1) uses the data of the SRAM D2 (P-3). Filtering processing is performed. In addition, the Projections 107-0 and 107-1 perform the Projection process using the data (P-2) of the SRAM D1.

Grouping108−0、108−1と、Stacking109−0、109−1は、Projection処理と並行して、グルーピング処理とスタッキング処理を実行する。そして、グルーピング処理の結果と、スタッキング処理の結果に基づいてAggregation111が集約処理を行い、SRAM G0に集約結果を書き込む。以上のようなタイミングで、FPGA2ではパイプライン処理が実行される。   The Grouping 108-0 and 108-1, and the Stacking 109-0 and 109-1 execute a grouping process and a stacking process in parallel with the Projection process. Then, the aggregation 111 performs an aggregation process based on the result of the grouping process and the result of the stacking process, and writes the aggregation result to the SRAM G0. At the timing described above, the pipeline processing is executed in the FPGA 2.

図9は、コマンド単位で、各処理における出力データ量の変化を示す図である。一回のデータベースコマンドで処理するDB30の処理対象データを図中符号901で示す。   FIG. 9 is a diagram illustrating a change in output data amount in each process in units of commands. The processing target data of the DB 30 processed by a single database command is indicated by reference numeral 901 in the figure.

このDB30の処理対象データ901をFiltering処理すると、フィルタ条件に一致した行データが抽出されて、図中2つの行データ902が処理結果として出力される。   When the filtering processing is performed on the processing target data 901 of the DB 30, row data that matches the filter condition is extracted, and two row data 902 in the figure are output as processing results.

このフィルタリング処理の過程で残る行データ902のデータ量は、処理対象データ901のデータ量の約1/10である。行データ902を入力としてProjection処理を行い、Grouping処理に必要なGrouping列903と、Stacking処理に必要なStacking列904のデータを抽出する。   The data amount of the row data 902 remaining in the process of this filtering process is about 1/10 of the data amount of the processing target data 901. Projection processing is performed using the row data 902 as input, and data in the Grouping column 903 necessary for the Grouping processing and the Stacking column 904 necessary for the Stacking processing are extracted.

このプロジェクション処理の過程で算出される列データ(903、904)のデータ量は、Filtering処理後の行データ902のデータ量の約1/10である。Grouping列903と、Stacking904のデータを用いて、Grouping処理と、Stacking処理を行うとデータ905が得られる。この処理過程で残るデータ905のデータ量は、Projection処理後の列データ(903、904)のデータ量の約1/10である。Grouping処理とStacking処理で得られたデータ905をAggregation処理し、最終的な集約結果906が得られる。   The data amount of the column data (903, 904) calculated in the process of the projection processing is about 1/10 of the data amount of the row data 902 after the filtering processing. Data 905 is obtained by performing the Grouping process and the Stacking process using the Grouping column 903 and the data of the Stacking 904. The data amount of the data 905 remaining in this process is about 1/10 of the data amount of the column data (903, 904) after the projection processing. Data 905 obtained by the Grouping process and the Stacking process is subjected to an aggregation process, and a final aggregation result 906 is obtained.

本実施例のFPGA2では、入力する処理対象データ901に対して、出力する集約結果906のデータ量は約1/1000となる。   In the FPGA 2 of this embodiment, the data amount of the aggregation result 906 to be output is about 1/1000 of the processing target data 901 to be input.

図10は、FPGA2で行われる集約演算ローカル処理とDBサーバ1で行われる集約演算グローバル処理の関係を示す図である。   FIG. 10 is a diagram illustrating a relationship between the aggregate calculation local process performed by the FPGA 2 and the aggregate calculation global process performed by the DB server 1.

DBサーバ1は、サーバコマンド処理モジュール103により、SSD137に格納されている2TBサイズのDB30のデータ1000のうち、1回のデータベースコマンドで処理する処理対象データのサイズを8MBに決定する。そして、DBサーバ1は、1つのデータベースコマンドでFPGA2が8MBの処理対象データ901を処理するようにデータベースコマンド内で指定する(1004)。   The DB server 1 uses the server command processing module 103 to determine that the size of the processing target data to be processed by one database command out of the data 1000 of the DB 30 of 2 TB size stored in the SSD 137 is 8 MB. Then, the DB server 1 designates in the database command that the FPGA 2 processes the processing target data 901 of 8 MB with one database command (1004).

FPGA2は、1つのデータベースコマンドを受け付けて、8MBに分割したDB30の処理対象データ901を処理する。FPGA2は、8MBの処理対象データ901について8KBのページ単位で処理を行う(1005)。   The FPGA 2 accepts one database command and processes the processing target data 901 of the DB 30 divided into 8 MB. The FPGA 2 processes the 8 MB processing target data 901 in units of 8 KB pages (1005).

FPGA2は、1つのデータベースコマンドで8MB分の処理対象データ901について、ページ単位(8KB)でDRAM136から処理対象データ901を読み込んでグルーピング処理とスタッキング処理を実行する。そして、FPGA2はルーピング処理とスタッキング処理の結果に基づいて集約処理を実施する(1006)。   The FPGA 2 reads the processing target data 901 from the DRAM 136 in units of pages (8 KB) for the processing target data 901 for 8 MB with one database command, and executes grouping processing and stacking processing. Then, the FPGA 2 performs aggregation processing based on the results of looping processing and stacking processing (1006).

FPGA2は集約処理が完了すると、後述する図21のように、集約結果のグループの順序が不同な状態で、グルーピング化列と集約結果をDBサーバ1に返信する(1008)。   When the aggregation process is completed, the FPGA 2 returns the grouping column and the aggregation result to the DB server 1 in a state where the order of the group of the aggregation result is not the same as shown in FIG. 21 (1008).

グルーピング化列と集約結果を受け取ったDBサーバ1は、再集約モジュール118がグルーピング化列に基づいてグループハッシュテーブル119を生成し、ハッシュ値の順にデータを並べて、全てのデータベースコマンドに対するグローバル(全ての処理対象データ)の集約処理を実行する。   Upon receiving the grouping column and the aggregation result, the DB server 1 generates a group hash table 119 based on the grouping column by the re-aggregation module 118, arranges the data in the order of hash values, and sets the global (all all database commands). (Processing target data) is aggregated.

図11は、グルーピング化列のグルーピングの手法の一例を示す図である。FPGA2のGrouping108−0、108−1ではグルーピング処理が行われる。このグルーピング処理では、1行の行データに含まれるグルーピング対象の列をグルーピング化列として連結しグルーピング列テーブル729に格納される。   FIG. 11 is a diagram illustrating an example of a grouping method for grouping columns. Grouping processing is performed in the FPGA 108 Grouping 108-0 and 108-1. In this grouping process, columns to be grouped included in one row of data are linked as grouped columns and stored in the grouping column table 729.

図示の例では、1行の行データの、グルーピング化列1、2、3(1101)を連結してグルーピング化データ1102を生成し、グルーピング列テーブル729に格納する。なお、グルーピング化データ1102の各行は、ハッシュ値の演算対象であるグルーピング化列のデータである。   In the illustrated example, grouping data 1102 is generated by concatenating grouping columns 1, 2, 3 (1101) of row data of one row, and stored in the grouping column table 729. Each row of the grouping data 1102 is data of a grouping column that is a hash value calculation target.

そして、Grouping108ではグルーピング化データ1102のグルーピング化列ごとにハッシュ値とグループIDを演算して、各グループを識別する。なお、Grouping108で演算されたハッシュ値とグループIDは、ハッシュテーブル728に格納される。   Then, the Grouping 108 calculates a hash value and a group ID for each grouping column of the grouping data 1102 to identify each group. Note that the hash value and group ID calculated in the grouping 108 are stored in the hash table 728.

図22は、FPGA2内のハッシュテーブル728の一例を示す図である。ハッシュテーブル728は、SRAM200のアドレス2301をハッシュ値とし、1ビットのデータ2302をフラグビットとし、10ビットのデータ2303をハッシュ値に対応するグループIDとする例を示す。   FIG. 22 is a diagram illustrating an example of the hash table 728 in the FPGA 2. The hash table 728 shows an example in which the address 2301 of the SRAM 200 is a hash value, 1-bit data 2302 is a flag bit, and 10-bit data 2303 is a group ID corresponding to the hash value.

ハッシュテーブル728には、グルーピング処理の結果が格納され、グループID(2303)が割り当てられたアドレス2301のフラグビット(2302)には「1」(0b1)が設定される。なお、グループID(2303)は、新たなグループが出現する度に追加される。   The hash table 728 stores the result of the grouping process, and “1” (0b1) is set in the flag bit (2302) of the address 2301 to which the group ID (2303) is assigned. The group ID (2303) is added every time a new group appears.

図23は、FPGA2内のグルーピング列テーブル729の一例を示す図である。グルーピング列テーブル729は、SRAM200のアドレス2401(10ビット)をグループIDとし、64ビットのデータ2402をグルーピング化列とする例を示す。グルーピング列テーブル729は、グループID(2401)に対応したグルーピング化列(2402)が保持される。   FIG. 23 is a diagram illustrating an example of the grouping column table 729 in the FPGA 2. The grouping column table 729 shows an example in which an address 2401 (10 bits) of the SRAM 200 is used as a group ID and 64-bit data 2402 is used as a grouping column. The grouping column table 729 holds a grouping column (2402) corresponding to the group ID (2401).

なお、本実施例1では、256Kbyteのグルーピング化列まで対応可能な例を示し、FPGA2には、例えば、8Byte幅のSRAMを32個搭載する。ハッシュ値とグループID(2401)の対応関係は、上述のハッシュテーブル728で定義される。また、本実施例1では、グループIDの最大値は1024となり、この最大値がハッシュ値を割り当て可能な数となる。   In the first embodiment, an example capable of supporting up to 256 Kbyte grouping columns is shown, and for example, 32 8-byte wide SRAMs are mounted in the FPGA 2. The correspondence between the hash value and the group ID (2401) is defined by the hash table 728 described above. In the first embodiment, the maximum value of the group ID is 1024, and this maximum value is the number that can be assigned a hash value.

なお、ハッシュ値とグループIDの算出については、上記に限定されるものではなく、公知または周知の手法を適用すればよく、処理対象データ901のハッシュ値と、データが所属するグループIDが決定されれば良い。   The calculation of the hash value and the group ID is not limited to the above, and a publicly known or known method may be applied, and the hash value of the processing target data 901 and the group ID to which the data belongs are determined. Just do it.

図12は、グルーピング処理の一例を示すフローチャートである。この処理は、SRAM P0、P1に行の演算結果が書き込まれたときにFPGA2のGrouping108が起動する。   FIG. 12 is a flowchart illustrating an example of the grouping process. In this process, the Grouping 108 of the FPGA 2 is activated when the operation result of the row is written in the SRAMs P0 and P1.

Grouping108は、グルーピング化列(2402)のハッシュ値を算出(1201)する。Grouping108は、算出されたハッシュ値がハッシュテーブル728に登録されているか否かを判定する(1202)。   The Grouping 108 calculates (1201) the hash value of the grouping column (2402). The Grouping 108 determines whether or not the calculated hash value is registered in the hash table 728 (1202).

Grouping108は、算出されたハッシュ値がハッシュテーブル728に登録されていなければ、ステップ1205へ進む。ステップ1205では、Grouping108が、算出されたハッシュ値をハッシュテーブル728へ登録する。この場合、シノニムは発生していないのでステップ1206に進んで、Arbiter110からSRAM G0(207)に書き込まれる。   If the calculated hash value is not registered in the hash table 728, the grouping 108 proceeds to step 1205. In step 1205, the Grouping 108 registers the calculated hash value in the hash table 728. In this case, since no synonym has occurred, the process proceeds to step 1206 and is written from the Arbiter 110 to the SRAM G0 (207).

一方、算出されたハッシュ値が既にハッシュテーブル728に登録されている場合は、ステップ1203へ進む。ステップ1203では、Grouping108が、ハッシュテーブル728において、同一のハッシュ値となったアドレス2301に対応するグルーピング列テーブル729のデータ2402(グルーピング化列)を取得する。Grouping108は算出されたハッシュ値の元のグルーピング化列と、取得したグルーピング化列が異なれば、ステップ1204へ進んでシノニム(ハッシュ値の衝突)と判定する。   On the other hand, if the calculated hash value is already registered in the hash table 728, the process proceeds to step 1203. In step 1203, the Grouping 108 acquires data 2402 (grouping column) of the grouping column table 729 corresponding to the address 2301 having the same hash value in the hash table 728. If the original grouping sequence of the calculated hash value is different from the acquired grouping sequence, the grouping 108 proceeds to step 1204 and determines a synonym (hash value collision).

シノニムの場合は、Aggregation111での集約処理は行われず、シノニムの情報が後述するようにシノニム114としてDBサーバ1へ送信される。なお、シノニムの情報としては、ハッシュ値やグルーピング化列を用いることができる。   In the case of a synonym, the aggregation processing in the aggregation 111 is not performed, and the synonym information is transmitted to the DB server 1 as a synonym 114 as described later. As the synonym information, a hash value or a grouping sequence can be used.

一方、非シノニムの場合は、SRAM G0(207)に書き込まれたGrouping108の結果と、後述のStacking109の結果に基づいてAggregation111で集約処理が行われる。   On the other hand, in the case of a non-synonym, aggregation processing is performed in the aggregation 111 based on the result of the Grouping 108 written in the SRAM G0 (207) and the result of the Stacking 109 described later.

図13は、スタッキング演算における、固定小数点のデータ格納方法の一例を示す図である。Stacking109が、固定小数点を容易に演算できるように、DB30への格納形式を整数としている。   FIG. 13 is a diagram illustrating an example of a fixed-point data storage method in the stacking calculation. The storage format in the DB 30 is an integer so that the Stacking 109 can easily calculate a fixed point.

図13においては、スタッキング演算用の列は2つあり、N行目の第一列には、0.08を100倍して8としたデータ1031を格納する。N行目の第二列には、0.5を10倍して5としたデータ1302を格納する。   In FIG. 13, there are two columns for stacking calculation, and data 1031 is stored in the first column of the Nth row by multiplying 0.08 by 100. In the second column of the Nth row, data 1302 in which 0.5 is multiplied by 10 to be 5 is stored.

Stacking109は、固定小数点を意識することなく、整数として演算を行い、DBサーバ1が、結果格納領域115に格納された集約結果の値の桁をもとに戻して最終的な集約結果とする。なお、固定小数点の位置についてはDBMS20で予め設定されたものである。   The Stacking 109 performs an operation as an integer without regard to the fixed decimal point, and the DB server 1 restores the digit of the value of the aggregation result stored in the result storage area 115 to obtain the final aggregation result. Note that the position of the fixed point is preset by the DBMS 20.

図14は、スタッキング演算用レジスタ及びSRAMの構成を示す図である。この構成は、Stacking109−0、109−1のハードウェア構成を示す。   FIG. 14 is a diagram illustrating a configuration of the stacking calculation register and the SRAM. This configuration shows the hardware configuration of Stacking 109-0 and 109-1.

スタッキング処理部を構成するStacking109は、後述するように、スタッキング演算は、値と演算子を積み上げて、演算子が出現すると直近の2つの値に対する演算を実行する。そこで、値を保持する回路の構成を2つのレジスタREG0(1401)、REG1(1402)と1つのSRAM(1403)とする。なお、SRAM(1403)は、図1に示したSRAM200内の所定の領域を示す。   As will be described later, the Stacking 109 constituting the stacking processing unit accumulates values and operators, and executes an operation on the two most recent values when the operators appear. Therefore, the configuration of the circuit that holds the values is assumed to be two registers REG0 (1401) and REG1 (1402) and one SRAM (1403). The SRAM (1403) indicates a predetermined area in the SRAM 200 shown in FIG.

図15は、FPGA2のStacking109で実行されるスタッキング演算の一例を示すフローチャートである。   FIG. 15 is a flowchart illustrating an example of the stacking calculation executed in the Stacking 109 of the FPGA 2.

Stacking109−0、109−1は、Projection107がSRAM P0、P1(205、206)に演算結果を書き込むと処理を開始する(1501)。   The Stacking 109-0 and 109-1 start processing when the Projection 107 writes the operation result in the SRAMs P0 and P1 (205 and 206) (1501).

スタッキング演算を開始(1501)すると、Stacking109はレジスタ104からデータベースコマンドからスタック演算コマンドを1つ受け取り(1502)、コマンドの内容が数値か演算子であるかを判定する(1503)。   When the stacking operation is started (1501), the Stacking 109 receives one stack operation command from the database command from the register 104 (1502), and determines whether the content of the command is a numerical value or an operator (1503).

ステップ1503の判定において、コマンドの内容がProjection107の出力、もしくは、直値であれば、数値の格納先を判定するステップ1504に進む。ステップ1504において、Stacking109は、図14のスタックレジスタ1401、1402にデータが格納済みであれば、SRAM1403にREG0(1401)のデータを書込、REG1(1402)の値をREG0(1401)に書き込み、ステップ1503の入力データをREG1(1402)に書き込む。   If it is determined in step 1503 that the content of the command is the output of the projection 107 or a direct value, the process proceeds to step 1504 for determining the storage location of the numerical value. In step 1504, the Stacking 109 writes the data of REG0 (1401) to the SRAM 1403 and writes the value of REG1 (1402) to REG0 (1401) if the data has already been stored in the stack registers 1401 and 1402 of FIG. The input data of step 1503 is written into REG1 (1402).

ステップ1504の判定において、スタックレジスタ1401、1402にデータが格納済みでなければ、ステップ1509へ進んで、Stacking109は、REG1(1402)のデータをREG0(1401)に書き込み、ステップ1503の入力データをREG1(1402)に書き込む。   If it is determined in step 1504 that the data has not been stored in the stack registers 1401 and 1402, the process proceeds to step 1509, and Stacking 109 writes the data of REG1 (1402) to REG0 (1401), and the input data of step 1503 is REG1. Write to (1402).

ステップ1503の判定において、スタック演算コマンドの内容が演算子であれば、Stacking109は、REG0(1401)、REG1(1402)の出力をスタック演算コマンドによって演算し、演算結果をREG1(1402)に書き戻す。   If it is determined in step 1503 that the content of the stack operation command is an operator, the Stacking 109 operates the outputs of REG0 (1401) and REG1 (1402) using the stack operation command, and writes the operation result back to REG1 (1402). .

さらに、SRAM(1403)にデータが存在すれば、Stacking109はSRAM(1403)からREG0(1401)にデータを書き込む。データの書き込みが完了すると、Stacking109は、レジスタ104を参照して、次のスタック演算コマンドが存在するか否かの判定を行う(1505)。   Furthermore, if data exists in the SRAM (1403), the Stacking 109 writes data from the SRAM (1403) to the REG0 (1401). When the data writing is completed, the Stacking 109 refers to the register 104 and determines whether or not there is a next stack operation command (1505).

ステップ1505において、スタック演算コマンドの内容が終了コマンドでなければ、Stacking109は、ステップ1502に戻って上記処理を繰り返す。一方、ステップ1505において、次のスタック演算コマンドが終了コマンドであれば、Stacking109はスタッキング演算を終了(1506)する。   In step 1505, if the content of the stack operation command is not an end command, the stacking 109 returns to step 1502 and repeats the above processing. On the other hand, if the next stack operation command is an end command in step 1505, the Stacking 109 ends the stacking operation (1506).

上記処理によって、プロジェクション処理の結果がSRAM205、206へ書き込まれると、Stacking109によってスタッキング処理が実行されて、SRAM G0(207)へ書き込まれる。   When the result of the projection processing is written to the SRAMs 205 and 206 by the above processing, the stacking processing is executed by the Stacking 109 and written to the SRAM G0 (207).

図16Aは、スタッキング演算の一例を示す図である。また、図16Bは、スタッキング演算で使用されるコマンドの一例を示す図である。図16Aは、横軸を時刻としてスタッキング処理部109へ入力されるスタック演算コマンド1602、1605〜1608と、レジスタ1401、1402の状態を示す。スタック演算コマンド1605〜1608の内容は、図16Bのコード1612に対応する。図16Bのスタック演算コマンド1601は、NO1610と、Stacking109で実行するコマンド1611と、コード1612と、コマンドの意味1613から構成される。   FIG. 16A is a diagram illustrating an example of a stacking calculation. FIG. 16B is a diagram illustrating an example of commands used in the stacking calculation. FIG. 16A shows the states of the stack operation commands 1602 and 1605 to 1608 and the registers 1401 and 1402 input to the stacking processing unit 109 with the horizontal axis as time. The contents of the stack operation commands 1605 to 1608 correspond to the code 1612 in FIG. 16B. The stack operation command 1601 of FIG. 16B includes NO1610, a command 1611 executed in Stacking 109, a code 1612, and a command meaning 1613.

図16Bで示すように、各コマンド1611には、コード1612が定められており、Stacking109は、コマンド1611に対応するコード1612を受け取り、スタッキング演算を実行する。   As shown in FIG. 16B, a code 1612 is defined for each command 1611, and the Stacking 109 receives the code 1612 corresponding to the command 1611 and executes a stacking operation.

図16Aの時刻T0において、Stacking109は、コマンドとして、0X81(1605)のProjection列1の値1を受け取り、スタックレジスタREG1(1402)にProjection列1の値を格納する。ここで、スタック演算コマンド1605のコード1612が「0x81」で、図16Bの意味1613は、「スタックにプロジェクタ出力列1番を積み上げる」である。   At time T0 in FIG. 16A, the Stacking 109 receives the value 1 of the Projection column 1 of 0X81 (1605) as a command and stores the value of the Projection column 1 in the stack register REG1 (1402). Here, the code 1612 of the stack operation command 1605 is “0x81”, and the meaning 1613 in FIG. 16B is “stack the projector output row 1 on the stack”.

すなわち、最初のスタック演算コマンドは、Projection107の出力列1番の値をレジスタREG1(1402)に格納する。なお、(64’d1)の「64’」はデータのビット数が64ビットで、データがd1であることを示す。また、図16Bのスタックは、スタックレジスタREG0(1401)、スタックレジスタREG1(1402)を示す。   That is, the first stack operation command stores the value of the output string 1 of the Projection 107 in the register REG1 (1402). Note that “64 ′” in (64′d1) indicates that the data has 64 bits and the data is d1. The stack in FIG. 16B shows a stack register REG0 (1401) and a stack register REG1 (1402).

図16Aの時刻T1において、スタック演算コマンドとして、Stacking109は、0X10(1606)の直値0の値を受け取り、スタックレジスタREG1(1402)の値をREG0(1401)に書き込み、直値0の値をREG1(1402)に書き込む。   At time T1 in FIG. 16A, as a stack operation command, Stacking 109 receives the value of direct value 0 of 0X10 (1606), writes the value of stack register REG1 (1402) to REG0 (1401), and sets the value of direct value 0. Write to REG1 (1402).

なお、直値0の値は別途レジスタに設定しており、ここでは「2」とする。時刻T2において、Stacking109は、スタック演算コマンドとして、0X01(1607)の和演算子を受け取り、スタックレジスタ1401、1402の値を足して、REG1(1402)に書き込む。   The value of direct value 0 is set in a separate register, and is set to “2” here. At time T2, the Stacking 109 receives the 0X01 (1607) sum operator as a stack operation command, adds the values of the stack registers 1401 and 1402, and writes the result to the REG1 (1402).

時刻T3において、Stacking109は、コマンドとして0X7F(1608)のスタック演算終了を受け取り、最終的なスタック演算結果を出力する。   At time T3, the Stacking 109 receives the stack operation end of 0X7F (1608) as a command, and outputs the final stack operation result.

以上のように、Stacking109は、スタックレジスタ1401、1402を用いてスタック演算コマンドに応じた演算を実行する。   As described above, the Stacking 109 executes an operation according to the stack operation command using the stack registers 1401 and 1402.

図17は、Aggregation111の出力である集約結果112の一例を示す図である。集約結果112には、グルーピング化列0(1701)と、集約結果0(1702)と、集約結果1(1703)のように、グルーピング化列と、集約結果の順番に格納され、グループを示すグルーピング化列の数だけ同じフォーマットでデータが格納されている。集約結果112において、データが存在しない箇所1704は所定の領域までゼロの値で埋めている。   FIG. 17 is a diagram illustrating an example of the aggregation result 112 that is the output of the aggregation 111. In the aggregation result 112, grouping columns 0 (1701), an aggregation result 0 (1702), and an aggregation result 1 (1703) are stored in the order of the grouping column and the aggregation result, and the grouping indicates a group. Data is stored in the same format as the number of data columns. In the aggregation result 112, a portion 1704 where no data exists is filled with a zero value up to a predetermined area.

図17の例では、1つのグルーピング化列に対してFPGA2が2つの集約結果1702、1703を出力する例を示したが、これに限定されるものではなく、集約結果の数はFPGA2の設定に応じて変更することができる。   In the example of FIG. 17, the example in which the FPGA 2 outputs two aggregation results 1702 and 1703 for one grouping column is shown, but the present invention is not limited to this, and the number of aggregation results depends on the setting of the FPGA 2. It can be changed accordingly.

図18は、FPGA2で行われる集約処理の一例を示すタイミングチャートである。FPGA2では、Filter106によるフィルタリング処理と,Projection107によるプロジェクション処理はページ(8KB)単位で行っている。   FIG. 18 is a timing chart illustrating an example of aggregation processing performed in the FPGA 2. In the FPGA 2, the filtering process by the filter 106 and the projection process by the projection 107 are performed in units of pages (8 KB).

時刻T0からFPGAでは、フィルタリング処理FLT_0(1801)が実行される。フィルタリング処理が完了すると、フィルタリング処理FLT_0(1801)の結果を用いて、時刻T1ではプロジェクション処理PRJ_0(1802)が開始される。   From the time T0 to the FPGA, the filtering process FLT_0 (1801) is executed. When the filtering process is completed, the projection process PRJ_0 (1802) is started at time T1, using the result of the filtering process FLT_0 (1801).

プロジェクション処理PRJ_0の結果を用いて、Grouping108とStacking109では、グルーピング処理GRP_0(1803)とスタッキング処理STK_0(1804)が並列して実行される。なお、グルーピング処理GRP_0(1803)とスタッキング処理STK_0(1804)は、プロジェクション処理PRJ_0(1802)で行データが出力された時刻T1Aから開始される。   Using the result of the projection process PRJ_0, in the Grouping 108 and the Stacking 109, the grouping process GRP_0 (1803) and the stacking process STK_0 (1804) are executed in parallel. The grouping process GRP_0 (1803) and the stacking process STK_0 (1804) are started from time T1A when the row data is output in the projection process PRJ_0 (1802).

グルーピング処理GRP_0(1803)でシノニムが発生した場合には、グルーピング処理の結果と共に集約処理へシノニムの情報を通知する。   When a synonym occurs in the grouping process GRP_0 (1803), the synonym information is notified to the aggregation process together with the result of the grouping process.

グルーピング処理GRP_0(1803)とスタッキング処理STK_0(1804)が完了するとAggrergation111で集約処理A_0(1805)が実行される。なお、Aggregation111は、シノニムの情報がある場合にはシノニム処理S_0(1806)が行われる。シノニム処理S_0(1806)では、後述するシノニム114へグルーピング化列とスタック列を書き込む処理である。   When the grouping process GRP_0 (1803) and the stacking process STK_0 (1804) are completed, the aggregation process A_0 (1805) is executed in the aggregation 111. Note that the aggregation 111 performs synonym processing S_0 (1806) when there is synonym information. The synonym process S_0 (1806) is a process of writing a grouping column and a stack column to a synonym 114 described later.

FPGA2では、処理対象データ901の最終ページの処理である、フィルタリング処理FLT_N(1807)と、プロジェクション処理PRJ_N(1808)と、グルーピング処理GRP_N(1809)と、スタッキング処理STK_N(1810)と、集約処理A_N(1811)と、シノニムS_N(1812)が終了すると、図17に示した集約結果112とシノニム114及びメッセージ113をDBサーバ1に転送する。また、FPGA2は、完了したデータベースコマンドについて実行完了をDBサーバ1へ通知する。なお、メッセージ113には、FPGA2が実行したデータベースコマンドで集約したグループの数と、シノニムが発生した数と、演算オーバーフローの情報等が含まれる。   In the FPGA 2, the filtering process FLT_N (1807), the projection process PRJ_N (1808), the grouping process GRP_N (1809), the stacking process STK_N (1810), and the aggregation process A_N, which are the processes of the last page of the processing target data 901, are performed. When (1811) and the synonym S_N (1812) are finished, the aggregation result 112, the synonym 114, and the message 113 shown in FIG. 17 are transferred to the DB server 1. Further, the FPGA 2 notifies the DB server 1 of the completion of execution of the completed database command. Note that the message 113 includes the number of groups aggregated by the database command executed by the FPGA 2, the number of synonyms generated, information on operation overflow, and the like.

DBサーバ1は、FPGA2から受信した集約結果112を、結果格納領域115に格納し、受信したシノニム114をシノニム格納領域117に格納し、メッセージ113をメッセージ格納領域116に格納する。   The DB server 1 stores the aggregation result 112 received from the FPGA 2 in the result storage area 115, stores the received synonym 114 in the synonym storage area 117, and stores the message 113 in the message storage area 116.

なお、シノニムが多発した場合などではシノニム114のデータが埋まった時点で、DBサーバ1のシノニム格納領域117にシノニム114を転送してもよい。   When synonyms occur frequently, the synonyms 114 may be transferred to the synonym storage area 117 of the DB server 1 when the data of the synonyms 114 is filled.

<FPGAとサーバの連携処理>
次に、FPGA2のグルーピング処理でシノニムが発生した場合の集約処理について説明する。図12において、シノニムと判定(1204)され、同じハッシュ値が異なるグルーピング化列に割り当てられた場合には、後述する図19のように、グルーピング化列とスタック列をDBサーバ1に転送し、DBサーバ1がグルーピング及び集約モジュール120において、グルーピングと集約演算を行う。
<Cooperation between FPGA and server>
Next, an aggregation process when a synonym occurs in the grouping process of FPGA 2 will be described. In FIG. 12, when it is determined as a synonym (1204) and the same hash value is assigned to different grouping columns, the grouping column and the stack column are transferred to the DB server 1 as shown in FIG. The DB server 1 performs grouping and aggregation operations in the grouping and aggregation module 120.

図19は、Aggregation111の出力である、シノニム114のフォーマットの一例を示す図である。   FIG. 19 is a diagram illustrating an example of the format of the synonym 114 that is the output of the aggregation 111.

グルーピング処理でシノニム結果を格納するシノニム114は、グルーピング化列0(2201)、スタック列0(2202)、スタック列1(2203)のように、グルーピング化列、スタック列の順番に格納され、グループ(グルーピング化列)の数だけ同じフォーマットでデータが格納されている。シノニム114において、データが存在しない箇所2204は所定の領域までゼロで埋められる(2204)。   The synonym 114 that stores the synonym result in the grouping process is stored in the order of the grouping column and the stack column like the grouping column 0 (2201), the stack column 0 (2202), and the stack column 1 (2203). Data is stored in the same format as the number of (grouping columns). In the synonym 114, a portion 2204 where no data exists is filled with zeros up to a predetermined area (2204).

グルーピング化列2201には、シノニムが発生したグルーピング化データ1102が格納される。スタック列には、当該グループのスタッキング処理の結果が格納される。   The grouping column 2201 stores grouping data 1102 in which synonyms have occurred. The stack column stores the result of stacking processing of the group.

図20は、DBサーバ1で行われる処理の一例を示すフローチャートである。DBサーバ1のDBMS20は、図示しない計算機から受信したクエリに基づいてデータベースコマンドを生成してFPGA2に処理を依頼し、FPGA2は所定のページ単位でデータベース処理を行った集約結果をDBサーバ1に応答する。DBサーバ1のDBMS20は、ページ単位でグループ化された複数の集約結果を受信し、データベースコマンドで指定した全てのデータについて集約結果を受信すると集計してクエリの送信元の計算機(図示省略)に返信する。   FIG. 20 is a flowchart illustrating an example of processing performed in the DB server 1. The DBMS 20 of the DB server 1 generates a database command based on a query received from a computer (not shown) and requests the FPGA 2 to process, and the FPGA 2 responds to the DB server 1 with the result of the database processing performed in a predetermined page unit. To do. The DBMS 20 of the DB server 1 receives a plurality of aggregation results grouped in units of pages, and sums up when receiving the aggregation results for all the data specified by the database command, to the computer (not shown) that sends the query. Send back.

まず、DBMS20は、他の計算機(図示省略)からDB30に対するクエリを受け付ける(1901)。DBMS20は、受け付けたクエリに基づいて、図4で示したように、ストレージ装置3のDB30に対するデータベースコマンドを生成し、FPGA2にデータベースコマンドを発行する(1902)。すなわち、DBMS20は、クエリの処理対象となるDB30の処理範囲と、当該DB30の処理範囲を分割してFPGA2がひとつのデータベースコマンドで処理する単位サイズ(例えば、8MB)を決定して、各データベース処理の内容を決定してFPGA2に指令する。   First, the DBMS 20 receives a query for the DB 30 from another computer (not shown) (1901). Based on the accepted query, the DBMS 20 generates a database command for the DB 30 of the storage apparatus 3 as shown in FIG. 4, and issues the database command to the FPGA 2 (1902). In other words, the DBMS 20 determines the processing range of the DB 30 to be processed by the query and the unit size (for example, 8 MB) that the FPGA 2 processes with one database command by dividing the processing range of the DB 30 to process each database processing. Is determined and commanded to the FPGA 2.

DBMS20は、データベースコマンドに対する完了コマンドをFPGA2から受信したか否かを判定する(1903)。受信していなければ完了コマンドの受信を待機する。一方、完了コマンドを受信した場合には、ステップ1904へ進んで、データベースコマンドで指定したクエリの処理対象となる範囲の全てのデータについて完了コマンドを受信したか否かを判定する。   The DBMS 20 determines whether or not a completion command for the database command has been received from the FPGA 2 (1903). If not received, it waits for the completion command. On the other hand, if a completion command has been received, the process advances to step 1904 to determine whether or not the completion command has been received for all data in the range to be processed by the query specified by the database command.

FPGA2は、所定のページ単位でデータベース処理の結果を応答するので、DBMS20は、データベースコマンドに対応する処理対象データが全て処理されるまで待機する。全てのデータについてデータベース処理が完了した場合にはステップ1905へ進み、そうでない場合にはステップ1903へ戻って完了コマンドを待つ。   Since the FPGA 2 responds with the result of the database processing in units of predetermined pages, the DBMS 20 waits until all the processing target data corresponding to the database command is processed. If the database processing has been completed for all the data, the process proceeds to step 1905. If not, the process returns to step 1903 to wait for a completion command.

ステップ1905では、DBMS20が結果格納領域115に格納されたコマンド単位の集約結果を取得する。結果格納領域115には図19で示した集約結果112がコマンド単位で格納されている。   In step 1905, the DBMS 20 acquires the aggregation result for each command stored in the result storage area 115. The result storage area 115 stores the aggregation result 112 shown in FIG. 19 in units of commands.

DBMS20は、ステップ1905で読み込んだ集約結果からグルーピング化列のハッシュ値を演算してグループハッシュテーブル119を生成する。ハッシュ値の生成はFPGA2のGrouping108と同様であり、図17に示した集約結果112のグルーピング化列のハッシュ値を算出する。そして、DBMS20は、グルーピング化列のグループIDとハッシュ値を対応付けてグループハッシュテーブル119に格納する。なお、ハッシュ値の演算とグループIDの決定についてはFPGA2のGrouping108と同様の処理を行えば良い。   The DBMS 20 calculates a hash value of the grouping column from the aggregation result read in Step 1905 and generates a group hash table 119. The generation of the hash value is the same as the Grouping 108 of the FPGA 2, and the hash value of the grouping column of the aggregation result 112 shown in FIG. 17 is calculated. Then, the DBMS 20 associates the group ID of the grouping column with the hash value and stores them in the group hash table 119. Note that the hash value calculation and group ID determination may be performed in the same manner as in the FPGA 2 Grouping 108.

図24は、グループハッシュテーブル119の一例を示す図である。グループハッシュテーブル119は、図22に示したFPGA2のハッシュテーブル728と同様の構成である。   FIG. 24 is a diagram illustrating an example of the group hash table 119. The group hash table 119 has the same configuration as the hash table 728 of the FPGA 2 shown in FIG.

グループハッシュテーブル119は、ハッシュ値1191と、当該ハッシュ値が使用されているか否かを示すフラグ1192と、ハッシュ値に対応するグループID1193とからひとつのエントリが構成される。   The group hash table 119 includes one entry including a hash value 1191, a flag 1192 indicating whether the hash value is used, and a group ID 1193 corresponding to the hash value.

ハッシュ値1191は、ステップ1905で読み込んだ集約結果のグルーピング化列1701(図17)から算出したハッシュ値を格納する。フラグ1192は、当該エントリのハッシュ値1191が使用されていれば“1”が設定され、使用されていなければ“0”が設定される。   The hash value 1191 stores the hash value calculated from the grouping column 1701 (FIG. 17) of the aggregation result read in Step 1905. The flag 1192 is set to “1” if the hash value 1191 of the entry is used, and is set to “0” if it is not used.

次に、図20のステップ1907では、DBMS20がグループハッシュテーブル119のハッシュ値1191をソートする。DBMS20は、ソート後のグループハッシュテーブル119のグループID1193に従って、集約結果112のグルーピング化列1701の順序を並び替えて、各ページの集約結果についてグルーピング化列と集約結果の関係を揃える。   Next, in step 1907 of FIG. 20, the DBMS 20 sorts the hash values 1191 of the group hash table 119. The DBMS 20 rearranges the order of the grouping column 1701 of the aggregation result 112 according to the group ID 1193 of the group hash table 119 after sorting, and aligns the relationship between the grouping column and the aggregation result for the aggregation result of each page.

ステップ1908では、DBMS20が上記ステップ1907までの処理でグルーピング化列と集約結果の関係を揃えたデータの集約結果を集計する。この処理により、コマンド単位で集約されて、グルーピング化列の順序が不同である集約結果が、クエリで指定されたDB30の処理対象範囲で集計されてクエリに対する処理結果が生成される。なお、この時点では、クエリに対する処理結果が、シノニム114を含まない集計結果である。   In step 1908, the DBMS 20 aggregates the aggregation result of data in which the relationship between the grouping column and the aggregation result is aligned by the processing up to step 1907. As a result of this processing, the aggregation results that are aggregated in command units and in which the order of the grouping columns is not the same are aggregated in the processing target range of the DB 30 specified by the query, and the processing results for the query are generated. At this point, the processing result for the query is a total result that does not include the synonym 114.

次に、DBMS20は、シノニム格納領域117のデータを読み込んで(1909)、FPGA2のデータベース処理でシノニムが発生したか否かを判定する(1910)。シノニム格納領域117にシノニム114が書き込まれていた場合には、ステップ1911へ進む。一方、シノニム格納領域117の情報が書き込まれていない場合には、ステップ1913へ進んで、DBMS20が集計結果をクエリの送信元に応答して処理を終了する。   Next, the DBMS 20 reads the data in the synonym storage area 117 (1909), and determines whether or not a synonym has occurred in the database processing of the FPGA 2 (1910). If the synonym 114 has been written in the synonym storage area 117, the process proceeds to step 1911. On the other hand, if the information in the synonym storage area 117 is not written, the process proceeds to step 1913, where the DBMS 20 responds to the transmission result of the query and ends the process.

ステップ1911では、DBMS20がシノニム114のデータを再度グルーピング処理を行う。すなわち、DBMS20は、シノニム格納領域117に格納されているシノニム114のグルーピング化列(2201)を取得してハッシュ値を演算する。DBMS20は、グループハッシュテーブル119のハッシュ値1191から演算結果のハッシュ値に一致するエントリを検索する。DBMS20は、該当するエントリがなければ、当該ハッシュ値を新たなハッシュ値1191としてグループハッシュテーブル119に追加する。   In step 1911, the DBMS 20 performs the grouping process on the data of the synonym 114 again. That is, the DBMS 20 obtains a grouping column (2201) of the synonyms 114 stored in the synonym storage area 117 and calculates a hash value. The DBMS 20 searches the hash value 1191 of the group hash table 119 for an entry that matches the hash value of the calculation result. If there is no corresponding entry, the DBMS 20 adds the hash value as a new hash value 1191 to the group hash table 119.

ステップ1912では、DBMS20がハッシュ値を演算したシノニム114のデータに含まれるスタック列(2202、2203)を、ハッシュ値が一致または追加したグループハッシュテーブル119のグループID1193に対応する集計結果に加えて再計算する。そして、DBMS20は、ステップ1913で、シノニム114のデータで再計算された集計結果をクエリの送信元に応答して処理を終了する。   In step 1912, the stack string (2202, 2203) included in the data of the synonym 114 for which the DBMS 20 has calculated the hash value is re-added in addition to the aggregation result corresponding to the group ID 1193 of the group hash table 119 with which the hash value matches or is added. calculate. In step 1913, the DBMS 20 responds to the aggregation result recalculated with the data of the synonym 114 to the query transmission source and ends the process.

以上の処理により、FPGA2で所定の処理単位(ページ単位)で集約されたDB30の処理結果は、シノニム114を加味して集計されてクエリの送信元に送信される。また、上記ステップ1905〜1908の処理がDBMS20の再集約モジュール118の処理に相当し、ステップ1909〜1912の処理が、グルーピング及び集約モジュール120の処理に相当する。   Through the above processing, the processing results of the DB 30 aggregated in a predetermined processing unit (page unit) by the FPGA 2 are aggregated with the synonym 114 added and transmitted to the query transmission source. Further, the processing of steps 1905 to 1908 corresponds to the processing of the re-aggregation module 118 of the DBMS 20, and the processing of steps 1909 to 1912 corresponds to the processing of the grouping and aggregation module 120.

図21は、DBサーバ1による集約結果112の再集約処理の一例を示す図である。この処理は、上記図20のステップ1905〜1908の処理に相当する。図示の例では、FPGA2に指令したデータベースコマンドが、コマンド1〜コマンドNで構成され、N個の集約結果2101−1〜2101−NがDBサーバ1に出力された例を示す。   FIG. 21 is a diagram illustrating an example of re-aggregation processing of the aggregation result 112 by the DB server 1. This processing corresponds to the processing in steps 1905 to 1908 in FIG. In the illustrated example, the database command instructed to the FPGA 2 is composed of commands 1 to N, and N aggregation results 2101-1 to 2101-N are output to the DB server 1.

FPGA2で処理されたコマンド1の集約結果が2101−1であり、コマンドNの集約結果が2101−Nである。集約結果2101−1と2101−Nではグルーピング化列の出現順が異なる。このため、DBサーバ1の再集約モジュール118では、これらの結果を用いてそのまま再集約を行うことが出来ない。   The aggregation result of the command 1 processed by the FPGA 2 is 2101-1, and the aggregation result of the command N is 2101-N. The order of appearance of the grouping columns differs between the aggregation results 2101-1 and 2101-N. For this reason, the re-aggregation module 118 of the DB server 1 cannot re-aggregate as it is using these results.

そこで、DBサーバ1は、FPGA2から受信したN個のコマンドの集約結果に対して、グループハッシュテーブル119を生成し、グルーピングと並べ替えを行い、新たな集約結果2102−1〜2102−Nを演算する。   Therefore, the DB server 1 generates a group hash table 119 for the aggregation results of N commands received from the FPGA 2, performs grouping and rearrangement, and calculates new aggregation results 2102-1 to 2102-N. To do.

集約結果2102−1と2102−Nにおいては、グルーピング化列の出現順が同一であり、DBサーバ1は、各コマンドの集約結果の合計や最大値を行方向で演算することが可能である。DBサーバ1の再集約モジュール118は、集約結果2102−1、2102−Nを用いて再集約演算を行い、最終的に図示の集約結果2103を演算する。   In the aggregation results 2102-1 and 2102-N, the order of appearance of the grouping columns is the same, and the DB server 1 can calculate the total or maximum value of the aggregation results of each command in the row direction. The re-aggregation module 118 of the DB server 1 performs the re-aggregation calculation using the aggregation results 2102-1 and 2102-N, and finally calculates the illustrated aggregation result 2103.

以上のように、実施例1によれば、DBサーバ1がDB30を分割して、数MB単位でハードウェアアクセラレータであるFPGA2に処理を依頼すると、DRAM136のバンド幅がSSD137のバンド幅よりも大きいことから、SSD137からのDB30の読み出しと、DRAM136からのデータ読み出しを並列して行える。制御部129が処理対象のDB30のデータをSSD137からDRAM136に複製した後には、FPGA2は、SSD137よりも読み出し速度の速いDRAM136から所定の処理サイズ(例えば、ページ)のデータを入力することで、処理性能を向上させることができる。   As described above, according to the first embodiment, when the DB server 1 divides the DB 30 and requests processing from the hardware accelerator FPGA 2 in units of several MB, the bandwidth of the DRAM 136 is larger than the bandwidth of the SSD 137. Therefore, reading of the DB 30 from the SSD 137 and reading of data from the DRAM 136 can be performed in parallel. After the control unit 129 replicates the data of the DB 30 to be processed from the SSD 137 to the DRAM 136, the FPGA 2 inputs data of a predetermined processing size (for example, page) from the DRAM 136, which has a faster reading speed than the SSD 137. Performance can be improved.

そして、FPGA2は、データベースコマンド単位で集約処理を実行し、DBサーバ1は、複数のデータベースコマンドに対する集約結果の再集約処理を行い、DBサーバ1とFPGA2が協調してデータベース処理を実行することにより、データベース処理システムの処理性能を向上することができる。   Then, the FPGA 2 executes aggregation processing in units of database commands, and the DB server 1 performs re-aggregation processing of aggregation results for a plurality of database commands, and the DB server 1 and FPGA 2 execute database processing in cooperation with each other. The processing performance of the database processing system can be improved.

また、FPGA2では、フィルタリング処理、プロジェクション処理でのデータベース処理単位を、DB30のページ単位とすることで、パイプライン処理を実現してハードウェアアクセラレータの性能をさらに向上させることが可能となる。   Further, in the FPGA 2, the database processing unit in the filtering process and the projection process is set to the page unit of the DB 30, so that pipeline processing can be realized and the performance of the hardware accelerator can be further improved.

本実施例2においては、シノニムの発生頻度が高い場合におけるDBサーバ1の処理について説明する。本実施例では、シノニムの発生頻度が所定の閾値を超えた場合に、DBサーバ1が、FPGA2がひとつのコマンドで処理するデータサイズを縮小し、グルーピング処理においてシノニムの発生を抑制するものである。その他の構成は、前記実施例1と同様である。   In the second embodiment, processing of the DB server 1 when the synonym occurrence frequency is high will be described. In this embodiment, when the occurrence frequency of synonyms exceeds a predetermined threshold, the DB server 1 reduces the data size processed by the FPGA 2 with one command and suppresses the occurrence of synonyms in the grouping process. . Other configurations are the same as those of the first embodiment.

なお、シノニムの発生頻度は、例えば、シノニム114に含まれるグルーピング化列の数や、シノニム114に含まれるグルーピング化列の数と処理対象データ901の比率などを用いることができる。   As the synonym occurrence frequency, for example, the number of grouping columns included in the synonym 114 or the ratio between the number of grouping columns included in the synonym 114 and the processing target data 901 can be used.

図25は、シノニム多発時にFPGA2が処理するデータサイズを縮小する処理を示す図である。1004〜1008までについては、前記実施例1の図10と同様であり、DBサーバ1は、FPGA2がひとつのコマンドで処理するデータサイズを8MBに設定している。   FIG. 25 is a diagram showing processing for reducing the data size processed by the FPGA 2 when synonyms occur frequently. 1004 to 1008 are the same as in FIG. 10 of the first embodiment, and the DB server 1 sets the data size that the FPGA 2 processes with one command to 8 MB.

Grouping108がグルーピングを行う際に、シノニムの発生頻度が高く、再集約モジュール118を実行するDBサーバ1の負荷が増大して、計算機システムとしてのDB処理性能が低下する。   When the grouping 108 performs grouping, the frequency of synonyms is high, the load on the DB server 1 that executes the re-aggregation module 118 increases, and the DB processing performance as a computer system decreases.

そこで、DBサーバ1は、シノニムの発生頻度が高いと判定した場合には、FPGA2が処理する1コマンドあたりのDB30の処理単位のサイズを縮小させる。サイズ縮小前においては、1コマンドあたりのデータサイズは8MB(1004)であるが、サイズ縮小後においては、1コマンドあたりのデータサイズは4MB(2006)に低減される。   Therefore, if the DB server 1 determines that the synonym occurrence frequency is high, the DB server 1 reduces the size of the processing unit of the DB 30 per command processed by the FPGA 2. Before the size reduction, the data size per command is 8 MB (1004), but after the size reduction, the data size per command is reduced to 4 MB (2006).

FPGA2は、4MB(2006)のデータを1ページ単位(8KB)でDRAM136から読み込み、前記実施例1と同様に、グルーピング処理や、スタッキング処理(数値演算)や、集約演算等を実行する。   The FPGA 2 reads 4 MB (2006) data from the DRAM 136 in units of one page (8 KB), and executes grouping processing, stacking processing (numerical calculation), aggregation calculation, and the like, similar to the first embodiment.

FPGA2は、1コマンドあたり8MB分の集約処理が完了すると、前記実施例1と同様に、グループ順不同で、グルーピング化列と集約結果をDBサーバ1に返信する。グルーピング化列と集約結果を受け取ったDBサーバ1は、前記実施例1と同様にして、再集約モジュール118において、グルーピング化列を用いてグループハッシュテーブル119を生成し、ハッシュ値の順に集約結果を並べ替えて、全てのコマンドに対するグローバルの集約処理を実行する。   When the aggregation process for 8 MB per command is completed, the FPGA 2 returns the grouping column and the aggregation result to the DB server 1 in the same group order as in the first embodiment. The DB server 1 that has received the grouping column and the aggregation result generates a group hash table 119 using the grouping column in the re-aggregation module 118 in the same manner as in the first embodiment, and displays the aggregation result in the order of the hash values. Rearrange and execute global aggregation processing for all commands.

これにより、本実施例2では前記実施例1の効果に加えて、シノニム114が発生する頻度を低減して、DBサーバ1の処理性能の低下を抑制することができる。   Thereby, in the second embodiment, in addition to the effects of the first embodiment, the frequency at which the synonym 114 is generated can be reduced, and the degradation of the processing performance of the DB server 1 can be suppressed.

<まとめ>
前記実施例1、2では、FPGA2を有するストレージ装置3が1つの例を示したが、PCIスイッチ4に複数のストレージ装置3を接続することができる。また、FPGA2とストレージ装置3を独立させても良く、各FPGA2には、複数のストレージ装置3を接続することができる。
<Summary>
In the first and second embodiments, one storage apparatus 3 having the FPGA 2 is shown as an example. However, a plurality of storage apparatuses 3 can be connected to the PCI switch 4. Further, the FPGA 2 and the storage device 3 may be independent, and a plurality of storage devices 3 can be connected to each FPGA 2.

また、ストレージ装置3は、DB30を格納するSSD137と、SSD137から一旦データを読み込んでからFPGA2にデータを読み込ませるDRAM136で構成した例を示したがこれに限定されるものではない。ストレージ装置3は、例えば、不揮発性半導体記憶媒体で構成されてDB30を格納する第1の記憶部と、第1の記憶部よりも読み出し速度が高速な半導体記憶媒体で構成されてFPGA2にデータを読み込ませる第2の記憶部とを有すれば良い。   In addition, although the storage apparatus 3 is configured with the SSD 137 that stores the DB 30 and the DRAM 136 that once reads data from the SSD 137 and then reads the data into the FPGA 2, the storage apparatus 3 is not limited thereto. The storage device 3 is composed of, for example, a non-volatile semiconductor storage medium that stores the DB 30 and a semiconductor storage medium that is faster in reading speed than the first storage section and stores data in the FPGA 2. A second storage unit to be read may be included.

なお、本発明は上記した実施例に限定されるものではなく、様々な変形例が含まれる。例えば、上記した実施例は本発明を分かりやすく説明するために詳細に記載したものであり、必ずしも説明した全ての構成を備えるものに限定されるものではない。また、ある実施例の構成の一部を他の実施例の構成に置き換えることが可能であり、また、ある実施例の構成に他の実施例の構成を加えることも可能である。また、各実施例の構成の一部について、他の構成の追加、削除、又は置換のいずれもが、単独で、又は組み合わせても適用可能である。   In addition, this invention is not limited to an above-described Example, Various modifications are included. For example, the above-described embodiments are described in detail for easy understanding of the present invention, and are not necessarily limited to those having all the configurations described. Further, a part of the configuration of one embodiment can be replaced with the configuration of another embodiment, and the configuration of another embodiment can be added to the configuration of one embodiment. In addition, any of the additions, deletions, or substitutions of other configurations can be applied to a part of the configuration of each embodiment, either alone or in combination.

また、上記の各構成、機能、処理部、及び処理手段等は、それらの一部又は全部を、例えば集積回路で設計する等によりハードウェアで実現してもよい。また、上記の各構成、及び機能等は、プロセッサがそれぞれの機能を実現するプログラムを解釈し、実行することによりソフトウェアで実現してもよい。各機能を実現するプログラム、テーブル、ファイル等の情報は、メモリや、ハードディスク、SSD(Solid State Drive)等の記録装置、または、ICカード、SDカード、DVD等の記録媒体に置くことができる。   Each of the above-described configurations, functions, processing units, processing means, and the like may be realized by hardware by designing a part or all of them with, for example, an integrated circuit. In addition, each of the above-described configurations, functions, and the like may be realized by software by the processor interpreting and executing a program that realizes each function. Information such as programs, tables, and files for realizing each function can be stored in a memory, a recording device such as a hard disk or SSD (Solid State Drive), or a recording medium such as an IC card, SD card, or DVD.

また、制御線や情報線は説明上必要と考えられるものを示しており、製品上必ずしも全ての制御線や情報線を示しているとは限らない。実際には殆ど全ての構成が相互に接続されていると考えてもよい。   Further, the control lines and information lines indicate what is considered necessary for the explanation, and not all the control lines and information lines on the product are necessarily shown. Actually, it may be considered that almost all the components are connected to each other.

Claims (15)

プロセッサと、メモリと、を含むサーバと、
前記サーバに接続されてデータベース処理を行うアクセラレータと、
前記アクセラレータに接続されてデータベースを格納するストレージ装置と、を有する計算機システムであって、
前記サーバは、
クエリを受け付けてデータベースコマンドを生成し、処理対象のデータベースの範囲と、前記データベースの範囲を分割してひとつのデータベースコマンドで処理する単位サイズを決定して、前記アクセラレータに指令するサーバコマンド処理部と、
前記アクセラレータの出力を集計して前記クエリに対する処理結果を生成する再集約部と、を有し、
前記アクセラレータは、
前記サーバコマンド処理部からの指令に基づいて、前記単位サイズで前記ストレージ装置からデータベースの処理対象データを読み込み、前記処理対象データを所定の処理単位に分轄して、前記所定の処理単位ごとにグルーピング処理と、スタッキング処理と、集約処理とを含むデータベース処理を実行して集約結果を出力するデータベース処理部を有し、
前記再集約部は、
前記処理対象のデータベースの範囲についての集約結果を前記アクセラレータから受け付けると、当該集約結果を集計して前記クエリに対する処理結果として生成することを特徴とする計算機システム。
A server including a processor and memory;
An accelerator connected to the server for database processing;
A storage system connected to the accelerator for storing a database, and a computer system comprising:
The server
A server command processing unit that receives a query, generates a database command, determines a database range to be processed, a unit size to be processed by one database command by dividing the database range, and instructs the accelerator; ,
A re-aggregation unit that aggregates the output of the accelerator and generates a processing result for the query,
The accelerator is
Based on a command from the server command processing unit, the processing target data of the database is read from the storage device in the unit size, the processing target data is divided into predetermined processing units, and grouped for each predetermined processing unit. A database processing unit that executes database processing including processing, stacking processing, and aggregation processing and outputs an aggregation result;
The re-aggregation unit
When a result of aggregation for the range of the database to be processed is received from the accelerator, the aggregation result is aggregated and generated as a processing result for the query.
請求項1に記載の計算機システムであって、
前記データベース処理部は、
前記グルーピング処理と、前記スタッキング処理とを前記所定の処理単位で並列して実行することを特徴とする計算機システム。
The computer system according to claim 1,
The database processing unit
A computer system, wherein the grouping process and the stacking process are executed in parallel in the predetermined processing unit.
請求項1に記載の計算機システムであって、
前記データベース処理部は、
前記所定の処理単位のデータ列についてグルーピング処理を行うグルーピング処理部を有し、
前記グルーピング処理部は、
前記データ列のデータについてハッシュ値とグループ情報を算出し、前記ハッシュ値とグループ情報を対にしてハッシュ情報に格納し、前記ハッシュ情報に同一のハッシュ値で異なるグループ情報がある場合にはハッシュ値が衝突したことを検知することを特徴とする計算機システム。
The computer system according to claim 1,
The database processing unit
A grouping processing unit that performs a grouping process on the data string of the predetermined processing unit;
The grouping processing unit
A hash value and group information are calculated for the data in the data string, the hash value and the group information are paired and stored in hash information, and if the hash information includes different group information with the same hash value, the hash value A computer system characterized by detecting a collision.
請求項3に記載の計算機システムであって、
前記データベース処理部は、
前記グルーピング処理部が、前記ハッシュ値の衝突を検知したときには、前記グループ情報と、前記スタッキング処理の結果である数値を出力することを特徴とする計算機システム。
The computer system according to claim 3,
The database processing unit
When the grouping processing unit detects a collision of the hash values, the computer system outputs the group information and a numerical value that is a result of the stacking processing.
請求項1に記載の計算機システムであって、
前記ストレージ装置は、
前記データベースを格納する第1の記憶部と、
前記第1の記憶部よりも読み出し速度が高速な半導体記憶媒体で構成されて前記アクセラレータにデータを読み込ませる第2の記憶部と、を有し、
前記アクセラレータは、
前記処理対象のデータベースの範囲について前記第1の記憶部から前記第2の記憶部へコピーさせ、前記第2の記憶部から前記単位サイズ毎に読み込むことを特徴とする計算機システム。
The computer system according to claim 1,
The storage device
A first storage unit for storing the database;
A second storage unit configured by a semiconductor storage medium having a higher reading speed than the first storage unit and causing the accelerator to read data;
The accelerator is
A computer system, wherein the range of the database to be processed is copied from the first storage unit to the second storage unit and read from the second storage unit for each unit size.
請求項1に記載の計算機システムであって、
前記データベース処理部は、
前記グルーピング処理で、前記所定の処理単位のデータ列のデータについてハッシュ値とグループ情報を算出し、
前記スタッキング処理で、前記所定の処理単位のデータ列のデータについて数値を算出し、
前記集約処理で、前記グループ情報毎に前記数値集約した数値情報を算出し、前記集約結果に前記グループ情報と、数値情報を含み、
前記再集約部は、
前記グループ情報からハッシュ値を算出してグループハッシュ情報に格納し、当該ハッシュ値に基づいて前記処理対象のデータベースの範囲についての集約結果を並び替えてから前記数値情報を集計して、前記クエリに対する処理結果を生成することを特徴とする計算機システム。
The computer system according to claim 1,
The database processing unit
In the grouping process, a hash value and group information are calculated for data in the data string of the predetermined processing unit,
In the stacking process, a numerical value is calculated for data in the data string of the predetermined processing unit,
In the aggregation process, numerical information obtained by aggregating the numerical values for each group information is calculated, and the group information and the numerical information are included in the aggregation result,
The re-aggregation unit
A hash value is calculated from the group information, stored in the group hash information, the aggregation result for the range of the database to be processed is rearranged based on the hash value, and then the numerical information is aggregated, to the query A computer system characterized by generating a processing result.
請求項6に記載の計算機システムであって、
前記データベース処理部は、
前記グルーピング処理で、前記ハッシュ値とグループ情報を対にしてハッシュ情報に格納し、前記ハッシュ情報に同一のハッシュ値で異なるグループ情報がある場合にはハッシュ値が衝突したことを検知すると、前記グループ情報と、前記スタッキング処理の結果である数値を出力し、
前記再集約部は、
前記グループハッシュ情報を参照して、前記ハッシュ値が衝突した前記グループ情報と前記スタッキング処理の数値を再度集約して、前記クエリに対する処理結果を再計算することを特徴とする計算機システム。
A computer system according to claim 6, wherein
The database processing unit
In the grouping process, when the hash value and the group information are paired and stored in the hash information, and the hash information includes different group information with the same hash value, it is detected that the hash value collides, Output information and numerical values that are the result of the stacking process,
The re-aggregation unit
A computer system that refers to the group hash information, re-aggregates the group information with which the hash values collide, and the numerical value of the stacking process, and recalculates the processing result for the query.
請求項3に記載の計算機システムであって、
前記サーバコマンド処理部は、
前記再集約部が受け付けたハッシュ値の衝突の発生頻度が予め設定した閾値を超えた場合には、前記データベースの範囲を分割してひとつのデータベースコマンドで処理する単位サイズを縮小することを特徴とする計算機システム。
The computer system according to claim 3,
The server command processing unit
When the frequency of occurrence of hash value collisions received by the re-aggregation unit exceeds a preset threshold, the database range is divided to reduce the unit size processed by one database command. Computer system to do.
データベースを格納するストレージ装置に接続されて、データベースコマンドを受け付けてデータベース処理を行うアクセラレータであって、
処理対象のデータベースの範囲と、前記データベースの範囲を分割してひとつのデータベースコマンドで処理する単位サイズと、を受け付けて、前記単位サイズで前記ストレージ装置からデータベースの処理対象データを読み込み、前記処理対象データを所定の処理単位に分轄して、前記所定の処理単位ごとにグルーピング処理と、スタッキング処理と、集約処理とを含むデータベース処理を実行して集約結果を出力するデータベース処理部を有し、
前記データベース処理部は、
前記グルーピング処理と、前記スタッキング処理とを前記所定の処理単位で並列して実行することを特徴とするアクセラレータ。
An accelerator connected to a storage device for storing a database and receiving a database command to perform database processing,
Receiving a database range to be processed and a unit size to be processed by a single database command by dividing the database range, and reading the database processing target data from the storage device in the unit size, the processing target A database processing unit that divides data into predetermined processing units, executes database processing including grouping processing, stacking processing, and aggregation processing for each predetermined processing unit and outputs an aggregation result;
The database processing unit
An accelerator, wherein the grouping process and the stacking process are executed in parallel in the predetermined processing unit.
請求項9に記載のアクセラレータであって、
前記データベース処理部は、
前記所定の処理単位のデータ列についてグルーピング処理を行うグルーピング処理部を有し、
前記グルーピング処理部は、
前記データ列のデータについてハッシュ値とグループ情報を算出し、前記ハッシュ値とグループ情報を対にしてハッシュ情報に格納し、前記ハッシュ情報に同一のハッシュ値で異なるグループ情報がある場合にはハッシュ値が衝突したことを検知することを特徴とするアクセラレータ。
The accelerator according to claim 9, comprising:
The database processing unit
A grouping processing unit that performs a grouping process on the data string of the predetermined processing unit;
The grouping processing unit
A hash value and group information are calculated for the data in the data string, the hash value and the group information are paired and stored in hash information, and if the hash information includes different group information with the same hash value, the hash value Accelerator characterized by detecting the collision.
請求項10に記載のアクセラレータであって、
前記データベース処理部は、
前記グルーピング処理部が、前記ハッシュ値の衝突を検知したときには、前記グループ情報と、前記スタッキング処理の結果である数値を出力することを特徴とするアクセラレータ。
The accelerator according to claim 10, wherein
The database processing unit
When the grouping processing unit detects a collision of the hash values, the grouping processing unit outputs the group information and a numerical value that is a result of the stacking processing.
請求項9に記載のアクセラレータであって、
前記ストレージ装置は、
前記データベースを格納する第1の記憶部と、
前記第1の記憶部よりも読み出し速度が高速な半導体記憶媒体で構成されて前記アクセラレータにデータを読み込ませる第2の記憶部と、を有し、
前記データベース処理部は、
前記処理対象のデータベースの範囲について前記第1の記憶部から前記第2の記憶部へコピーさせ、前記第2の記憶部から前記単位サイズ毎に読み込むことを特徴とするアクセラレータ。
The accelerator according to claim 9, comprising:
The storage device
A first storage unit for storing the database;
A second storage unit configured by a semiconductor storage medium having a higher reading speed than the first storage unit and causing the accelerator to read data;
The database processing unit
An accelerator, wherein the range of the database to be processed is copied from the first storage unit to the second storage unit and read from the second storage unit for each unit size.
プロセッサと、メモリと、を含むサーバが、前記サーバに接続されてデータベース処理を行うアクセラレータに、前記アクセラレータに接続されたストレージ装置のデータベースを処理させるデータベースの処理方法であって、
前記サーバが、クエリを受け付けてデータベースを生成し、処理対象のデータベースの範囲と、前記データベースの範囲を分割してひとつのデータベースコマンドで処理する単位サイズを決定して、前記アクセラレータに指令する第1のステップと、
前記アクセラレータが、前記サーバからの前記指令に基づいて、前記単位サイズで前記ストレージ装置からデータベースの処理対象データを読み込み、前記処理対象データを所定の処理単位に分轄して、前記所定の処理単位ごとにグルーピング処理と、スタッキング処理と、集約処理とを含むデータベース処理を実行して集約結果を出力する第2のステップと、
前記サーバが、前記アクセラレータの出力を集計して前記クエリに対する処理結果を生成する第3のステップと、を含み、
前記第3のステップは、
前記処理対象のデータベースの範囲についての集約結果を前記アクセラレータから受け付けると、当該集約結果を集計して前記クエリに対する処理結果として生成することを特徴とするデータベースの処理方法。
A server including a processor and a memory is a database processing method for causing an accelerator connected to the server to perform database processing to process a database of a storage device connected to the accelerator,
The server receives a query, generates a database, determines a database range to be processed and a unit size to be processed by one database command by dividing the database range, and instructs the accelerator And the steps
Based on the command from the server, the accelerator reads data to be processed in the database from the storage device in the unit size, and divides the data to be processed into predetermined processing units, for each predetermined processing unit. A second step of executing a database process including a grouping process, a stacking process, and an aggregation process to output an aggregation result;
A third step in which the server aggregates the output of the accelerator and generates a processing result for the query;
The third step includes
A database processing method, wherein when an aggregation result for the range of the database to be processed is received from the accelerator, the aggregation result is aggregated and generated as a processing result for the query.
請求項13に記載のデータベースの処理方法であって、
前記第2のステップは、
前記グルーピング処理で、前記所定の処理単位のデータ列のデータについてハッシュ値とグループ情報を算出し、前記スタッキング処理で、前記所定の処理単位のデータ列のデータについて数値を算出し、前記集約処理で、前記グループ情報毎に前記数値集約した数値情報を算出し、前記集約結果に前記グループ情報と、数値情報を含み、
前記第3のステップは、
前記グループ情報からハッシュ値を算出してグループハッシュ情報に格納し、当該ハッシュ値に基づいて前記処理対象のデータベースの範囲についての集約結果を並び替えてから前記数値情報を集計して、前記クエリに対する処理結果を生成することを特徴とするデータベースの処理方法。
The database processing method according to claim 13, comprising:
The second step includes
In the grouping process, a hash value and group information are calculated for the data string of the predetermined processing unit, and in the stacking process, a numerical value is calculated for the data string of the predetermined processing unit. , Calculating numerical information obtained by aggregating the numerical values for each group information, and including the group information and numerical information in the aggregation result,
The third step includes
A hash value is calculated from the group information, stored in the group hash information, the aggregation result for the range of the database to be processed is rearranged based on the hash value, and then the numerical information is aggregated, to the query A database processing method characterized by generating a processing result.
請求項14に記載のデータベースの処理方法であって、
前記第2のステップは、
前記グルーピング処理で、前記ハッシュ値とグループ情報を対にしてハッシュ情報に格納し、前記ハッシュ情報に同一のハッシュ値で異なるグループ情報がある場合にはハッシュ値が衝突したことを検知すると、前記グループ情報と、前記スタッキング処理の結果である数値を出力し、
前記第3のステップは、
前記グループハッシュ情報を参照して、前記ハッシュ値が衝突した前記グループ情報と前記スタッキング処理の数値を再度集約して、前記クエリに対する処理結果を再計算することを特徴とするデータベースの処理方法。
The database processing method according to claim 14, comprising:
The second step includes
In the grouping process, when the hash value and the group information are paired and stored in the hash information, and the hash information includes different group information with the same hash value, it is detected that the hash value collides, Output information and numerical values that are the result of the stacking process,
The third step includes
A database processing method characterized by referring to the group hash information, re-aggregating the group information with which the hash values collide with numerical values of the stacking process, and recalculating the processing result for the query.
JP2017518648A 2015-05-18 2015-05-18 Computer system, accelerator, and database processing method Expired - Fee Related JP6316503B2 (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2015/064212 WO2016185542A1 (en) 2015-05-18 2015-05-18 Computer system, accelerator, and database processing method

Publications (2)

Publication Number Publication Date
JPWO2016185542A1 JPWO2016185542A1 (en) 2017-08-31
JP6316503B2 true JP6316503B2 (en) 2018-04-25

Family

ID=57319665

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017518648A Expired - Fee Related JP6316503B2 (en) 2015-05-18 2015-05-18 Computer system, accelerator, and database processing method

Country Status (2)

Country Link
JP (1) JP6316503B2 (en)
WO (1) WO2016185542A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018142592A1 (en) * 2017-02-03 2018-08-09 株式会社日立製作所 Information processing system and information processing method
US10417733B2 (en) * 2017-05-24 2019-09-17 Samsung Electronics Co., Ltd. System and method for machine learning with NVMe-of ethernet SSD chassis with embedded GPU in SSD form factor
US20180373760A1 (en) * 2017-06-23 2018-12-27 Xilinx, Inc. Parallel compute offload to database accelerator
US10963460B2 (en) * 2018-12-06 2021-03-30 Xilinx, Inc. Integrated circuits and methods to accelerate data queries

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10803066B2 (en) * 2010-06-29 2020-10-13 Teradata Us, Inc. Methods and systems for hardware acceleration of database operations and queries for a versioned database based on multiple hardware accelerators
JP5561425B2 (en) * 2011-02-28 2014-07-30 日本電気株式会社 Storage system
JP5891842B2 (en) * 2012-02-24 2016-03-23 日本電気株式会社 Storage system

Also Published As

Publication number Publication date
WO2016185542A1 (en) 2016-11-24
JPWO2016185542A1 (en) 2017-08-31

Similar Documents

Publication Publication Date Title
US10963393B1 (en) Storage system and a method for application aware processing
US10176092B2 (en) System and method for executing data processing tasks using resilient distributed datasets (RDDs) in a storage device
US8819335B1 (en) System and method for executing map-reduce tasks in a storage device
US10127275B2 (en) Mapping query operations in database systems to hardware based query accelerators
TWI664541B (en) Methods and systems for autonomous memory searching
KR102610636B1 (en) Offload parallel compute to database accelerators
JP6316503B2 (en) Computer system, accelerator, and database processing method
Watanabe et al. Column-oriented database acceleration using fpgas
Becher et al. A co-design approach for accelerated SQL query processing via FPGA-based data filtering
US10810174B2 (en) Database management system, database server, and database management method
US20150234602A1 (en) Data storage device for filtering page in two steps, system including the same, and method of operating the same
US9984124B2 (en) Data management in relational databases
US10061747B2 (en) Storage of a matrix on a storage compute device
US10324915B2 (en) Information processing apparatus, processing apparatus, data search method
US20230222108A1 (en) Data analysis acceleration architecture
US11210280B2 (en) Systems and methods for fast bloom filter operations
US20180329756A1 (en) Distributed processing system, distributed processing method, and storage medium
KR102425596B1 (en) Systems and methods for low latency hardware memory management
Vemuri et al. Execution primitives for scalable joins and aggregations in map reduce
US11099739B2 (en) System and method for accessing redundant array of independent disks
JP6695973B2 (en) Computer system and database management method
US20220245112A1 (en) Hashing a data set with multiple hash engines
JP7024432B2 (en) Database management system, data conversion program, data conversion method and data conversion device
US20200159729A1 (en) Search Retrieval System and Method
TW202409838A (en) Systems and methods for inference system caching

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170228

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170228

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: 20180320

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180327

R150 Certificate of patent or registration of utility model

Ref document number: 6316503

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees