WO2017168483A1 - 計算機及びデータベースの処理方法 - Google Patents

計算機及びデータベースの処理方法 Download PDF

Info

Publication number
WO2017168483A1
WO2017168483A1 PCT/JP2016/059800 JP2016059800W WO2017168483A1 WO 2017168483 A1 WO2017168483 A1 WO 2017168483A1 JP 2016059800 W JP2016059800 W JP 2016059800W WO 2017168483 A1 WO2017168483 A1 WO 2017168483A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
storage area
database
size
column
Prior art date
Application number
PCT/JP2016/059800
Other languages
English (en)
French (fr)
Inventor
渡辺 聡
美智子 田中
清水 晃
山本 彰
Original Assignee
株式会社日立製作所
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 株式会社日立製作所 filed Critical 株式会社日立製作所
Priority to PCT/JP2016/059800 priority Critical patent/WO2017168483A1/ja
Publication of WO2017168483A1 publication Critical patent/WO2017168483A1/ja

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

Definitions

  • the present invention relates to a method and system for offloading database processing to an accelerator device.
  • Non-Patent Document 1 new hardware is proposed in which a CPU and an FPGA are connected by QPI (Quick Path Interconnect). With this hardware, it is possible to transfer the data to be processed from the CPU to the FPGA and perform the processing in the FPGA.
  • QPI Quality Path Interconnect
  • Patent Literature 1 A technology to offload part of database processing to an accelerator has been developed as a process to apply an accelerator.
  • database processing accepted by a server device is performed by utilizing a plurality of flash modules (accelerators) having a database operation function included in a storage device connected to the server device via a network.
  • flash modules accelerations
  • a technique for speeding up the processing is disclosed.
  • in-memory column store database technology has been developed in which data managed by the database is stored together as column data on the main storage device of the server device.
  • Patent Literature 2 when a part of a record set managed by a database is stored in a memory, the server device divides the record set into a plurality of record sets, and for each record set, records belonging to the record set for each column.
  • IMCUs in-memory compression units
  • lexicographic compression is widely used in which a compression dictionary is created in which data with high appearance frequency is replaced with a short code, and data is stored using the code of the compression dictionary.
  • processing for transmitting the processing target data to the offload destination hardware circuit and processing for transmitting the processing result to the CPU by the hardware circuit are required.
  • a communication memory is used for communication between the CPU and the hardware circuit.
  • an object of the present invention is to suppress a decrease in data transfer performance when part of database processing for a column store database is offloaded to a hardware circuit.
  • the present invention is a computer that processes a database including a processor, a memory, and an accelerator, wherein the memory includes a first storage area accessible from the processor, and a second storage accessible from the processor and the accelerator.
  • a data loader that reads database data, divides the database into data segments of a predetermined size and stores them in a first storage area set in the memory, and accepts a query, Among the database operations included in the query, a query execution unit that notifies database operations that can be executed by the accelerator, and a data segment is selected from the first storage area based on the notification from the query execution unit The selected data segment is transferred to the second storage area.
  • a column data processing unit for notifying the accelerator of the execution of the database operation, and the data loader stores the column data compressed for each column of the database and the dictionary used for the compression in the data segment. Set to.
  • the data segment when part of the database processing is offloaded to the FPGA 103, the data segment can be stored in the second storage area, and the database processing can be speeded up.
  • FIG. 10 is a flowchart illustrating an example of column data selection and transfer processing according to the second embodiment of this invention. It is a flowchart which shows a 3rd Example of this invention and shows an example of the process which produces a data storage segment from input data. It is a flowchart which shows a 3rd Example of this invention and shows an example of the offload determination process performed in a query execution part. It is a block diagram which shows the 4th Example of this invention and shows an example of a computer system.
  • FIG. 1 shows an example of a server system according to the first embodiment.
  • the server 101 is an example of a computer, and may be, for example, a personal computer, a workstation, or a mainframe.
  • the server 101 includes a CPU 102, an FPGA 103, and a memory 104.
  • a storage apparatus 300 that stores data 200 is connected to the server 101.
  • Data 200 is a database including rows and columns.
  • the CPU 102 executes a computer program.
  • a computer program executed by the CPU 102 is, for example, a DBMS (DataBase Management System) 108.
  • the FPGA 103 functions as an accelerator having a database operation circuit 118 that executes database operations.
  • the memory 104 is constituted by, for example, a volatile DRAM (Dynamic Random-Access Memory) or the like, and includes a CPU memory area 105, a CPU / FPGA communication memory area 106, and an FPGA memory area 107.
  • the CPU memory area 105 set in the memory 104 is a storage area occupied by the CPU 102
  • the CPU / FPGA communication memory area 106 is a shared storage area that can be accessed by the CPU 102 and the FPGA 103
  • the FPGA memory area Reference numeral 107 denotes a storage area occupied by the FPGA 103.
  • the CPU memory area 105 stores a DBMS 108 which is a computer program executed by the CPU 102 and one or more data storage segments 115-1 to 115 -n constituting the data 200 managed by the DBMS 108.
  • DBMS 108 which is a computer program executed by the CPU 102 and one or more data storage segments 115-1 to 115 -n constituting the data 200 managed by the DBMS 108.
  • the generic name of the data storage segments 115-1 to 115-n is denoted by reference numeral 115.
  • the data 200 managed by the DBMS 108 is a set of one or more records, and the records are composed of one or more columns.
  • FIG. 2 is a diagram illustrating an example of data 200 managed by the DBMS 108.
  • the data 200 is a set of records composed of one or more columns (201 to 203).
  • the record 204 is a record in which the value of the column 1 (201) is “RecA-1”, the value of the column 2 (202) is “RecA-2”, and the value of the column N (203) is “RecA-N”. is there.
  • FIG. 3 is a diagram illustrating an example of the data storage segment 115.
  • Each of the data storage segments 115-1 to 115-n is generated as a data set having a predetermined size (offload upper limit size) or less.
  • the value of column 1 (201) is stored in the column 1 data section 302 and the value of column 2 (202) is stored in the column 2 data section 303 for one or more record sets shown in FIG.
  • the value of the column N (203) is stored in the column N data part 304.
  • the storage information of the data storage segment 115 and the compression dictionary information of the column data (302 to 304) are stored in the segment management information 301.
  • a known or well-known technique such as Patent Document 2 may be used.
  • the DBMS 108 includes a query analysis unit 109, a query execution unit 110, a data loader 111, a column data selection transfer unit 112, an FPGA processing start unit 113, and an FPGA processing result reception unit 114.
  • the query analysis unit 109 receives a query from a client computer (not shown) and generates a query execution plan for executing the query.
  • the query execution unit 110 executes a query according to the query execution plan generated by the query analysis unit 109 and causes the FPGA 103 to process a part thereof.
  • the data loader 111 reads the data 200 of the storage device 300 as input data and stores it in one or more data storage segments 115.
  • the column data selection transfer unit (column data processing unit) 112 selects data necessary for database operation from the data storage segment 115, and the FPGA processing target data (first storage region) 116 is stored in the CPU / FPGA communication memory region 106. Store as.
  • the FPGA processing start unit 113 causes the FPGA 103 to process the FPGA processing target data 116.
  • the FPGA processing result receiving unit 114 transfers the result processed by the FPGA 103 to the CPU 102.
  • the function units of the query analysis unit 109, the query execution unit 110, the data loader 111, the column data selection transfer unit 112, the FPGA processing start unit 113, and the FPGA processing result reception unit 114 are loaded into the memory 104 as programs.
  • the CPU 102 operates as a functional unit that provides a predetermined function by processing according to the program of each functional unit.
  • the CPU 102 functions as the query analysis unit 109 by performing processing according to the query analysis program.
  • the CPU 102 also operates as a function unit that provides each function of a plurality of processes executed by each program.
  • a computer and a computer system are an apparatus and a system including these functional units.
  • Information such as programs and tables for realizing each function of the DBMS 108 is stored in a storage device 300, a nonvolatile semiconductor memory, a hard disk drive, a storage device such as an SSD (Solid State Drive), or a computer such as an IC card, an SD card, or a DVD. It can be stored in a readable non-transitory data storage medium.
  • a storage device 300 a nonvolatile semiconductor memory, a hard disk drive, a storage device such as an SSD (Solid State Drive), or a computer such as an IC card, an SD card, or a DVD.
  • FIG. 6 is a diagram illustrating an example of a setting file 701 preset in the DBMS 108.
  • the DBMS 108 acquires a preset CPU / FPGA communication memory area size 702 from the setting file 701 in FIG.
  • FIG. 6 shows an example in which the setting parameter is notified to the DBMS 108 by the setting file 701, and the format of the setting file 701 is not limited.
  • the information is displayed on the setting screen.
  • the CPU / FPGA communication memory area size 702 is appropriately set by an administrator or the like according to the capacity of the memory 104 or the like.
  • the DBMS 108 sets the offload upper limit size to the CPU / FPGA communication memory area size 702.
  • the offload upper limit size indicates the maximum amount of data that the DBMS 108 offloads database operations to the FPGA 103.
  • the data loader 111 reads data 200 (input data) composed of one or more record sets from the storage device 300 and stores it in one or more data storage segments 115.
  • FIG. 4 is a flowchart showing an example of a process in which the data loader 111 divides the data 200 into a predetermined segment size and stores it in the data storage segment 115. This process is executed when the DBMS 108 receives a predetermined command from a client computer (not shown).
  • the data loader 111 initializes the storage source data size and the segment size indicating the size of the data storage segment 115 to 0 (S5002).
  • the data loader 111 acquires one record from the data 200 of the storage apparatus 300 (S5003).
  • the data loader 111 adds the acquired record size to the storage source data size (S5004).
  • the data loader 111 calculates the segment size when the acquired record is compressed and added to the data storage segment 115.
  • the segment size is the sum of the size of column data (302 to 304) after compression (column data size) and the size of the segment management information 301 including the compression dictionary.
  • the data loader 111 adds the acquired record to the data storage segment 115 in step S5007.
  • the data loader 111 divides data of one record in units of columns and adds them to the column 1 data part 302 to the column N data part 304 corresponding to each column.
  • the data loader 111 determines whether or not the end of the data 200 has been reached (S5008). If it is not the end of the data 200, the data loader 111 proceeds to step S5003, reads the next unprocessed record, and repeats the above processing.
  • the data loader 111 creates the data storage segment 115 when the end of the data 200 is reached or the segment size exceeds the threshold (S5009).
  • the data loader 111 determines whether or not the end of the data 200 has been reached (S5010). If the data loader 111 is not at the end of the data 200, the data loader 111 returns to step S5002 and repeats the above processing to generate the next data storage segment 115.
  • the data loader 111 divides the input data 200 into data storage segments 115 of a predetermined size and stores them in the CPU memory area 105.
  • Each data storage segment 115 includes column data (302 to 304) obtained by dividing one or more records in units of columns and performing dictionary compression, and segment management information 301 including a compression dictionary.
  • the query analysis unit 109 When the query analysis unit 109 receives a query from a client computer (not shown), the query analysis unit 109 generates a query execution plan including one or more database operations necessary for executing the query.
  • the query execution plan is information including, for example, a relationship between one or more database operations and the execution order of the database operations.
  • the query execution unit 110 executes a query according to the query execution plan generated by the query analysis unit 109.
  • the query execution unit 110 activates the column data selection / transfer unit 112 when the database operation to be executed can be executed by the database operation circuit 118 of the FPGA 103 in the course of query execution. Examples of database operations that can be executed by the database operation circuit 118 include search processing and aggregation processing.
  • the query execution unit 110 specifies the data storage segment 115 for offloading the query to the FPGA 103 and notifies the column data selection / transfer unit 112 of the offload execution.
  • the column data selection / transfer unit 112 selects data necessary for the database operation from the data storage segment 115 designated by the query execution unit 110 and stores it as the FPGA processing target data 116 in the CPU / FPGA communication memory area 106.
  • FIG. 5 is a flowchart showing an example of processing in which the column data selection / transfer unit 112 executes selection and transfer processing of column data (302 to 304).
  • the column data selection transfer unit 112 determines whether or not undetermined column data remains for the column data (302 to 304) of the data storage segment 115 (S6002). The column data selection / transfer unit 112 ends the process if there is no undetermined column data remaining, and proceeds to step S6003 if it remains.
  • the column data selection / transfer unit 112 selects one of the undetermined column data (S6003).
  • the column data selection transfer unit 112 determines whether or not the selected column data is necessary for the database operation (S6004).
  • the column data selection transfer unit 112 determines whether or not to use the column data in the execution target query.
  • the column data selection transfer unit 112 proceeds to step S6005 if the column data is necessary for the database operation, and returns to step S6002 to repeat the above processing if it is not necessary.
  • the column data selection transfer unit 112 copies the column data (302 to 304) in the data storage segment 115 to the CPU / FPGA communication memory area 106 as FPGA processing target data 116.
  • the column data selection transfer unit 112 notifies the query execution unit 110 after the column data selection transfer processing is completed.
  • the query execution unit 110 activates the FPGA processing start unit 113.
  • the column data selection transfer unit 112 may instruct the FPGA 103 to start a database operation.
  • the FPGA processing start unit 113 notifies the FPGA 103 of the database operation and the FPGA processing target data 116.
  • the FPGA 103 activates the database operation circuit 118.
  • the database operation circuit 118 reads the FPGA processing target data 116, executes database operation, and stores the processing result as the FPGA processing result (second storage area) 117 in the CPU / FPGA communication memory area 106.
  • the FPGA 103 stores it as the FPGA processing intermediate data 119 in the FPGA memory area 107.
  • the FPGA 103 notifies the query execution unit 110 of the FPGA processing result 117.
  • the query execution unit 110 activates the FPGA processing result reception unit 114.
  • the FPGA processing result receiving unit 114 reads the FPGA processing result 117 from the CPU / FPGA communication memory area 106 and notifies the query execution unit 110 of the FPGA processing result 117.
  • the FPGA processing result data 116 and the FPGA processing result 117 are read from the CPU / FPGA communication memory area. Is deleted.
  • the query execution unit 110 collects the processing results including the FPGA processing result 117, creates a query execution result, and sends it back to the query issuer (client computer).
  • the DBMS 108 divides the read data 200 into column data obtained by compressing the read data 200 in units of columns, and the data storage segment 115 within a preset size, using the dictionary used for compression. To the CPU / FPGA communication memory area 106.
  • the data storage segment 115 can be stored in the CPU / FPGA communication memory area 106, and the database processing can be speeded up.
  • the data storage segment 115 by suppressing the data storage segment 115 from exceeding the capacity of the CPU / FPGA communication memory area 106, it is possible to prevent the number of data transfers to be processed from increasing as in the conventional example.
  • a column store database using an accelerator such as the FPGA 103 it is possible to suppress a decrease in data transfer performance.
  • the column data selection transfer unit 112 of the DBMS 108 prohibits transfer of column data that is not used in the query for the data storage segment 115 to be offloaded to the FPGA 103, thereby reducing the capacity of the data storage segment 115 to be transferred and performing data transfer.
  • the transfer efficiency can be improved.
  • Example 2 of the present invention will be described. In the following, differences from the first embodiment will be mainly described, and description of common points with the first embodiment will be omitted or simplified.
  • FIG. 7 is a block diagram of the configuration of the server 101 according to the second embodiment.
  • the difference from the first embodiment is that the CPU / FPGA communication memory area 106 is divided into one or more offload areas 801-1 to 801-m.
  • the generic name of the offload areas 801-1 to 801-m is denoted by reference numeral 801.
  • Each offload area 801 includes the FPGA processing target data 116 and the FPGA processing result 117 in the same manner as the CPU / FPGA communication memory area 106 of the first embodiment.
  • the DBMS 108 of the second embodiment calculates the offload area size by dividing the CPU / FPGA communication memory area 106 by the offload multiplicity to the FPGA 103, and sets the offload upper limit size to the offload memory area size. To do.
  • the offload multiplicity may be acquired from a setting file (not shown) of the DBMS 108, or may be calculated by the DBMS 108 from the processing performance of the FPGA 103 and the communication performance between the FPGA 103 and the memory 104.
  • the FPGA 103 shows one example, but a plurality of FPGAs 103 may be connected to the CPU 102.
  • the query execution unit 110 activates the column data selection / transfer unit 112 to one or more data storage segments. On the other hand, it executes in parallel. Note that the number of column data selective transfer units 112 that can be executed in parallel has an upper limit on the offload multiplicity that can be executed by the FPGA 103.
  • the query execution unit 110 specifies the data storage segment 115 for offloading the query to the FPGA 103 and notifies the column data selection / transfer unit 112 of the offload execution.
  • FIG. 8 is a flowchart showing an example of column data selection and transfer processing performed by the column data selection transfer unit 112.
  • the column data selection transfer unit 112 determines whether or not there is a free offload area size in the CPU / FPGA communication memory area 106 (S9001). If there is an empty space in the CPU / FPGA communication memory area 106, the column data selection / transfer unit 112 proceeds to step S9004 and waits until an empty area is created in step S9003.
  • step S9004 the column data selection transfer unit 112 reserves an offload area 801 having an offload area size in the CPU / FPGA communication memory area 106.
  • the column data selection transfer unit 112 determines whether or not an undetermined column remains for the data storage segment 115 designated by the query execution unit 110 (S9005). If there is no undetermined column remaining in the data storage segment 115, the column data selection / transfer unit 112 ends the process, and if there is an undetermined column remaining, the process advances to step S9006.
  • the column data selection transfer unit 112 selects one column data from the undetermined columns (S9006).
  • the column data selection transfer unit 112 determines whether or not the selected column data is necessary for database operation (S9007). If the selected column data is not necessary for the database operation, the column data selection transfer unit 112 returns to step S9005 and repeats the above processing.
  • the column data selection transfer unit 112 secures an offload area 801 having an offload area size in the CPU / FPGA communication memory area 106. Then, the column data selection transfer unit 112 selects data necessary for the database operation from the data storage segment 115 and stores it as the FPGA processing target data 116 in the offload area 801.
  • the FPGA processing result receiving unit 114 reads the FPGA processing result 117 from the offload area 801, notifies the query execution unit 110, and releases the offload area 801.
  • the second embodiment it is possible to speed up the database processing by performing multiple offloads to the FPGA 103.
  • Example 3 of the present invention will be described. In the following, differences from the first embodiment will be mainly described, and description of common points with the first and second embodiments will be omitted or simplified.
  • the CPU / FPGA communication memory area 106 shown in FIG. 1 of the first embodiment is dynamically allocated, and the data loader 111 stores the FPGA processing target data (first data in the CPU / FPGA communication memory area 106).
  • the data storage segment 115 is generated so that the FPGA storage result 116 and the FPGA processing result 117 are accommodated.
  • the DBMS 108 sets the offload upper limit size to the maximum value of the CPU / FPGA communication memory area 106.
  • the maximum value of the CPU / FPGA communication memory area 106 is the maximum value of the memory area that the DBMS 108 can dynamically secure during query execution.
  • the data loader 111 performs data so that the sum of the size of the data storage segment 115 stored in the CPU / FPGA communication memory area 106 as the FPGA processing target data 116 and the size of the FPGA processing result 117 is equal to or less than the offload upper limit size.
  • a storage segment 115 is generated.
  • the data loader 111 compresses column data using a dictionary to generate a data storage segment 115 and stores the data storage segment 115 in the FPGA processing target data 116.
  • the FPGA 103 since the FPGA 103 performs database operation after decompressing the compressed column data using the dictionary of the segment management information 301, the size of the FPGA processing result 117 can be larger than the compressed column data. There is sex.
  • the size of the column data before compression is used as the maximum size of the FPGA processing result 117, and the sum of the size of the FPGA processing target data 116 and the size of the FPGA processing result 117 is OFF.
  • the data loader 111 generates the data storage segment 115 so as to be equal to or smaller than the load upper limit size.
  • FIG. 9 is a flowchart showing an example of processing in which the data loader 111 divides the data 200 into a predetermined segment size and stores it in the data storage segment 115.
  • FIG. 9 is obtained by replacing step S5006 shown in the flowchart of FIG. 4 of the first embodiment with step S5020, and the other configuration is the same as that of the first embodiment.
  • the data loader 111 adds the record size of the read data 200 to the storage source data size (S5004), generates column data compressed for each column, and adds the sum of the dictionary size and the column data size to the segment size. (S5005).
  • the query execution unit 110 executes the query according to the query execution plan generated by the query analysis unit 109 as in the first embodiment. In the course of query execution, it is determined whether or not the database operation for the data storage segment 115 to be processed can be offloaded to the database operation circuit 118 of the FPGA 103.
  • FIG. 10 is a flowchart illustrating an example of an offload determination process performed by the query execution unit 110. This process is executed when the DBMS 108 receives a query.
  • the query execution unit 110 lists the target columns of the database operation set in the query, and specifies column data necessary for the database operation (S11002).
  • the query execution unit 110 refers to the segment management information 301 of the data storage segment 115, acquires the storage size for the column data necessary for the database operation, and calculates the size of the data to be offloaded (S11003).
  • the query execution unit 110 refers to the calculation contents of the database calculation and estimates the size of the result processed by the FPGA 103 (S11004).
  • the query execution unit 110 can obtain the compression dictionary from the segment management information 301 and estimate the size of the compressed column data as the size of the FPGA processing result 117, for example.
  • the query execution unit 110 calculates the sum of the size of the data storage segment 115 to be offloaded to the FPGA 103 (the size of the FPGA processing target data 116) and the FPGA processing result 117 processed by the FPGA 103.
  • the query execution unit 110 determines whether or not the CPU / FPGA communication memory area 106 can be secured with a value equal to the sum of the calculated size of the FPGA processing target data 116 and the estimated size of the FPGA processing result 117. (S11005). If the CPU / FPGA communication memory area 106 cannot be secured with the above size, the process proceeds to step S11008. If it can be secured, the process proceeds to step S1006.
  • the query execution unit 110 determines that the database processing can be offloaded to the FPGA 103 (S11006).
  • the query execution unit 110 reserves the CPU / FPGA communication memory area 106 in the memory 104.
  • the query execution unit 110 determines in step S11008 that database processing offload is not possible.
  • the query execution unit 110 activates the column data selection transfer unit 112 when it is determined that offloading is possible based on the determination. If it is determined that offloading is not possible, the CPU 102 executes database calculation.
  • the offload to the FPGA 103 is performed. Is possible.
  • the DBMS 108 offloads the database operation to the FPGA 103. Until the processing is completed in the FPGA 103, the FPGA processing target data 116 and the FPGA processing result 117 can be stored in the CPU / FPGA communication memory area 106.
  • Example 4 of the present invention will be described. In the following, differences from the first embodiment will be mainly described, and description of common points with the first to third embodiments will be omitted or simplified.
  • FIG. 11 is a block diagram of the configuration of the computer system according to the fourth embodiment.
  • the DBMS 108 includes a buffer management unit 1202, and the server 101 is connected to the storage 1201 via the network 1203.
  • the data storage segments 115 stored in the memory 104 in the first embodiment are stored in the storage 1201 as data storage segments 115-1 to 115-n.
  • the storage 1201 is a device having a storage device, and is, for example, a disk array device, but may instead be a single storage device.
  • the storage device is a device having a non-volatile storage medium, such as a magnetic disk drive, a flash memory drive, and other semiconductor memory drives.
  • FC Fiber Channel
  • SCSI Small Computer System Interface
  • TCP / IP Transmission Control Protocol / Internet Protocol
  • the DBMS 108 accesses the data storage segment 115, it issues a data read request to the storage 1201 via the network 1203.
  • the storage receives the data read request, reads the target data, returns it, and the DBMS 108
  • the returned data is temporarily stored in the buffer management unit 1202, and the data stored in the buffer management unit 1202 is accessed.
  • FPGA offload of database processing can be realized even for a column store database stored in a storage device.
  • this invention is not limited to the above-mentioned Example, Various modifications are included.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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 hard disk, a recording device such as an SSD (Solid State Drive), or a recording medium such as an IC card, an SD card, or a DVD.
  • 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.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

プロセッサとメモリ及びアクセラレータとを含んでデータベースを処理する計算機は、データベースのデータを読み込み、データベースを所定のサイズのデータセグメントに分割してメモリの第1の記憶領域に格納するデータローダと、クエリを受け付けて、クエリに含まれるデータベース演算のうち、アクセラレータで実行可能なデータベース演算を通知するクエリ実行部と、前記通知に基づいて、第1の記憶領域からデータセグメントを選択してメモリの第2の記憶領域へ転送し、アクセラレータにデータベース演算の実行を通知するカラムデータ処理部と、を有し、データローダは、データベースのカラム毎に圧縮したカラムデータと、圧縮に使用した辞書とをデータセグメントに設定する。

Description

計算機及びデータベースの処理方法
 本発明は、データベース処理をアクセラレータ装置にオフロードする方法、および、システムに関する。
 近年、コンピュータシステムの性能を向上するため、CPU(Central Processing Unit)に加えてFPGA(Field Programmable Gate Array)等のハードウェア回路をアクセラレータとして活用する技術が開発されている。
 非特許文献1によれば、CPUとFPGAとがQPI(QuickPath Interconnect)で接続された、新たなハードウェアが提案されている。本ハードウェアでは、処理対象のデータをCPUからFPGAに転送し、FPGAで処理を行うことが可能である。
 アクセラレータを適用する処理としては、データベース処理の一部をアクセラレータにオフロードする技術が開発されている。特許文献1によれば、サーバ装置で受け付けたデータベース処理を、前記サーバ装置とネットワークで接続されたストレージ装置が有する、複数台のデータベース演算機能を有するフラッシュモジュール(アクセラレータ)を活用することで、データベース処理を高速化する技術が開示されている。
 一方、データベース処理の高速化のため、データベースが管理するデータを、サーバ装置の主記憶装置上に、カラムデータとしてまとめて格納する、インメモリカラムストアデータベース技術が開発されている。
 特許文献2によれば、データベースが管理するレコード集合の一部をメモリに格納する際に、サーバ装置は複数のレコード集合に分割し、各レコード集合について、当該レコード集合に属するレコードをカラム毎に纏め、IMCUs(in-memory compression units)として圧縮格納する技術が開示されている。カラムストアデータベースの圧縮技術としては、出現頻度の高いデータを短い符号で置き換える圧縮辞書を作成し、圧縮辞書の符号を用いてデータを格納する辞書式圧縮が広く用いられている。
国際公開第2015/162752号 米国特許出願公開第US2015/0088822号明細書
PK Gupta 著、"Xeon+FPGA Platform for the Data Center"、ISCA/CARL 2015、INTEL Corporation 発行、2015年6月
 データベース処理の一部をハードウェア回路にオフロードするためには、処理対象のデータをオフロード先のハードウェア回路に送信する処理と、ハードウェア回路が処理結果をCPUへ送信する処理が必要である。CPUとハードウェア回路の通信には、例えば、通信用メモリが使用される。
 データベース処理では、レコードを構成する複数のカラムを対象とした処理が行われる。したがって、データベース処理をオフロードするためには、処理対象の全てのカラムをハードウェア回路に送信する必要がある。
 また、カラムストアデータベースでは、辞書式圧縮を用いてデータが格納されるケースがある。データベース処理では、圧縮されたデータを伸長して処理を行う必要がある。そのため、データが辞書式圧縮で格納されている場合には、処理対象の全てのカラムに加えて、該カラムの圧縮に用いられた辞書情報をハードウェア回路に送信する必要がある。
 以上の背景から、カラムストアデータベースの処理をハードウェア回路にオフロードする場合には、処理対象のカラム、および、該カラムの辞書情報が通信用メモリに納まらないと、複数回のデータ送信が必要になり、CPUからハードウェア回路へのデータ転送性能が大幅に低下する可能性があった。
 そこで本発明は、カラムストアデータベースに対するデータベース処理の一部を、ハードウェア回路にオフロードする際に、データ転送性能が低下するのを抑制することを目的とする。
 本発明は、プロセッサとメモリ及びアクセラレータとを含んでデータベースを処理する計算機であって、前記メモリは、前記プロセッサからアクセス可能な第1の記憶領域と、前記プロセッサと前記アクセラレータからアクセス可能な第2の記憶領域とを含み、データベースのデータを読み込んで、前記データベースを所定のサイズのデータセグメントに分割して前記メモリに設定された第1の記憶領域に格納するデータローダと、クエリを受け付けて、当該クエリに含まれるデータベース演算のうち、前記アクセラレータで実行可能なデータベース演算を通知するクエリ実行部と、前記クエリ実行部からの通知に基づいて、前記第1の記憶領域からデータセグメントを選択して、当該選択したデータセグメントを前記第2の記憶領域へ転送し、前記アクセラレータにデータベース演算の実行を通知するカラムデータ処理部と、を有し、前記データローダは、前記データベースのカラム毎に圧縮したカラムデータと、前記圧縮に使用した辞書とを前記データセグメントに設定する。
 本発明によれば、データベース処理の一部をFPGA103にオフロードする際には第2の記憶領域にデータセグメントを収めることができ、データベース処理の高速化が可能となる。
本発明の第1の実施例を示し、サーバの一例を示すブロック図である。 本発明の第1の実施例を示し、データの一例を示す図である。 本発明の第1の実施例を示し、データ格納セグメントの一例を示す図である。 本発明の第1の実施例を示し、入力データからデータ格納セグメントを作成する処理の一例を示すフローチャートである。 本発明の第1の実施例を示し、カラムデータの選択及び転送処理の一例を示すフローチャートである。 本発明の第1の実施例を示し、DBMSに設定された設定ファイルの一例を示す図である。 本発明の第2の実施例を示し、サーバの一例を示すブロック図である。 本発明の第2の実施例を示し、カラムデータの選択及び転送処理の一例を示すフローチャートである。 本発明の第3の実施例を示し、入力データからデータ格納セグメントを作成する処理の一例を示すフローチャートである。 本発明の第3の実施例を示し、クエリ実行部で行われるオフロード判定処理の一例を示すフローチャートである。 本発明の第4の実施例を示し、計算機システムの一例を示すブロック図である。
 以下、本発明の一実施形態について添付図面を用いて説明する。
 図1は、実施例1にかかるサーバの一例を機システムの構成を示す。
 サーバ101は計算機の一例であって、例えば、パーソナルコンピュータ、ワークステーションまたはメインフレームであってもよい。サーバ101は、CPU102と、FPGA103と、メモリ104とを有する。サーバ101には、データ200を格納するストレージ装置300が接続される。なお、データ200は、行と列を含むデータベースである。
 CPU102は、コンピュータプログラムを実行する。CPU102により実行されるコンピュータプログラムは、例えば、DBMS(DataBase Management System)108である。FPGA103は、データベース演算を実行するデータベース演算回路118を有するアクセラレータとして機能する。メモリ104は、例えば、揮発性のDRAM(Dynamic Random-Access Memory)等で構成され、CPUメモリ領域105と、CPU・FPGA通信メモリ領域106と、FPGAメモリ領域107とを有する。
 なお、メモリ104に設定されたCPUメモリ領域105は、CPU102が占有する記憶領域であり、CPU・FPGA通信メモリ領域106は、CPU102とFPGA103が相互にアクセス可能な共有記憶領域であり、FPGAメモリ領域107はFPGA103が占有する記憶領域である。
 CPUメモリ領域105は、CPU102により実行されるコンピュータプログラムであるDBMS108と、DBMS108が管理するデータ200を構成する1以上のデータ格納セグメント115-1~115-nを格納する。なお、以下では、データ格納セグメント115-1~115-nの総称を符号115で表示する。
 DBMS108が管理するデータ200は、1以上のレコードの集合であり、レコードは1以上のカラムで構成される。図2は、DBMS108が管理するデータ200の一例を示す図である。データ200は、1以上のカラム(201~203)で構成されるレコードの集合である。例えば、レコード204は、カラム1(201)の値が「RecA-1」、カラム2(202)の値が「RecA-2」、カラムN(203)の値が「RecA-N」のレコードである。
 データ格納セグメント115には、1以上のレコード集合が格納される。図3は、データ格納セグメント115の一例を示す図である。各データ格納セグメント115-1~115-nは所定のサイズ(オフロード上限サイズ)以下のデータ集合としてそれぞれ生成される。
 データ格納セグメント115には、図2に示した1以上のレコード集合について、カラム1(201)の値がカラム1データ部302に格納され、カラム2(202)の値がカラム2データ部303に格納され、カラムN(203)の値がカラムNデータ部304に格納される。
 また、データ格納セグメント115の格納情報、および、カラムデータ(302~304)の圧縮辞書情報が、セグメント管理情報301に格納される。各カラムデータの圧縮辞書は、前記特許文献2等の公知または周知の技術を用いればよい。
 DBMS108は、クエリ解析部109と、クエリ実行部110と、データローダ111と、カラムデータ選択転送部112と、FPGA処理開始部113と、FPGA処理結果受信部114を有する。
 クエリ解析部109は、クライアント計算機(図示省略)からクエリを受け付けて、当該クエリを実行するためのクエリ実行プランを生成する。クエリ実行部110は、クエリ解析部109が生成したクエリ実行プランに従ってクエリを実行し、一部をFPGA103に処理させる。
 データローダ111は、ストレージ装置300のデータ200を入力データとして読み込んで、1以上のデータ格納セグメント115に格納する。カラムデータ選択転送部(カラムデータ処理部)112は、データ格納セグメント115からデータベース演算に必要なデータを選択し、CPU・FPGA通信メモリ領域106に、FPGA処理対象データ(第1の格納領域)116として格納する。
 FPGA処理開始部113は、FPGA処理対象データ116をFPGA103に処理させる。FPGA処理結果受信部114は、FPGA103が処理した結果をCPU102に転送する。
 クエリ解析部109と、クエリ実行部110と、データローダ111と、カラムデータ選択転送部112と、FPGA処理開始部113と、FPGA処理結果受信部114の各機能部はプログラムとしてメモリ104にロードされる。
 CPU102は、各機能部のプログラムに従って処理することによって、所定の機能を提供する機能部として稼働する。例えば、CPU102は、クエリ解析プログラムに従って処理することでクエリ解析部109として機能する。他のプログラムについても同様である。さらに、CPU102は、各プログラムが実行する複数の処理のそれぞれの機能を提供する機能部としても稼働する。計算機及び計算機システムは、これらの機能部を含む装置及びシステムである。
 DBMS108の各機能を実現するプログラム、テーブル等の情報は、ストレージ装置300や不揮発性半導体メモリ、ハードディスクドライブ、SSD(Solid State Drive)等の記憶デバイス、または、ICカード、SDカード、DVD等の計算機読み取り可能な非一時的データ記憶媒体に格納することができる。
 図6は、DBMS108に予め設定された設定ファイル701の一例を示す図である。DBMS108は、図6の設定ファイル701より、予め設定されたCPU・FPGA通信メモリ領域サイズ702を取得する。尚、図6は、設定ファイル701によりDBMS108に設定パラメータを通知する一例を示したものであり、設定ファイル701の形式を限定するものではなく、また、設定ファイル701以外に設定画面にて当該情報を設定する設定ツールでも良い。
 また、CPU・FPGA通信メモリ領域サイズ702は、メモリ104の容量などに応じて管理者などによって適宜設定されたものである。
 DBMS108は、オフロード上限サイズを、前記CPU・FPGA通信メモリ領域サイズ702に設定する。オフロード上限サイズは、DBMS108がFPGA103にデータベース演算をオフロードする最大のデータ量を示す。
 データローダ111は、1以上のレコード集合で構成されるデータ200(入力データ)をストレージ装置300から読み込んで、1以上のデータ格納セグメント115に格納する。
 図4は、データローダ111が、データ200を所定のセグメントサイズに分割してデータ格納セグメント115に格納する処理の一例を示すフローチャートである。この処理は、DBMS108が、図示しないクライアント計算機から所定のコマンドを受け付けたときに実行される。
 データローダ111は、格納元データサイズと、データ格納セグメント115のサイズを示すセグメントサイズ、0に初期化する(S5002)。データローダ111は、ストレージ装置300のデータ200から1レコードを取得する(S5003)。
 データローダ111は、格納元データサイズに、前記取得したレコードサイズを加算する(S5004)。データローダ111は、前記取得したレコードを、圧縮してデータ格納セグメント115に追加した場合の、セグメントサイズを計算する。
 セグメントサイズは、圧縮後のカラムデータ(302~304)のサイズ(カラムデータサイズ)と、圧縮辞書を含むセグメント管理情報301のサイズの和である。
 データローダ111は、セグメントサイズが、CPU・FPGA通信メモリ領域サイズ702(閾値=オフロード上限サイズ)を超えるか否かを判定する。データローダ111は、セグメントサイズが閾値を超える場合はステップS5009へ進む。
 一方、データローダ111は、セグメントサイズが閾値以下でればステップS5007で、前記取得したレコードを、データ格納セグメント115に追加する。データローダ111は、1レコードのデータをカラム単位に分轄して、各カラムに対応するカラム1データ部302~カラムNデータ部304に追加する。
 次に、データローダ111は、データ200の終端に達したか否かを判定する(S5008)。データローダ111は、データ200の終端でない場合は、ステップS5003へ進んで、次の未処理のレコードを読み込んで上記処理を繰り返す。
 一方、データローダ111は、データ200の終端に達するか、セグメントサイズが閾値を超えた場合には、データ格納セグメント115を作成する(S5009)。
 次に、データローダ111は、データ200の終端に達したか否かを判定する(S5010)。データローダ111は、データ200の終端でない場合は、ステップS5002へ戻って、上記処理を繰り返して次のデータ格納セグメント115を生成する。
 上記処理によって、データローダ111は、入力されたデータ200を所定のサイズのデータ格納セグメント115に分割してCPUメモリ領域105に格納する。各データ格納セグメント115には、1以上のレコードを、カラム単位で分割し、かつ、辞書圧縮を実施したカラムデータ(302~304)と、圧縮辞書を含むセグメント管理情報301が含まれる。
 クエリ解析部109は、図示しないクライアント計算機からクエリを受け付けると、当該クエリを実行するために必要な1以上のデータベース演算を含むクエリ実行プランを生成する。クエリ実行プランは、例えば、1以上のデータベース演算と、データベース演算の実行順序の関係を含む情報である。
 クエリ実行部110は、前記クエリ解析部109が生成したクエリ実行プランに従ってクエリを実行する。クエリ実行部110は、クエリ実行の過程において、実行対象のデータベース演算が、FPGA103のデータベース演算回路118で実行可能な場合は、カラムデータ選択転送部112を起動する。データベース演算回路118で実行可能なデータベース演算としては、例えば、検索処理や集約処理などである。
 クエリ実行部110は、クエリをFPGA103にオフロードするデータ格納セグメント115を指定してカラムデータ選択転送部112にオフロードの実行を通知する。
 カラムデータ選択転送部112は、クエリ実行部110が指定したデータ格納セグメント115からデータベース演算に必要なデータを選択し、CPU・FPGA通信メモリ領域106に、FPGA処理対象データ116として格納する。
 図5は、カラムデータ選択転送部112が、カラムデータ(302~304)の選択及び転送処理を実行する処理の一例を示すフローチャートである。
 カラムデータ選択転送部112は、データ格納セグメント115のカラムデータ(302~304)について、未判定のカラムデータが残っているか否かを判定する(S6002)。カラムデータ選択転送部112は、未判定のカラムデータが残っていなければ、処理を終了し、残っていればステップS6003に進む。
 カラムデータ選択転送部112は、未判定のカラムデータから1つを選択する(S6003)。カラムデータ選択転送部112は、選択したカラムデータが、データベース演算に必要か否かを判定する(S6004)。
 この判定では、カラムデータ選択転送部112が、実行対象のクエリで当該カラムデータを使用するか否かを判定する。カラムデータ選択転送部112は、当該カラムデータがデータベース演算に必要であればステップS6005へ進み、不要であればステップS6002へ戻って上記処理を繰り返す。
 カラムデータ選択転送部112は、データ格納セグメント115内のカラムデータ(302~304)を、CPU・FPGA通信メモリ領域106にFPGA処理対象データ116としてコピーする。
 カラムデータ選択転送部112は、カラムデータ選択転送処理が完了した後、クエリ実行部110に通知する。クエリ実行部110は、FPGA処理開始部113を起動する。なお、カラムデータ選択転送部112が、FPGA103にデータベース演算の開始を指令してもよい。
 FPGA処理開始部113は、FPGA103に、データベース演算と、FPGA処理対象データ116とを通知する。FPGA103は、データベース演算回路118を起動する。データベース演算回路118は、FPGA処理対象データ116を読み込み、データベース演算を実行し、処理結果をCPU・FPGA通信メモリ領域106にFPGA処理結果(第2の格納領域)117として格納する。
 FPGA103は、前記データベース演算の過程で生じる中間結果をFPGA103に格納できない場合は、FPGAメモリ領域107にFPGA処理中間データ119として格納する。FPGA103は、FPGA処理結果117の格納が完了したら、FPGA処理結果117をFPGA103はクエリ実行部110に通知する。クエリ実行部110は、FPGA処理結果受信部114を起動する。
 FPGA処理結果受信部114は、CPU・FPGA通信メモリ領域106から、FPGA処理結果117を読み込んでクエリ実行部110に通知し、CPU・FPGA通信メモリ領域から、FPGA処理対象データ116およびFPGA処理結果117を削除する。
 クエリ実行部110は、FPGA処理結果117を含む処理結果を纏めてクエリ実行結果を作成し、クエリ発行元(クライアント計算機)へ返信する。
 以上のように、本実施例1によれば、DBMS108は、読み込んだデータ200をカラム単位で圧縮したカラムデータと、圧縮に用いた辞書を予め設定したサイズ以内のデータ格納セグメント115に分割してから、CPU・FPGA通信メモリ領域106に転送する。
 これにより、データベース処理の一部または全てをFPGA103にオフロードする際には、CPU・FPGA通信メモリ領域106にデータ格納セグメント115を収めることができ、データベース処理の高速化が可能となる。すなわち、データ格納セグメント115が、CPU・FPGA通信メモリ領域106の容量よりも過大になるのを抑制することで、前記従来例のように処理対象のデータ転送回数が増大するのを防ぐことができ、FPGA103のようなアクセラレータを利用するカラムストアデータベースにおいてデータ転送性能の低下を抑制できる。
 また、DBMS108のカラムデータ選択転送部112は、FPGA103へオフロードするデータ格納セグメント115について、クエリで使用しないカラムデータの転送を禁止することで、転送するデータ格納セグメント115の容量を削減してデータ転送の効率を向上させることができる。
 以下、本発明の実施例2を説明する。以下では、実施例1との相違点を主に説明し、実施例1との共通点については説明を省略または簡略化する。
 図7は、実施例2にかかるサーバ101の構成を示すブロック図である。本実施例2では、CPU・FPGA通信メモリ領域106が、1以上のオフロード領域801-1~801-mに分割される点が、前記実施例1との差分となる。なお、以下では、オフロード領域801-1~801-mの総称を符号801で表示する。
 各オフロード領域801には、前記実施例1のCPU・FPGA通信メモリ領域106と同様に、FPGA処理対象データ116とFPGA処理結果117が含まれる。
 本実施例2のDBMS108は、CPU・FPGA通信メモリ領域106を、FPGA103へのオフロード多重度で除算してオフロード領域サイズを算出し、オフロード上限サイズを、オフロード用メモリ領域サイズに設定する。
 オフロード多重度は、DBMS108の図示しない設定ファイルより取得してもよいし、FPGA103の処理性能とFPGA103とメモリ104間の通信性能とからDBMS108で算出してもよい。また、図7では、FPGA103が一つの例を示すが、複数のFPGA103がCPU102に接続されてもよい。
 クエリ実行部110は、クエリ実行の過程において、実行対象のデータベース演算がFPGA103のデータベース演算回路118で実行可能な場合は、カラムデータ選択転送部112を起動する処理を、1以上のデータ格納セグメントに対し、並行して実行する。なお、平行して実行可能なカラムデータ選択転送部112の数は、FPGA103で実行可能なオフロード多重度を上限とする。
 クエリ実行部110は、クエリをFPGA103にオフロードするデータ格納セグメント115を指定してカラムデータ選択転送部112にオフロードの実行を通知する。
 図8は、カラムデータ選択転送部112で行われるカラムデータの選択及び転送処理の一例を示すフローチャートである。カラムデータ選択転送部112は、CPU・FPGA通信メモリ領域106にオフロード領域サイズの空きがあるか否かを判定する(S9001)。カラムデータ選択転送部112は、CPU・FPGA通信メモリ領域106に空きがあれば、ステップS9004に進み、空きがない場合にはステップS9003で空き領域ができるまで待機する。
 ステップS9004でカラムデータ選択転送部112は、CPU・FPGA通信メモリ領域106にオフロード領域サイズのオフロード領域801を確保する。カラムデータ選択転送部112は、クエリ実行部110から指定されたデータ格納セグメント115について、未判定カラムが残っているか否かを判定する(S9005)。カラムデータ選択転送部112は、データ格納セグメント115に未判定カラムが残っていなければ、処理を終了し、未判定カラムが残っていればステップS9006へ進む。
 カラムデータ選択転送部112は、未判定カラムから、カラムデータを1つ選択する(S9006)。カラムデータ選択転送部112は、選択したカラムデータが、データベース演算に必要か否かを判定する(S9007)。カラムデータ選択転送部112は、選択したカラムデータが、データベース演算に必要なければ、ステップS9005に戻って上記処理を繰り返す。
 カラムデータ選択転送部112は、選択したカラムデータが、データベース演算に必要であればステップS9008へ進み、選択したデータ格納セグメント115内のカラムデータを、オフロード領域801にコピーする。
 上記処理によって、カラムデータ選択転送部112は、CPU・FPGA通信メモリ領域106にオフロード領域サイズのオフロード領域801を確保する。そして、カラムデータ選択転送部112は、データ格納セグメント115からデータベース演算に必要なデータを選択し、前記オフロード領域801に、FPGA処理対象データ116として格納する。
 FPGA処理開始部113は、FPGA103に、データベース演算と、オフロード領域801-1~801-Nと、FPGA処理対象データ116とを通知する。FPGA103は、データベース演算回路118を起動する。データベース演算回路118は、FPGA処理対象データ116を読み込み、データベース演算を実行し、処理結果をオフロード領域801にFPGA処理結果117として格納する。
 FPGA処理結果受信部114は、オフロード領域801から、FPGA処理結果117を読み込んでクエリ実行部110に通知し、オフロード領域801を解放する。
 本実施例2によれば、FPGA103へのオフロードを多重実行することにより、データベース処理の高速化が可能となる。
 以下、本発明の実施例3を説明する。以下では、実施例1との相違点を主に説明し、実施例1~2との共通点については説明を省略または簡易にする。
 本実施例3では、実施例1の図1に示したCPU・FPGA通信メモリ領域106を、動的に確保し、データローダ111がCPU・FPGA通信メモリ領域106内にFPGA処理対象データ(第1の格納領域)116とFPGA処理結果117が収まるようにデータ格納セグメント115を生成する点が相違する。
 DBMS108は、オフロード上限サイズを、CPU・FPGA通信メモリ領域106の最大値に設定する。前記CPU・FPGA通信メモリ領域106の最大値とは、DBMS108が、クエリ実行時に動的に確保可能なメモリ領域の最大値である。
 データローダ111は、FPGA処理対象データ116としてCPU・FPGA通信メモリ領域106に格納されるデータ格納セグメント115のサイズと、FPGA処理結果117のサイズの和が、オフロード上限サイズ以下となるようにデータ格納セグメント115を生成する。
 前記実施例1で述べたように、データローダ111は、辞書によってカラムデータを圧縮してデータ格納セグメント115を生成し、FPGA処理対象データ116に格納される。
 これに対して、FPGA103は、セグメント管理情報301の辞書を用いて圧縮されたカラムデータを伸長してからデータベース演算を行うため、FPGA処理結果117のサイズは、圧縮されたカラムデータより大きくなる可能性がある。
 そこで、本実施例3では、FPGA処理結果117のサイズの最大値として、圧縮前のカラムデータのサイズを使用し、FPGA処理対象データ116のサイズと、FPGA処理結果117のサイズの和が、オフロード上限サイズ以下となるようにデータローダ111がデータ格納セグメント115を生成する。
 図9は、データローダ111が、データ200を所定のセグメントサイズに分割してデータ格納セグメント115に格納する処理の一例を示すフローチャートである。図9は、前記実施例1の図4のフローチャートに示したステップS5006をステップS5020に置き換えたもので、その他の構成は前記実施例1と同様である。
 データローダ111は、読み込んだデータ200のレコードサイズを格納元データサイズに加算してから(S5004)、カラム毎に圧縮したカラムデータを生成し、辞書のサイズとカラムデータのサイズの和をセグメントサイズとして更新する(S5005)。
 ここで、格納元データサイズは、圧縮前のデータ200のサイズであり、FPGA処理結果117のサイズの最大値に相当する。
 そして、データローダ111は、セグメントサイズと格納元データサイズの和が、オフロード上限サイズを超えると、現在のデータ格納セグメント115の生成を完了して次の、データ格納セグメント115の生成に移行する。
 上記処理によって、データ格納セグメント115をFPGA処理対象データ116に転送し、FPGA103がデータベース演算の結果をFPGA処理結果117に格納しても、CPU・FPGA通信メモリ領域106のオフロード上限サイズ以下に収めることが可能となる。
 DBMS108がクエリを受け付けると、クエリ実行部110は、前記実施例1と同様に、クエリ解析部109が生成したクエリ実行プランに従ってクエリを実行する。クエリ実行の過程において、処理対象とするデータ格納セグメント115に対するデータベース演算が、FPGA103のデータベース演算回路118へのオフロードが可能か否かを判定する。
 図10は、クエリ実行部110で行われるオフロード判定処理の一例を示すフローチャートである。この処理は、DBMS108がクエリを受け付けたときに実行される。クエリ実行部110は、クエリに設定されたデータベース演算の対象カラムを列挙し、データベース演算に必要なカラムデータを特定する(S11002)。
 クエリ実行部110は、データ格納セグメント115のセグメント管理情報301を参照し、前記データベース演算に必要なカラムデータについて格納サイズを取得し、オフロード処理対象のデータのサイズを計算する(S11003)。
 クエリ実行部110は、データベース演算の演算内容を参照し、FPGA103で処理した結果のサイズを見積もる(S11004)。クエリ実行部110は、セグメント管理情報301から圧縮辞書を取得して、例えば、圧縮されたカラムデータを伸長したサイズをFPGA処理結果117のサイズとして見積もることができる。
 そして、クエリ実行部110は、FPGA103へオフロードするデータ格納セグメント115のサイズ(FPGA処理対象データ116のサイズ)と、FPGA103で処理したFPGA処理結果117の和を算出する。
 クエリ実行部110は、前記計算したFPGA処理対象データ116のサイズと、前記見積もったFPGA処理結果117のサイズの和と等しい値で、CPU・FPGA通信メモリ領域106を確保可能か否かを判定する(S11005)。上記サイズでCPU・FPGA通信メモリ領域106確保できない場合は、ステップS11008へ進み、確保可能な場合にはステップS1006に進む。
 クエリ実行部110は、データベース処理をFPGA103にオフロード可能と判定する(S11006)。クエリ実行部110は、メモリ104にCPU・FPGA通信メモリ領域106を確保する。一方、クエリ実行部110は、ステップS11008で、データベース処理のオフロードは不可と判定する。
 クエリ実行部110は、前記判定によりオフロード可能と判定した場合、カラムデータ選択転送部112を起動する。オフロード不可と判定した場合は、CPU102にてデータベース演算を実行する。
 以上のように、本実施例3によれば、CPU102とFPGA103とのCPU・FPGA通信メモリ領域106のサイズが、データロードの実行時とクエリ実行時とで異なる場合にも、FPGA103へのオフロードが可能となる。
 また、CPU・FPGA通信メモリ領域106のサイズはFPGA処理対象データ116のサイズと、FPGA処理結果117のサイズの和に等しいサイズで確保されるため、DBMS108がデータベース演算をFPGA103にオフロードするときから、FPGA103で処理が完了するまで、FPGA処理対象データ116及びFPGA処理結果117は、CPU・FPGA通信メモリ領域106内にFPGA処理対象データ116とFPGA処理結果117を収めることができる。
 以下、本発明の実施例4を説明する。以下では、実施例1との相違点を主に説明し、実施例1~3との共通点については説明を省略または簡易にする。
 図11は、実施例4にかかる計算機システムの構成を示すブロック図である。DBMS108は、バッファ管理部1202を有し、サーバ101は、ネットワーク1203を介してストレージ1201に接続される。実施例1においてメモリ104に格納されたデータ格納セグメント115は、ストレージ1201にデータ格納セグメント115-1~115-nとして格納される。
 ストレージ1201は、記憶デバイスを有する装置であり、例えば、ディスクアレイ装置であるが、それに代えて、単一の記憶デバイスであってもよい。前記記憶デバイスは、不揮発性の記憶媒体を有するデバイスであって、例えば、磁気ディスクドライブ、フラッシュメモリドライブ、その他半導体メモリドライブである。
 ネットワーク1203を介した通信プロトコルとしては、例えば、ファイバチャネル(FC)、SCSI(Small Computer System Interface)、または、TCP/IP(Transmission Control Protocol/Internet Protocol)が採用されてよい。
 DBMS108は、データ格納セグメント115にアクセスする際、ネットワーク1203を介してストレージ1201に対してデータ読み出し要求を発行し、ストレージは前記データ読み出し要求を受信し、対象データを読み出して返送し、前記DBMS108は、返送されたデータをバッファ管理部1202に一時的に格納し、前記バッファ管理部1202に格納されたデータにアクセスする。
 実施例4によれば、ストレージ装置に格納されたカラムストアデータベースに対しても、データベース処理のFPGAオフロードが実現可能となる。
 <まとめ>
 なお、上記実施例1~4では、アクセラレータとしてFPGA103を用いる例を示したが、これに限定されるものではなく、GPGPU(General-purpose computing on graphics processing units)やASIC(Application Specific Integrated Circuit)等を採用してもよい。
 なお、本発明は上記した実施例に限定されるものではなく、様々な変形例が含まれる。例えば、上記した実施例は本発明を分かりやすく説明するために詳細に記載したものであり、必ずしも説明した全ての構成を備えるものに限定されるものではない。また、ある実施例の構成の一部を他の実施例の構成に置き換えることが可能であり、また、ある実施例の構成に他の実施例の構成を加えることも可能である。また、各実施例の構成の一部について、他の構成の追加、削除、又は置換のいずれもが、単独で、又は組み合わせても適用可能である。
 また、上記の各構成、機能、処理部、及び処理手段等は、それらの一部又は全部を、例えば集積回路で設計する等によりハードウェアで実現してもよい。また、上記の各構成、及び機能等は、プロセッサがそれぞれの機能を実現するプログラムを解釈し、実行することによりソフトウェアで実現してもよい。各機能を実現するプログラム、テーブル、ファイル等の情報は、メモリや、ハードディスク、SSD(Solid State Drive)等の記録装置、または、ICカード、SDカード、DVD等の記録媒体に置くことができる。
 また、制御線や情報線は説明上必要と考えられるものを示しており、製品上必ずしも全ての制御線や情報線を示しているとは限らない。実際には殆ど全ての構成が相互に接続されていると考えてもよい。

Claims (12)

  1.  プロセッサとメモリ及びアクセラレータとを含んでデータベースを処理する計算機であって、
     前記メモリは、前記プロセッサからアクセス可能な第1の記憶領域と、前記プロセッサと前記アクセラレータからアクセス可能な第2の記憶領域とを含み、
     データベースのデータを読み込んで、前記データベースを所定のサイズのデータセグメントに分割して前記メモリに設定された第1の記憶領域に格納するデータローダと、
     クエリを受け付けて、当該クエリに含まれるデータベース演算のうち、前記アクセラレータで実行可能なデータベース演算を通知するクエリ実行部と、
     前記クエリ実行部からの通知に基づいて、前記第1の記憶領域からデータセグメントを選択して、当該選択したデータセグメントを前記第2の記憶領域へ転送し、前記アクセラレータにデータベース演算の実行を通知するカラムデータ処理部と、を有し、
     前記データローダは、
     前記データベースのカラム毎に圧縮したカラムデータと、前記圧縮に使用した辞書とを前記データセグメントに設定することを特徴とする計算機。
  2.  請求項1に記載の計算機であって、
     前記データローダは、
     前記データセグメントのサイズを、前記第2の記憶領域のサイズ以下に設定することを特徴とする計算機。
  3.  請求項1に記載の計算機であって、
     前記第2の記憶領域は、
     前記データセグメントを格納する第1の格納領域と、前記データセグメントを前記アクセラレータで処理した結果を格納する第2の格納領域と、を含み、
     前記データローダは、
     前記第1の格納領域のサイズと第2の格納領域のサイズの和が、前記第2の記憶領域のサイズ以下となるように前記データセグメントを生成することを特徴とする計算機。
  4.  請求項3に記載の計算機であって、
     前記クエリ実行部は、
     前記第1の格納領域のサイズと第2の格納領域のサイズの和が、前記第2の記憶領域のサイズを超える場合には、前記プロセッサで前記データベース演算を実行させることを特徴とする計算機。
  5.  請求項1に記載の計算機であって、
     前記クエリ実行部は、
     所定の多重度以内で、前記アクセラレータで実行可能なデータベース演算を通知し、
     前記カラムデータ処理部は、
     前記多重度に応じて前記データセグメントを格納する第1の格納領域と、前記データセグメントを前記アクセラレータで処理した結果を格納する第2の格納領域と、を前記第2の記憶領域にそれぞれ確保することを特徴とする計算機。
  6.  請求項1に記載の計算機であって、
     前記カラムデータ処理部は、
     前記クエリを参照して、前記選択した前記第1の記憶領域のデータセグメントから前記データベース演算で必要なカラムデータを選択して、当該選択したカラムデータを前記第2の記憶領域へ転送することを特徴とする計算機。
  7.  プロセッサとメモリ及びアクセラレータとを含む計算機でデータベースを処理するデータベースの処理方法であって、
     前記プロセッサが、データベースのデータを読み込んで、前記データベースを所定のサイズのデータセグメントに分割して前記メモリに設定されて前記プロセッサからアクセス可能な第1の記憶領域に格納する第1のステップと、
     前記プロセッサが、クエリを受け付けて、当該クエリに含まれるデータベース演算のうち、前記アクセラレータで実行可能なデータベース演算を通知する第2のステップと、
     前記プロセッサが、通知に基づいて、前記第1の記憶領域からデータセグメントを選択して、当該選択したデータセグメントを、前記プロセッサと前記アクセラレータからアクセス可能な第2の記憶領域へ転送する第3のステップと、
     前記プロセッサが、前記アクセラレータにデータベース演算の実行を通知する第4のステップと、を含み、
     前記第1のステップは、
     前記データベースのカラム毎に圧縮したカラムデータと、前記圧縮に使用した辞書とを前記データセグメントに設定することを特徴とするデータベースの処理方法。
  8.  請求項7に記載のデータベースの処理方法であって、
     前記第1のステップは、
     前記データセグメントのサイズを、前記第2の記憶領域のサイズ以下に設定することを特徴とするデータベースの処理方法。
  9.  請求項7に記載のデータベースの処理方法であって、
     前記第2の記憶領域は、
     前記データセグメントを格納する第1の格納領域と、前記データセグメントを前記アクセラレータで処理した結果を格納する第2の格納領域と、を含み、
     前記第1のステップは、
     前記第1の格納領域のサイズと第2の格納領域のサイズの和が、前記第2の記憶領域のサイズ以下となるように前記データセグメントを生成することを特徴とするデータベースの処理方法。
  10.  請求項9に記載のデータベースの処理方法であって、
     前記第2のステップは、
     前記第1の格納領域のサイズと第2の格納領域のサイズの和が、前記第2の記憶領域のサイズを超える場合には、前記プロセッサで前記データベース演算を実行させることを特徴とするデータベースの処理方法。
  11.  請求項7に記載のデータベースの処理方法であって、
     前記第2のステップは、
     所定の多重度以内で、前記アクセラレータで実行可能なデータベース演算を通知し、
     前記第3のステップは、
     前記多重度に応じて前記データセグメントを格納する第1の格納領域と、前記データセグメントを前記アクセラレータで処理した結果を格納する第2の格納領域と、を前記第2の記憶領域にそれぞれ確保することを特徴とするデータベースの処理方法。
  12.  請求項7に記載のデータベースの処理方法であって、
     前記第3のステップは、
     前記クエリを参照して、前記選択した前記第1の記憶領域のデータセグメントから前記データベース演算で必要なカラムデータを選択して、当該選択したカラムデータを前記第2の記憶領域へ転送することを特徴とするデータベースの処理方法。
PCT/JP2016/059800 2016-03-28 2016-03-28 計算機及びデータベースの処理方法 WO2017168483A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2016/059800 WO2017168483A1 (ja) 2016-03-28 2016-03-28 計算機及びデータベースの処理方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2016/059800 WO2017168483A1 (ja) 2016-03-28 2016-03-28 計算機及びデータベースの処理方法

Publications (1)

Publication Number Publication Date
WO2017168483A1 true WO2017168483A1 (ja) 2017-10-05

Family

ID=59962688

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2016/059800 WO2017168483A1 (ja) 2016-03-28 2016-03-28 計算機及びデータベースの処理方法

Country Status (1)

Country Link
WO (1) WO2017168483A1 (ja)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012124125A1 (ja) * 2011-03-17 2012-09-20 富士通株式会社 システムおよびスケジューリング方法
JP2015038758A (ja) * 2014-10-06 2015-02-26 株式会社東芝 制御装置、情報処理装置、制御方法およびプログラム
US20150088822A1 (en) * 2013-09-21 2015-03-26 Oracle International Corporation Multi-version concurrency control on in-memory snapshot store of oracle in-memory database

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012124125A1 (ja) * 2011-03-17 2012-09-20 富士通株式会社 システムおよびスケジューリング方法
US20150088822A1 (en) * 2013-09-21 2015-03-26 Oracle International Corporation Multi-version concurrency control on in-memory snapshot store of oracle in-memory database
JP2015038758A (ja) * 2014-10-06 2015-02-26 株式会社東芝 制御装置、情報処理装置、制御方法およびプログラム

Similar Documents

Publication Publication Date Title
US10169413B2 (en) Scalable acceleration of database query operations
US8849851B2 (en) Optimizing restoration of deduplicated data
KR102483303B1 (ko) 매트릭스 처리 장치
CN107045492B (zh) 矩阵处理装置
US11294702B2 (en) Method and system for processing data using a processing pipeline and processing units
US10585856B1 (en) Utilizing data access patterns to determine compression block size in data storage systems
US20130014064A1 (en) Predictive, Multi-Layer Caching Architectures
CN104375824A (zh) 数据处理方法
US10838798B2 (en) Processing system for performing predictive error resolution and dynamic system configuration control
US9916319B2 (en) Effective method to compress tabular data export files for data movement
WO2017042978A1 (ja) 計算機システム、ストレージ装置、及びデータの管理方法
JPWO2018143441A1 (ja) 情報処理システム及び情報処理方法
EP3207461A1 (en) Compression of cascading style sheet files
KR101918806B1 (ko) 분산 파일 시스템의 읽기 성능 극대화를 위한 캐시 관리 방법
US20180307437A1 (en) Backup control method and backup control device
WO2017168483A1 (ja) 計算機及びデータベースの処理方法
US10394453B1 (en) Method and system for choosing an optimal compression algorithm considering resources
US10083121B2 (en) Storage system and storage method
CN105144099A (zh) 通信系统
US20230049602A1 (en) Systems, methods, and apparatus for hierarchical aggregation for computational storage
CN111587417A (zh) 用于数据存储的方法、设备、计算机程序和计算机程序产品
US9588694B1 (en) Storage device optimization
US20240160484A1 (en) Storage system supporting offloading function and operating method thereof
US11860788B2 (en) Prefetching data in a distributed storage system
US11842048B2 (en) Process acceleration for software defined storage

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16896703

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16896703

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP