Near memory acceleration for database operations
By offloading data-intensive operations in the in-memory database management system to near-memory database accelerators and utilizing SIMD parallel processing, the problem of memory performance bottlenecks and high CPU resource consumption is solved, achieving twice the performance improvement of OLTP.
Patent Information
- Application Number
- CN202011024367.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-06-09
- Filing Date
- 2020-09-25
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2040-09-25
AI Technical Summary
When existing in-memory database management systems handle data-intensive operations, they face memory performance bottlenecks and high CPU resource consumption, resulting in performance degradation.
By offloading data-intensive operations in memory devices to near-memory database accelerators and using SIMD to perform parallel comparisons, CPU cycles and cache thrashing are reduced, and memory bandwidth requirements are reduced.
Significantly improves OLTP workload performance, reduces CPU usage and memory bandwidth consumption, and improves data processing efficiency.
Smart Images

Figure CN113312415B_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims the benefit of U.S. Provisional Application No. 62 / 982,683, filed on February 27, 2020, which is hereby incorporated by reference. Technical Field
[0003] The present disclosure relates to near memory acceleration for database operations. Background Art
[0004] Despite the increase in memory capacity and CPU computing power, the ever-increasing size of data processing workloads continues to challenge the performance of in-memory database management systems. Therefore, there is room for improvement. Summary of the invention
[0005] This Summary is provided to introduce some concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
[0006] An embodiment includes a method comprising: in an in-memory database management system environment, receiving a request to perform a database operation on a plurality of values represented in source data, wherein the source data is stored in a device memory of a near memory database accelerator; offloading the database operation to the near memory database accelerator; and receiving an indication from the near memory database accelerator that a result of the database operation is available.
[0007] Another embodiment includes a system comprising: one or more processing units; a main memory or extended memory directly accessible to the one or more processing units; and a near memory database accelerator driver configured to receive a request to perform a database operation on source data stored in a device memory of a near memory database accelerator, the near memory database accelerator including at least one database accelerator engine separate from the one or more processing units, offload the database operation to the near memory database accelerator to be performed by the at least one database accelerator engine separate from the one or more processing units, and receive an indication from the near memory database accelerator that a result of the database operation is available; wherein the main memory or extended memory includes the device memory of the near memory database accelerator.
[0008] Another embodiment includes one or more computer-readable media including computer-executable instructions that, when executed, cause a computing system to perform a method, the method comprising: receiving an application programming interface (API) call from an in-memory database management system requesting that a database operation be offloaded to a near-memory database accelerator, wherein the database operation is performed on an in-memory column of a database table compressed according to a bit-packing compression format, and the API call specifies a bit-number parameter; in response to the API call, sending a request to the near-memory database accelerator, wherein the sending includes: relaying the bit-number parameter, and the near-memory database accelerator performs the database operation with the bit-number parameter; receiving an indication from the near-memory database accelerator that the database operation has been completed; and notifying the in-memory database management system that the database operation has been completed.
[0009] The foregoing and other objects, features and advantages will become more apparent from the following detailed description made with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 is a block diagram of an example hardware environment in which near memory acceleration for database operations may be implemented.
[0011] Figure 2 is a block diagram of an example memory module hardware environment that may implement near memory acceleration for database operations.
[0012] Figure 3 is a block diagram of an example extended storage system environment that may implement near memory acceleration for database operations.
[0013] Figure 4 is a block diagram of an exemplary system architecture that implements near memory acceleration for database operations.
[0014] Figure 5 is a block diagram of an example system that implements near memory acceleration for database operations.
[0015] Figure 6 is a flow chart of an example method for near memory acceleration of database operations in a memory environment.
[0016] Figure 7 is a flow chart of an example more detailed method for near memory acceleration of database operations in an in-memory environment.
[0017] Figure 8 is a sequence diagram of an example sequence of operations to implement near memory acceleration for database operations in a memory environment.
[0018] Fig. 9 is a block diagram illustrating example content of a request to perform a database operation for use with the techniques herein.
[0019] Fig.10 is a block diagram illustrating the architecture of the proposed system for measuring the performance of a near-memory database accelerator.
[0020] Fig.11 is a block diagram of a microarchitecture supporting near memory acceleration for database operations.
[0021] Fig.12 is a block diagram of a sample scan operation in an in-memory database.
[0022] Fig.13 is a block diagram of an example resizing process for row vector output.
[0023] Fig.14 is a block diagram of an example of bit-packed compression in a lookup database operation.
[0024] Fig.15 is a flow chart of an example method of looking up database operations in a sparse compression context.
[0025] Fig.16 is a block diagram illustrating a lookup database operation in the indirect compression case.
[0026] Fig.17 is a flow chart of an example method of looking up a database operation in an indirect compression case.
[0027] Fig.18 is a block diagram of a data structure used in bit-packing compression of database components in an in-memory database management system.
[0028] Fig.19 is a block diagram of a bit-packed (ie, compressed) ValueID array.
[0029] Fig. 20 is a block diagram illustrating different column storage compression scenarios.
[0030] Fig.21 is a flow chart of an example method for sparse compression used in an in-memory database management system.
[0031] Fig. 22 is a flow chart of an example method for sparse decompression used in an in-memory database management system.
[0032] Fig.23 is a block diagram of an example of an indirect compression technique used in an in-memory database management system.
[0033] Fig.24 is another block diagram of an example of an indirect compression technique used in an in-memory database management system.
[0034] Fig.25 is a flow chart of the indirect compression method used in an in-memory database management system.
[0035] Fig.26 is a flow chart of the indirect decompression method used in an in-memory database management system.
[0036] Fig. 27 is a block diagram of cluster dictionary processing in indirect compression used in an in-memory database management system.
[0037] Fig.28 Is a bar chart showing the change in online transaction processing (OLTP) throughput by adding scans.
[0038] Fig.29 is a system diagram of the system setup used for technology evaluation.
[0039] Fig.30 is a graph showing online transaction processing throughput gain through database acceleration.
[0040] Fig.31 is a graph showing scanning throughput with / without TPCC.
[0041] Fig.32 is a block diagram illustrating advantages of a general database accelerator.
[0042] Fig.33 is a block diagram of an example computing system in which the described embodiments may be implemented.
[0043] Fig.34 is a block diagram of an exemplary cloud computing environment that can be used in conjunction with the techniques described herein. DETAILED DESCRIPTION
[0044] Example 1 - Overview
[0045] Low-cost, high-capacity DRAM has accelerated the market for in-memory database management systems (IMDBMS). The latest IMDBMS architecture, which can run both online transaction processing (OLTP) and online analytical processing (OLAP) applications in a single system, eliminates data redundancy and provides higher performance and efficiency with less total cost of ownership (TCO). However, as data volume and application requirements continue to grow, memory performance has become the main performance bottleneck of IMDBMS.
[0046] Studies of OLTP / OLAP applications have shown that performance can be constrained by expensive data-intensive operations such as table scans and aggregations for OLAP workloads. Such data-intensive operations rarely have data to reuse for further computation, but in many cases consume more than 50% of CPU resources and nearly all of the memory bandwidth. Other mission-critical workloads suffer from cache conflicts (or cache thrashing) and memory bandwidth bottlenecks. Therefore, there is an opportunity to better handle the movement of data from memory to compute units.
[0047] One way to improve such data movement in IMDBMS is to process such data-intensive operations in the memory device. Instead of transferring all data to the computing unit, forwarding the filtered results to the next processing step can minimize the overhead. Near-storage computing attempts to speed up data-intensive operations by minimizing the data transfer overhead between storage nodes and processing nodes (such as CPUs).
[0048] However, near-storage computing cannot provide byte-addressability and significantly reduce latency for IMDBMS. Previous work using FPGA and GPGPU technology to accelerate database operations has shown a tenfold performance improvement for compute-intensive operations. However, such approaches show smaller gains in data-intensive operations due to data movement overhead. Even the Hybrid CPU-FPGA approach involves data movement from the host memory to the accelerator compute unit, which has a high memory bandwidth overhead.
[0049] Processing-In-Memory (PIM) methods like UPMEM are advanced concepts for near-memory computing, but they are still in their early stages. In addition, data is reformatted to take advantage of processing units, so existing data structures are not directly reused.
[0050] A near-memory database accelerator (DBA) can offload data-intensive operations of an IMDBMS to a memory device. By placing simple arithmetic units near DRAM within a memory device such as a DIMM, it is possible to: 1) save CPU cycles for data-intensive operations, 2) avoid cache thrashing between threads, and 3) reduce host memory bottlenecks. As described in this article, a proof-of-concept (PoC) system can be implemented using an FPGA with attached DIMMs. The DBA core is designed to fully utilize the internal memory bandwidth to perform parallel comparisons in a SIMD manner. Evaluations show that the OLTP workload performance of a near-memory database accelerator is more than doubled when offloading data-intensive operations. Various obstacles can be overcome to embody this approach in memory devices, allowing the technology to be widely adopted.
[0051] As described herein, database operations can be offloaded to a near-memory database accelerator. As a result, the bandwidth of the CPU-to-memory data path can be reduced for other processing, thereby achieving overall better performance in an in-memory database management system environment.
[0052] Example 2 – Sample Database Accelerator Hardware Environment
[0053] The database accelerator hardware environment may support near memory acceleration of database operations as described herein. Figure 1 is a block diagram of an example database accelerator hardware environment 100 that can be used to implement near memory acceleration for database operations in any of the examples herein. In the example, a computing system 110 includes a central processing node 120 and one or more database accelerator devices 130 .
[0054] The central processing node 120 can communicate with the database accelerator device 130 via a memory communication channel 127, such as a bus, a CPU-to-memory interconnect, a byte-addressable memory interface, PCI, PCIe, a DDR memory interface (e.g., DDR4), a compute express link (CXL) memory interface, Gen-Z, and OpenCAPI, among others. As described herein, different types of communication channels are possible, including those that support memory mapped I / O. As described herein, the memory communication channel 127 can be used to communicate with one or more database accelerator engines 170 and directly access memory 180A or 180B (e.g., where such access bypasses the database accelerator engine 170). Although not shown, a controller may also be included (e.g., from the perspective of the central processing node 120, whether in front of or behind the database accelerator engine 170).
[0055] In this example, the database accelerator device 130 takes the form of a hardware unit (e.g., a memory device) including one or more database accelerator engines 170 and a memory 180A. As shown, the database accelerator engine 170 can communicate back to the central processing node 120 via a memory communication channel 127, which can be a common channel used by the central processing node 120 to access the memory 180A or 180B. When accessing the memory 180AS or 180B via the communication channel 127, the central processing node 120 can bypass the database accelerator engine 170. In practice, as described herein, the memory 180B can be located outside the database accelerator device as long as the database engine 170 is near the memory 180B.
[0056] In addition to the memory on database accelerator device 130 , central processing node 120 may also interface with attached memory modules external to database accelerator device 130 and external to central processing node 120 .
[0057] Example 3 – Example Central Processing Node
[0058] In any example herein, the execution of the database application may be performed by a central processing node. Such a central processing node may include one or more central processing units or other hardware configured to execute software. In practice, the central processing node may include additional hardware, such as a coprocessor, a graphics processor, etc.
[0059] For convenience, a central processing node is sometimes referred to herein simply as a "CPU."
[0060] Example 4 – Example Near Memory Item
[0061] In any examples herein, when an item (e.g., a database accelerator engine, a database accelerator core, etc.) is described as near memory, such item is close to memory (e.g., a memory module embodying the memory) in a physical or data path (e.g., bus) sense. For example, such item may be co-resident or close to (e.g., close to) memory used directly by a central processing node, whether main memory or extended memory, on the same circuit board, hardware unit, device, etc.
[0062] Example 5 – Example Directly Accessible Memory
[0063] In any examples herein, the memory near the database accelerator can operate as memory directly accessible by the central processing node and can be at least a portion of the main memory database storage of the in-memory database management system described herein. Both the central processing node and the database accelerator engine can access the memory of the near-memory accelerator system (e.g., via a memory controller).
[0064] Data subject to offload database operations (e.g., column-based main storage of an in-memory database management system) can be placed in directly accessible memory of a near-memory database accelerator system (e.g., via an in-memory database configuration as described herein) prior to receiving an offload request.
[0065] In practice, the directly accessible memory may be located in and include at least a portion of the main memory, extended memory, etc. The central processing node may access such memory directly (eg, using the main memory bus or extended memory hardware) bypassing the database accelerator.
[0066] In practice, such an arrangement may provide the following advantages: avoiding the need to move data closer to the primary central processing node (e.g., because the data is already there) and / or freeing the central processing node from having to access memory storing operational source data for the database. As a result, processor-memory bandwidth interactions at the central processing node may be used for other operations rather than offloading database operations, resulting in overall performance improvements, as described herein.
[0067] Directly accessible memory is distinguished from memory reserved or dedicated for hardware acceleration that is not addressable by the central processing node. In this case, the hardware accelerator may be near memory, but not near memory that the central processing node can directly access.
[0068] Thus, a "near memory" database accelerator may take the form of a database accelerator where the implementation hardware is located near the memory where the source data resides, where such memory is directly accessible to the central processing node. In this way, the data may already be located in memory, and the bandwidth of the data path between the central processing node and the memory may be freed up and used for other processing tasks, rather than being consumed by offloading database operations.
[0069] For example, an item such as a database accelerator engine can be a memory peer of a central processing node because both the database accelerator engine and the central processing node can access the memory; the central processing node can bypass the database accelerator engine to access the memory directly, and the database accelerator engine can access the same memory without consuming resources of the central processing node.
[0070] Since the memory can be written and read by both the database accelerator and the central processing node, data consistency and / or read / write conflicts may occur during the execution of offload database operations. Therefore, this can be avoided by a locking mechanism that conceptually keeps the main storage area in a read-only state during the life cycle of the query (including the execution of offload database operations).
[0071] Example 6 – Example Specific Database Accelerator Hardware Environment
[0072] exist Figure 1 In a more specific example, the database accelerator hardware environment may include a database accelerator in the form of a memory module (ie, a database accelerator memory module). Figure 2 2 is a block diagram of an example memory module hardware environment 200 in which near memory acceleration for database operations may be used to implement near memory acceleration for database operations in any of the examples herein. In this example, a computing system 210 includes a central processing node 220 and one or more database accelerator devices 230 in the form of memory modules.
[0073] The central processing node 220 may employ a memory controller 225 to communicate with the memory module 230 via a memory communication channel 227. Different types of memory communication channels are possible. For example, PCI, PCIe, DDR memory interface (e.g., DDR4), or other bus standards may be used; memory mapped I / O may be supported, as described herein.
[0074] In an example, the database accelerator device takes the form of a memory module 230 (e.g., a memory device) including one or more database accelerator engines 270 and a memory 280. The memory module 230 can be used entirely as a normal memory device, but also has the ability to perform the offload database operations described herein. As shown, the database accelerator engine 270 can communicate back to the central processing node 220 via a memory communication channel 227, which can be the same channel that the central processing node 220 uses to directly access the memory 280, and the central processing node 220 can bypass the database accelerator engine 270 when accessing the memory 280 via the memory communication channel 227. In practice, the database accelerator engine 270 can be placed on the same device (e.g., a circuit board) as the memory 280.
[0075] In addition to the memory on the memory module, central processing node 220 may also interface with memory module 230 and additional memory modules external to central processing node 220 .
[0076] In addition to the memory 280 on the database accelerator memory module 230, the central processing node 220 may also interface with additional memory modules or other memories that do not have a database engine.
[0077] Example 7 – Example Specific Database Accelerator Hardware Environment
[0078] exist Figure 1 In a more specific example, a database accelerator hardware environment may include a database accelerator in an extended memory environment. Figure 3 3 is a block diagram of an example extended storage system environment 300 in which near memory acceleration for database operations can be implemented in any of the examples herein. In this example, a computing system 310 includes a central processing node 320 and one or more database accelerator devices 330. Figure 2 In the system, from the perspective of the central processing node 320, the memory controller 350 is behind the database accelerator engine 370.
[0079] Central processing node 320 may communicate with database accelerator device 330 over memory communication channel 327. For example, PCIe, CXL (e.g., in conjunction with PCIe), or other CPU memory interconnect standards may be used to communicate with expansion memory system 340, which then interfaces with memory controller 350 that accesses memory modules 380A-380N. A cache coherent interface may be used.
[0080] In an example, the database accelerator device 330 takes the form of a hardware unit (e.g., a device such as a controller) that includes an extended memory system 340 that includes one or more database accelerator engines 370. In practice, the database accelerator engine may be implemented as a controller with dedicated database accelerator engine hardware (e.g., a system on a chip, etc.) or as a virtual database accelerator engine, where the database accelerator engine logic is programmed into the controller.
[0081] As shown, database accelerator engine 370 may communicate back to central processing node 320 via memory communication channel 327, which may be the same channel used by central processing node 320 to directly access memories 380A-N, and central processing node 320 may bypass database accelerator engine 370 when accessing memories 380A-N via memory communication channel 327. In practice, database accelerator engine 370 may be placed on the same device (e.g., on a circuit board) as extended memory system 340 and storage controller 350.
[0082] In addition to memories 380A-N accessed via expansion memory system 340 , central processing node 320 may also interface with additional memory modules that are external to and accessible via expansion memory system 340 and central processing node 320 .
[0083] Example 8 – Example Near Memory Database Accelerator System Architecture
[0084] Figure 4 4 is a block diagram of an example system architecture 400 that implements near memory acceleration of database operations that can be used in any of the examples herein. In the example, a computing system 410 includes a near memory database accelerator system 460 (e.g., implemented in a database accelerator hardware environment) and a database accelerator driver 427. In the example, the near memory database accelerator system 460 is sometimes referred to as a "host" because it can receive and process offload requests from a database application 440 (e.g., through a database accelerator driver 427).
[0085] In the example, the near memory database accelerator system 460 includes one or more database accelerator cores 464 (e.g., executed by the corresponding database accelerator engine shown here), a memory subsystem 466, and memory blocks 468A-468N. In practice, the memory blocks 468A-468N can correspond to memory modules or logical blocks of memory.
[0086] For purposes of distinction, some portions of the system 400 are described as being on the “central processing unit side” 412, while other portions are described as being on the “DBA side” 417. Notably, the database application 440 and the driver 427 are executed by a central processing node, which may be separate from the hardware of the near memory database accelerator system 460 that executes the database accelerator kernel 464 (e.g., a corresponding database accelerator engine).
[0087] Example 9 – Example Near Memory Database Accelerator System Component Architecture
[0088] Figure 5 is a block diagram of an example system 500 implementing near memory acceleration for database operations. In the example, a computing system 510 includes an in-memory database application 520, an offload device driver 530, and a near memory database accelerator system 540.
[0089] The in-memory database application 520 may interface with the offload device driver 530 via an offload API 525 .
[0090] For the sake of distinction, the system may be described as having a central processing unit side 512 and a memory side 516. The central processing unit side 512 is executed by hardware separate from the hardware that executes the DBA side 516.
[0091] Any number of memory configurations may be used to implement near memory database accelerator technology. In an example, a near memory database accelerator system 540 may include at least a portion 544 of an in-memory database main store. The in-memory database main store 544 may store one or more elements of an in-memory database, including source values for a shunt operation 546. The in-memory database main store 544 is stored in memory near the hardware of the database accelerator that performs the shunt operation 546 to generate a result output 548. For example, one or more database accelerator engines of the system 540 may execute one or more database accelerator kernels to perform database operations.
[0092] The database accelerator memory module may store portions of the in-memory database main storage 544 and result outputs 548. Such a memory module may be separate from existing memory modules that provide operational memory 567 and exist external to the near memory database accelerator system 540. Other memory devices 568 may be part of the directly accessible memory 550 of the computing system 510; the directly accessible memory 550 may include main memory that is also accessed by the near memory database accelerator system 540, as well as expansion memory.
[0093] In practice, the portion 544 of the in-memory database main data storage may include column-based main storage (e.g., compressed values in database columns of a column-based in-memory database). The database accelerator memory module may also store temporary data (e.g., data generated as part of database operation processing, such as uncompressed values determined during decompression, temporary join results, etc.). Additional temporary data may be stored in the operational memory 567. Such temporary data may typically be deleted after the database operation processing is completed.
[0094] Results such as uncompressed values (eg, during a lookup) or filtered values (eg, of a scan) may be maintained in memory of the near memory accelerator system 540. Other temporary data may be retained in the normal memory device 560.
[0095] The near memory database accelerator system 540 may also include control registers 542 to control offload processing (eg, to indicate which cores are occupied, etc.).
[0096] In practice, the complexity of the systems shown herein, such as system 500, may vary, with additional functionality, more complex components, etc. For example, there may be additional functionality within the shunt device driver 530. Additional components may be included to implement security, redundancy, load balancing, reporting designs, etc.
[0097] The described computing systems can be networked via wired or wireless network connections including the Internet. Alternatively, the systems can be connected via intranet connections (eg, in a corporate environment, a government environment, etc.).
[0098] System 500 and any other systems described herein may be implemented in conjunction with any hardware components described herein, such as the computing systems described below (e.g., database accelerator hardware, processing units, memory, etc.). In any examples herein, source data, compression parameters, result outputs, etc. may be stored in one or more computer-readable storage media or computer-readable memory devices. The techniques described herein may be general to specific aspects of operating systems or hardware, and may be applied in any of a variety of environments to utilize the described features.
[0099] Example 10 – Example Near Memory In-Memory Database Acceleration Method
[0100] Figure 6 For example, in reference Figure 1 , Figure 4 or Figure 5 Flowchart of an example method 600 for near memory acceleration of database operations in an in-memory database environment that can be implemented in a system of FIG. For example, the method 600 can be executed in a driver that receives a request to offload a database operation to a near memory database accelerator.
[0101] In practice, the source data for database operations may already be stored in the device memory of the near-memory database accelerator. For example, in an in-memory database management system, database elements may typically be stored in memory or configured to be stored as described herein. Thus, database operations may be performed on the source data in situ without having to move the source data to a memory dedicated to offloading. Instead, the source data is stored in memory directly accessible by the central processing node (e.g., which may bypass the database accelerator engine and kernel).
[0102] Therefore, before receiving the request, the source data may be stored in the device memory of the near memory database accelerator specified by the in-memory database management system configuration information.
[0103] At 620, a request to perform a database operation in an in-memory database management system environment is received. As described herein, such a database operation may be specified to be performed on a plurality of values represented in source data stored in a device memory. The source data is stored in a device memory of a near-memory database accelerator. In practice, the source data may have been stored in such a device memory as part of processing by the in-memory database management system. The device memory can be directly accessible (e.g., processing a request) by a central processing node.
[0104] As described herein, a request can be received from an in-memory database management system via an application programming interface for any of the database operations described herein (eg, scans, finds, etc.).
[0105] As a result of determining within the in-memory database management system that a request is to be offloaded, a request may be received from a database application (such as an in-memory database management system). For example, a hosted application in the in-memory database management system may send multiple requests for database operations, and the in-memory database management system may decide which database operations to offload based on offloading criteria. Such criteria may include whether the operation involves high CPU usage, whether the operation involves huge data access with high memory bandwidth usage, whether the ratio of sequential access (relative to random access) is high, etc.
[0106] Scan and lookup operations are typical candidates for offloading. In some cases, several scan and / or lookup offload requests may be sent in a timely manner, which may exceed the capacity of the prepared near memory accelerator system. Therefore, the length of the request queue may also be considered when determining whether to offload an operation. In response to determining that the queue of a set of database operations to be executed on the database accelerator exceeds a threshold length, the database operations may bypass offloading and be executed on the central processing node instead.
[0107] At 640, the database operations are sent to (e.g., offloaded to be executed by) the near memory database accelerator. As described herein, the near memory database accelerator may include both memory storing the source data and hardware performing the database operations on the source data (e.g., close to the device memory storing the source data) or as part of an extended memory system.
[0108] A near memory database kernel (eg, running on a near memory database engine) can perform database operations on source data. Such execution generates results of the database operations.
[0109] At 660, results of the database operations performed on the source data are received from the near memory database accelerator.
[0110] In practice, processing can be repeated multiple times (e.g., for multiple database operations offloaded). Parallelism can also be supported by breaking the operation into smaller parts that are executed simultaneously on the database accelerator.
[0111] As described herein, offloading can relieve the central processing unit from the data path to the memory for other processing (eg, in addition to the requested database operation).
[0112] The method 600 may be combined with any of the methods or actions in the system described herein to implement the near memory database acceleration techniques described herein.
[0113] Method 600 and any other methods described herein may be performed by computer executable instructions (e.g., causing a computing system to perform the methods) stored in one or more computer readable media (e.g., storage or other tangible media) or stored in one or more computer readable memory devices. Such methods may be performed in software, firmware, hardware, or a combination thereof. Such methods may be performed, at least in part, by a computing system (e.g., one or more computing devices).
[0114] The actions shown may be described from alternative perspectives while still implementing the technology. For example, sending a request from a driver may also be described as receiving a request at a database accelerator.
[0115] Example 11 – Sample Database Operations
[0116] In any of the examples herein, a database operation may take the form of any operation performed by an in-memory database management system on source data as part of database processing. In practice, such operations are performed on database tables, columns, or portions thereof. For example, a table scan may be performed on a columnar database to determine those rows having values that match a specified predicate or condition. The techniques described herein may be extended to any number of database operations, including lookups, additions, multiplications, and the like.
[0117] Such database operations compute results that are passed back to the calling application. As described herein, the results may be stored in a memory local to the database accelerator and passed back to the calling application by reference. For example, in the case of a table scan, a vector (e.g., a bitmap, etc.) indicating which rows of the database table satisfy a predicate or condition may be returned.
[0118] As described herein, the source values in the in-memory database main storage may be in compressed form; therefore, the database operation may further include decompression to access the underlying data as described herein.
[0119] Example 12 – Example Memory Module
[0120] In any of the examples herein, the memory module may take the form of a hardware memory, which typically comprises a series of dynamic random access memory integrated circuits on a circuit board. The actual memory technology implemented in the hardware may vary in practice.
[0121] The hardware configuration of the memory module may take the form of a dual in-line memory module (DIMM), a single in-line memory module (SIMM), or the like.
[0122] The data path may vary based on hardware considerations (eg, 32-bit, 64-bit, etc.).
[0123] In a near-memory database accelerator implementation, hardware for performing database operations may be included near the memory modules (eg, on the same circuit board, hardware unit, device, or closer to the memory than the main central processing unit).
[0124] In practice, the near-memory database accelerator technology in this article can be implemented independently of the underlying memory module technology.
[0125] Example 13 – Sample Database Accelerator Engine
[0126] In any of the examples herein, a database accelerator engine that computes the results of offloaded database operations (e.g., by executing a database accelerator kernel) can be implemented by various hardware. Such hardware can take the form of a near-memory processor (e.g., executing executable software to implement the kernel), an FPGA, an ASIC, or other specific or dedicated hardware.
[0127] In practice, the database accelerator engine may include a system-on-chip (SoC) hardware component; additional chips for implementing the database accelerator engine and supporting subsystems of the database accelerator may be placed on a memory module (e.g., memory module 230, etc.). In practice, the database accelerator enables it to support the functionality of the API described herein (e.g., by including appropriate libraries).
[0128] Example 14 – Sample Database Accelerator Kernel
[0129] In any examples herein, the database accelerator kernel may include software or firmware that computes the results of offloading database operations. Such software or firmware may take various forms, such as executable code, hard-coded logic, gate logic, etc. As described herein, the kernel may also perform decompression to access underlying data values.
[0130] Example 15 – Example Separate Execution
[0131] In any examples herein, a database accelerator engine for performing offloaded database operations can be separate from a central processing node (e.g., a main central processing unit) that is executing a database application. As described herein, this separation can be achieved by placing the database accelerator engine on a different circuit board, a different hardware unit, a device, or otherwise away from the memory than the central processing node.
[0132] Example 16 – Sample In-Memory Database Application
[0133] In any of the examples herein, the in-memory database application can take the form of any software program that utilizes in-memory database technology. One useful example is an in-memory database management system (IMDBMS). However, the in-memory database application can take the form of any application that ultimately implements the in-memory database technology as described herein (e.g., by offloading database operations).
[0134] The in-memory database application can either request the database accelerator to perform database operations on the source data described in this article, or directly access the source data by bypassing the database accelerator.
[0135] In practice, in-memory database applications can support hosted applications, providing such applications with access to source data to enable a variety of database use cases.
[0136] The in-memory database application can receive a request for a database operation from a hosted application, and then the in-memory database application decides whether to offload based on the offload criteria. In practice, if not all memories use database acceleration, the decision on whether to offload can be made in advance (e.g., before receiving the request) so that the source data is already in a memory location that can benefit from database acceleration.
[0137] In practice, access to database acceleration may be limited to boost systems such as in-memory database management systems that implement access control.Any number of in-memory database applications may take advantage of the techniques described herein, including the SAP HANA system designed by SAP SE of Walldorf, Germany, and other in-memory database management systems.
[0138] Example 17 – Example In-Memory Database Technology
[0139] In any examples herein, database accelerator technology can support performing database operations according to in-memory database technology (e.g., via a near-memory database accelerator) on source data including in-memory database components stored in memory (e.g., device memory of the near-memory database accelerator). In-memory database components such as one or more tables, one or more table columns, etc. can be stored in memory, which can improve performance compared to storage in secondary storage. As described herein, the memory accessed by the near-memory database accelerator can be at least a portion of the main storage of the in-memory database management system.
[0140] In practice, since there is usually only a finite amount of memory available, in-memory database technologies can take advantage of data compression. For example, an in-memory columnar data store can use compression to represent a large number of values in a finite amount of storage space.
[0141] Depending on the use case, different types of compression can be used, and in-memory database technology can support a mix of such compression types across different columns.
[0142] When a database accelerator is applied to an in-memory database environment that has compressed source data, the database accelerator can perform decompression to access the database's underlying data as part of performing database operations. As a result, the decompression process is offloaded from the central processing node to the database accelerator.
[0143] As described herein, compression information for the source data may be included in the request. The near memory database accelerator may use such information to decompress the source data. Such information may include parameters applied during decompression. For example, if the source data is compressed according to a bit packed format, the compression information may specify the number of bits in the bit packed compression format.
[0144] As described herein, source data may include database table values in column format. Operations (such as table scans or lookups) that specify predicates may be supported. Results indicate which database column values the predicates are valid for.
[0145] Whether values are stored in memory can be controlled by the in-memory database management system, using heuristics to determine which values (e.g., tables, columns, partitions, etc.) to store in memory. Manual specification of in-memory database components can be supported to achieve configuration flexibility.
[0146] In order to work with the database accelerator technology described herein, the in-memory database management system can be near-memory database accelerator-aware. For example, in a system where some memory is accessible by the database accelerator and some memory is not accessible, the configuration of the in-memory database management system can support specifying which tables or table elements are to be stored in the memory accessible by the database accelerator. Such configuration of whether a database table or database element is stored in such memory can be guided by automatic criteria or manually specified by a database administrator.
[0147] Example 18 – Example In-Memory Database Storage Layout
[0148] In any of the examples herein, an in-memory database management system can maintain a main store and an operational store including a delta area. The latest changes to the in-memory database can be placed in the delta area. Thus, in a periodic delta merge process, information in the delta area can be periodically merged into the main store. In practice, database operations can be run against the main store. The results can then be reconciled with the delta area, if any.
[0149] In an in-memory database management system, a database accelerator engine can perform database operations on the main storage and provide the results, which can then be reconciled with the delta area. In such an arrangement, the operational memory, including the delta area, can be separate from the main storage. Thus, for example, in Figure 2 In the example, at least a portion of the main storage may be stored in the memory 280 of the database accelerator memory module 230, and the operating memory including the corresponding delta area may be stored in other memory (e.g., outside the database accelerator memory module 230). Figure 3 Similar approaches are possible with extended storage system arrangements. Such operational storage can, but need not, be enhanced by a database accelerator engine.
[0150] In practice, the main storage of an in-memory database (e.g., the memory on which a database accelerator performs database operations) can be implemented as non-volatile memory (e.g., NVDIMM, etc.), while the operating memory and delta area are stored in DRAM.
[0151] Example 19 – Example Near Memory In-Memory Database Accelerator
[0152] In any examples herein, a near memory in-memory database accelerator (sometimes referred to herein simply as a "database accelerator" or "DBA") can take the form of a device having both memory and one or more database accelerator engines implemented in hardware (e.g., near memory) or an extended memory system and one or more database accelerator engines implemented in hardware (e.g., near memory).
[0153] An example of an in-memory database accelerator is shown as Figure 1 130 of them Figure 2 230 Figure 3 330 Figure 4 460 Figure 5 540 and Fig.11 of 1110.
[0154] The near-memory database accelerator system is sometimes referred to as a "host" because it can receive and process offload requests from an in-memory database application (eg, via a database accelerator driver), as described herein.
[0155] In practice, such a database accelerator may include subsystems, such as one or more database acceleration engines that execute corresponding kernels (eg, calculate database operation results), a memory subsystem, and the like.
[0156] The memory device can be changed to also include a database acceleration engine that calculates the results of database operations that access the memory on the memory device as source data. The operations can then be offloaded to this memory device, which is a form of database accelerator.
[0157] As described herein, a near memory database accelerator can perform offloaded database operations locally on in-memory source data in place (or "in situ"), and the source data can be pre-placed in directly accessible memory by a central processing node, as described herein, without having to move it to a dedicated area separate from the directly accessible memory. This approach greatly reduces the amount of data movement required to perform offloaded database operations. For example, for offloaded database operations, comparisons of values do not need to be performed by the central processing node. Therefore, data decompression calculations can also be offloaded to the database accelerator, as described herein.
[0158] Because the central processing node can also directly access directly accessible memory available to the database accelerator engine (e.g., bypassing the database accelerator engine to which processing is offloaded), results placed in the directly accessible memory by the database accelerator engine can be readily obtained as described herein.
[0159] Example 20 – Sample Database Accelerator Driver
[0160] In any of the examples herein, a near memory database accelerator driver (or simply referred to herein as a "driver") may be implemented. In practice, such a driver may provide an abstraction layer between software that utilizes database accelerator technology and the details of the underlying hardware that implements the actual database accelerator. For example, the driver may be implemented as a software function library that may perform CPU to database accelerator communication functions.
[0161] The request may be received from the in-memory database application by a driver that interacts with the near-memory database accelerator on behalf of the application.As described herein, database operations may be divided into smaller operations that are performed in parallel by the near-memory database accelerator.
[0162] Source data may be assigned to the driver as a virtual address. The driver may convert the virtual address to a device physical address. The driver may first obtain the system physical address by referring to a page table. The device physical address may then be converted to a system physical address based on information from the system BIOS, storing the boot system physical address of the device memory in a base address (BAR) register at boot time.
[0163] As described herein, the driver may be configured to receive a request to perform a database operation on source data stored in a device memory of a near memory database accelerator, the near memory database accelerator comprising at least one database accelerator engine separate from one or more processing units (central processing nodes), shunt the database operation to the near memory accelerator to be performed by at least one database accelerator engine separate from the one or more processing units, and receive an indication of the results available for the database operation from the near memory database accelerator. The calling application may then retrieve the results. As described herein, the source data may be stored in a directly accessible memory of one or more processing units. Such a processing unit may directly access the directly accessible memory, thereby bypassing the database accelerator. Thus, the main memory or extended memory comprises the device memory of the near memory database accelerator. The device memory is therefore part of the main memory or extended memory, directly accessible by the central processing unit.
[0164] Example 21 – Example of a more detailed approach
[0165] Figure 7is a flow chart of an example more detailed method 700 for near memory acceleration of database operations in an in-memory environment, which may be implemented in any of the examples herein, such as Figure 1 , Figure 2 , Figure 3 , Figure 4 and Fig.11 The system shown.
[0166] The process may be performed in response to determining that database operations are to be offloaded (eg, by an in-memory database management system) to a near-memory database accelerator, as described herein.
[0167] At 710, a diversion request is sent. For example, the in-memory database application can send a request to a diversion device driver via a diversion API, as described herein. In practice, the sender (e.g., process, thread, etc.) can then enter a sleep state until the requested operation is completed.
[0168] At 720, a database accelerator engine is allocated and the request is forwarded to the appropriate hardware. In practice, the driver can select the hardware that has the source data to perform the operation, which can be determined based on the virtual address in the request.
[0169] In-memory database applications can only request offload operations and can insert requests into a request queue. The database accelerator kernel can then execute the requests in the queue one by one.
[0170] At 730, the in-memory database accelerator performs the offload operation, which produces results that are stored locally in the database accelerator's hardware.
[0171] At 740, an offload processing completion message is sent from the database accelerator back to the driver.
[0172] The offload processing completion condition is relayed back to the requester at 750. For example, a wakeup message may be sent back to the sender of the API call.
[0173] At 760, the database application can access the results directly from the memory where the results are stored. For example, an output buffer parameter can be specified as part of the request, and the results can then be stored in the output buffer parameter for access. The location of the results can be passed back to the sender for direct access.
[0174] Before the driver requests offload, the in-memory database application can prepare an output area for the results and specify it as part of the request. The database accelerator performs the operation and stores the results in the specified output area.
[0175] Example 22 – Example Memory Communication Channel
[0176] In any example herein, a memory communication channel may be provided between the central processing node and the database accelerator. In practice, the same communication channel used to access the memory may be used to communicate with the database accelerator. When the central processing node directly accesses the memory, it simply bypasses the database accelerator.
[0177] For example, communication between the driver and the database accelerator can be implemented through a bus standard that supports memory mapped I / O (MMIO) (e.g., PCIe, etc.) to map device memory in the same address space as the host memory. Byte addressing access to the memory of the database accelerator can be supported to achieve fast communication of data.
[0178] Exemplary memory interfaces that can be used for the communication channel include DDR (eg, DDR4), etc. Memory interfaces such as Compute Express Link (CXL), Gen-Z, and OpenCAPI can enable new memory pools that host column-based primary storage in an in-memory database management system.
[0179] Example 23 – Example Order of Operations
[0180] Figure 8 8 is a sequence diagram of an example sequence of operations 800 for implementing near memory acceleration for database operations in an in-memory database environment. Such a sequence of operations may be performed by an in-memory database application 810, an offload device driver 830, and a memory kernel executing at a near memory in-memory database accelerator 850 working in concert.
[0181] At 860, the in-memory database application 810 sends an offload request to the offload device driver 830. As described herein, the driver 830 can support an API for sending requests, receiving notifications, and providing results, so that the application is not affected by the hardware details of the near memory in-memory database accelerator 850. The driver 830 dispatches the request 862 to the near memory database accelerator 850, and then performs the database operation.
[0182] After completing execution of the offload database operation, the near memory in-memory database accelerator 850 sends 864 an offload processing completion message to the offload device driver 830 , which then relays 866 the processing completion condition to the in-memory database application 810 .
[0183] The in-memory database application 810 can then retrieve 868 the results from the near memory in-memory database accelerator 850 via a communication channel, as described herein. Retrieving the results can include retrieving the results (e.g., from device memory) to the central processing unit via memory mapped I / O, as described herein. Byte addressing techniques can be used.
[0184] In practice, the process or thread of the in-memory database application that sent 860 the offload request may sleep while waiting for the processing completion condition, which will wake up the process or thread, and the results may then be retrieved as shown.
[0185] Example 24 – Example request to perform a database operation
[0186] Fig. 9 9 is a block diagram illustrating example content of a request 920 to perform a database operation. In practice, such a request 920 is sent from an in-memory database application (e.g., via an API) to an offload device driver 930 (e.g., a database accelerator device driver), which orchestrates and relays the request to a near-memory in-memory database accelerator 950, which performs the operation in situ on source data 955 stored in memory near the database accelerator engine of the accelerator 950.
[0187] As shown, request 920 may include an indication of the input data, such as a pointer to an input data buffer 927. A location to store the results may also be included.
[0188] As described herein, compression details 928 of the source data 955 may also be included. For example, when the source data 955 represents column values in a bit-packed format, the number of bits per value may be indicated. Such information may be included by the near memory in-memory database accelerator 950 when performing database operations when such operations also involve decompressing the source data 955 (e.g., determining which values match a specified predicate, which may also be included in the request 920). The compression type (e.g., a compression type known to the in-memory database application 910) may also be included.
[0189] As noted in the description of the API herein, other parameters may be included in request 920 (eg, to return results, etc.).
[0190] Example 25 – Example Microarchitecture
[0191] Fig.11 1 is a block diagram of a micro-architecture 1100 supporting near memory acceleration for database operations. In this example, a near memory in-memory database accelerator 1110 communicates with a database accelerator driver 1105.
[0192] The near memory in-memory database accelerator 1110 includes a host interface 1120, one or more DBA cores 1130, and a memory subsystem 1140 that ultimately interacts with memories 1160A-N in which in-memory database components are stored.
[0193] As shown in the example, the host interface 1120 may include a communication channel endpoint 1122 that supports a communication (e.g., bus) protocol when interacting with the database accelerator driver 1105. The communication channel 1120 may provide access to a memory crossbar 1145 so that some communications to memory can be achieved without involving the database accelerator core 1130. The host interface 1120 may also support a programming interface 1126 that interacts with one or more DBA cores 1130 so that offloaded database operations can be communicated to the core 1130 for execution.
[0194] The database accelerator core 1130 enjoys close access to the memories 1160A-N by interacting with the memory subsystem 1140. In practice, a given DBA core 1130 may include a prefetcher 1132, a SIMD engine 1134, and a result processor 1136.
[0195] To increase parallelism, the database accelerator cores can split database operations into multiple smaller computations, effectively implementing a local (near memory) version of the single instruction multiple data approach. Different cores can fetch different subsets of the source values and perform simple comparisons independently of other cores; the separate results can be packaged and written back to device memory 1160A-N and then read as a composite result.
[0196] Such an arrangement can exploit SIMD methods without consuming valuable memory to central processing node bandwidth.
[0197] In practice, it is also possible to execute multiple database operations in parallel. The number of parallel units allocated to an operation can be determined by the number of values in the incoming data or other criteria.
[0198] Example 26 – Example API
[0199] In any of the examples herein, an application programming interface (API) may be provided to facilitate communication between an in-memory database application and one or more database accelerators. The details of the API may vary according to various standards. In practice, the API may be used as an abstraction layer that isolates the application from the details of the hardware implementation.
[0200] Example 27 – Example API: Return Codes
[0201] In any of the examples herein, the API can accept a request to offload a database operation and return a return code value indicating the status of the request. For example, one code value can indicate success, while another value can indicate failure. A partially completed value can also be provided if desired.
[0202] The value scheme may use zero for successful completion, negative values for failure, and positive values for partial completion. For example, -1 may indicate not accepted; -2 may indicate a request timed out; etc.
[0203] Partial completion may indicate that resizing is required (e.g., to accommodate row vector output), as described herein.
[0204] Example 28 – Example API: Scan
[0205] In any of the examples in this document, the API can accept requests for offloaded scan database operations. Example scan operations are in Fig.12 The Scan Database operation efficiently searches a database table and returns row identifiers that satisfy a provided predicate within a specified range of row identifiers (eg, by a starting offset and a count).
[0206] The output can be a row vector. The row identifiers that satisfy the predicate can be stored in the vector. The offload device can use an initially null pointer instead. After the offload processing is completed, the output is written to the given vector, where the database application can read the output.
[0207] Alternatively, the output may be a bit vector, where one bit represents a row. The bits of the rows that satisfy the predicate may be set (e.g., to 1).
[0208] Predicates can take a variety of forms. A range predicate can define a range of value identifiers using two unsigned integer values (e.g., from and to). Alternatively, a list predicate can be defined as a bit vector with the bits of the satisfying value identifiers set to 1 (i.e., "match"). Rows in the source data table that have values in the column being processed (e.g., or a portion thereof) that satisfy the predicate are considered to match and are included in the result (e.g., in the format described herein).
[0209] Example 29 – Example API: Scanning function definitions
[0210] Scan function definitions (i.e., requests to offload / execute scan database operations) can vary depending on the scan scenario:
[0211] / / (1)Range Predicate&Row Vector Output
[0212] int mgetSearch_offloading_impl(uint64_t index,uint64_t count,uint32_trangeFrom,uint32_t rangeTo,
[0213] uint64_t*scan_count,const unsigned*prev_start,const unsigned*start,uint64_t*size,uint64_t capacity,
[0214] const unsigned bits,const uint64_t*data,const uint64_t mask);
[0215] / / (2)Range Predicate&Bit Vector Output
[0216] int mgetSearch_offloading_impl(uint64_t index,uint64_t count,uint32_trangeFrom,uint32_t rangeTo,
[0217] const uint64_t*output,const unsigned bits,const uint64_t*data,constuint64_t mask);
[0218] / / (3)In-list Predicate&Row Vector Output
[0219] int mgetSearch_offloading_impl(uint64_t index,uint64_t count,uint64_t*match,
[0220] uint64_t*scan_count,const unsigned*prev_start,const unsigned*start,uint64_t*size,uint64_t capacity,
[0221] const unsigned bits,const uint64_t*data,const uint64_t mask);
[0222] / / (4)In-list Predicate&Bit Vector Output
[0223] int mgetSearch_offloading_impl(uint64_t index,uint64_t count,uint64_t*match,
[0224] const uint64_t*output, const unsigned bits, const uint64_t*data, constuint64_t mask);
[0225] Function parameters can be as follows:
[0226]
[0227]
[0228] Thus, the input data buffer is used as the source data for the scan, and the result is placed in the bit vector output pointer. Other arrangements are also possible.
[0229] Example 30 – Example API: Scan Resize Processing
[0230] In any of the examples herein, during processing of a database operation by a database accelerator, the size of an output buffer (e.g., a capacity specified in a request) may not be large enough. In this case, in response to detecting at the database accelerator that the size of the output buffer is insufficient (e.g., based on a capacity parameter), the API may return a partially completed result. The in-memory database management system may then allocate additional space and may resume processing.
[0231] For example, the row vector output buffer size might not be large enough. Fig.13 is a block diagram of an example resizing process for row vector output.
[0232] After the offload call for the initial allocation of the result, the database accelerator detects that the buffer is insufficient. For example, if (capacity size = < threshold), the database accelerator returns a vector resize request as a return code.
[0233] The vector resize process may include a request by the database accelerator to request a resize of the vector. The in-memory database management system may perform a reallocation. The database accelerator may copy the data in the previous vector. The in-memory database management system may resume the API with new parameters after the resize.
[0234] An in-memory database management system can manage the allocation and deallocation of allocated memory after use.
[0235] The details of this processing can be as follows:
[0236] The variable scan_count (the number of rows scanned so far) can be set to zero.
[0237] The variable size (number of rows in the output array) can be initially set to zero.
[0238] Unless start_ptr1 is null, the Database Accelerator Scan Engine can copy the data in start_ptr1 to atart_ptr2. When copying data, the number of rows to copy is defined by size.
[0239] The Database Accelerator scan engine starts scanning from [index+scan_count] (inclusive) to [index+count] (exclusive).
[0240] The row identifiers of the rows that satisfy the predicate can be added from start_ptr2[size] during a database accelerator scan.
[0241] When returning from the branch, the database accelerator returns the number of rows scanned so far in the variable scan_count and the number of rows in the variable-size output array.
[0242] After the result buffer has been fully allocated, scanning can be resumed.
[0243] Example 31 – Example API: Lookup Database Operations
[0244] In any of the examples herein, a database accelerator can handle offloading lookup database operations. In the case of an in-memory database, the lookup may involve unpacking a column vector within a range of row identifiers specified by a starting offset and a count. The uncompressed value identifiers can then be stored into an array specified by a target pointer.
[0245] An example of a basic implementation of a lookup (e.g., mget) is as follows:
[0246]
[0247] get() can return the uncompressed valueID at the specified index. The processing of get() may differ depending on whether sparse compression or indirect compression is used.
[0248] Example 32 – Example API: Finding a function definition
[0249] The lookup function definition can vary depending on the situation:
[0250] (1)Lookup for bit-packed compression
[0251] int mget_offloading_impl(uint64_t index,uint64_t count,unsigned*dest,void*cache,
[0252] const unsigned bits, const uint64_t*data, const uint64_t mask);
[0253] (2)Lookup for sparse compression
[0254] int mget_offloading_impl(uint64_t index,uint64_t count,unsigned*dest,void*cache,
[0255] const SparseMemoryDocumentsWrapper*doc);
[0256] (3)Lookup for indirect compression
[0257] int mget_offloading_impl(uint64_t index,uint64_t count,unsigned*dest,void*cache,
[0258] const IndirectMemoryDocumentsWrapper*doc);
[0259] Function parameters can be as follows:
[0260]
[0261] Example 33 – Example API: Seeking in bitpacking compression
[0262] The lookup may involve source values that have undergone bit-packing compression. To process the lookup, the database accelerator may unpack the vector within the range and store the value identifiers into the target array. Fig.14 is a block diagram of an example of bit packing compression in a lookup database operation. Additional parameters of the lookup database operation may be provided as follows:
[0263]
[0264] Example 34 – Example API: Seeking in Sparse Compression
[0265] Lookups can involve source values that have undergone sparse compression. Input parameters can include type adjustments for this advanced compression. The SparseMemoryDocumentsWrapper structure can be as follows:
[0266]
[0267]
[0268] Such a structure can reflect the underlying structure of an in-memory database management system with the added fields of bitsNonZeroValues and bitsPositions as shown. Such a class-wise data structure can be flattened with primitive types.
[0269] Class members in a data structure can include the following:
[0270] itsValueCount, which contains the number of distinct values;
[0271] itsZeroValue, which contains the valueID of the most frequent value;
[0272] itsNonZeroDocuments, which is a list of one-bit values indicating that if the set of values is zero (the most frequent one), then the value is non-zero (not the most frequent one);
[0273] itsNonZeroValues (aka non-zero vector), which is the bit-packed non-zero values (except the most frequent one) and the number of bits per value: the same as in the bit-packed compressed data before sparse compression;
[0274] itsPositions , which is a bit-packed vector of values indicating the starting position of the nonzero vector for each group of 128 values and the number of bits per value: based on the number of data items in the column vector (not based on the size of the nonzero vector [ itsNonZeroValues ]). For example, if the number of data items is 2,000,000,000, then the number of bits per value is 31; and
[0275] itsZeroOffset, which contains the number of values prefixed with zero values (in multiples of 128).
[0276] Fig.15 An example method 1500 for lookup in the case of sparse compression is shown. In this example, itsZeroOffset is a multiple of the group size (128) in sparse compression. docid=0 is preserved even if prefix compression is applied.
[0277] Example 35 – Example API: Lookup in Sparse Compression Pseudocode
[0278] The search in the sparse compression case can be implemented with the following pseudocode:
[0279] Get(int docID)
[0280] If docID=0&&itsZeroOffset>0then / / if docid=0&&prefix compression isapplied
[0281] Return itsValueCount / / docID=0is reserved to represent the number of distinct values
[0282] Else if docID <itsZeroOffset||itsNonZeroDocuments[docID-itsZeroOffset]=0 / / if it is zero value
[0283] Return itsZeroValue
[0284] Else
[0285] GROUP_INDEX=(docID–itsZeroOffset) / 128
[0286] FIRST_INDEX=GROUP_INDEX*128
[0287] POSITION=itsPositions[GROUP_INDEX]
[0288] If FIRST_INDEX<(docID–itsZeroOffset)then
[0289] POSITION+={The number of bit sets in itsNonZeroDocuments from FIRST_INDEX to(docID–itsZeroOffset)}
[0290] Return itsNonZeroValues[POSITION]
[0291] Example 36 – Example API: Seeking in Indirect Compression
[0292] Lookups may involve source values that have undergone indirect compression. To process the lookup, the database accelerator may perform decompression as needed. Fig.16 is a block diagram illustrating a lookup database operation in the indirect compression case.
[0293] The IndirectMemoryDocumentsWrapper structure can be as follows:
[0294]
[0295] Such a structure can mirror the underlying structure of an in-memory database management system, with the added field of bitsValues, as shown. Such a class-wise data structure can be flattened with primitive types.
[0296] The wrapper for IndBlockInfos can be as follows:
[0297] struct IndBlockInfosWrapper{
[0298] int offset; / / from IndBlockInfos::offset
[0299] unsigned bits; / / from IndBlockInfos::ind::m_bitsPerValue,set to 32ifthe cluster is uncompressed
[0300] uint64_t*data; / / from IndBlockInfos::ind::m_buffer,set to nullptr ifthe cluster is uncompressed
[0301] };
[0302] Class members in a data structure can include the following:
[0303] itsValues: bit-packed vector containing the cluster dictionary (if applied) or uncompressed clusters (if not applied); number of bits per value: same as in the bit-packed compressed data before indirect compression
[0304] itsClusters: IndBlockInfos::offset: starting index of the index vector for each cluster (itsValues); IndBlockInfos::ind: bit-compressed block of compressed clusters (if applied) (the number of bits per value is 0-10, depending on the number of distinct values in each cluster; if the number of bits per value = 0, the valueIDs of rows in the cluster are identical
[0305] itsZeroValue: contains the number of different values
[0306] itsPrefixValue: contains the value at docid=1 (0 is reserved) if prefix compression is applied itsPrefixOffset: contains the number of prefix values and the prefix value (multiple of 1024).
[0307] Fig.17 An example method 1700 for lookup in the case of indirect compression is shown. In the example, itsPrefixOffset is a multiple of the cluster size in indirect compression (eg, 1024). docid=0 is preserved even if prefix compression is applied.
[0308] Example 37 – Example API: Lookup in Indirect Compression Pseudocode
[0309] The search in the indirect compression case can be implemented with the following pseudo code:
[0310]
[0311]
[0312] Example 38 – Example Data Compression
[0313] In-memory database management system
[0314] In any examples herein, an in-memory database management system can implement compression when storing data in memory, and such data can be a source value for a database accelerator that performs database operations on the data stored in memory. As described herein, multiple compression schemes can be supported. The in-memory database management system can track which database elements are using which type of compression. Column stores can utilize advanced compression techniques to represent a large number of values in a small memory footprint.
[0315] Example 39 – Example Data Compression
[0316] In-memory database management system: bit-packing compression
[0317] By default a bit compression scheme is used. Fig.18is a block diagram of a data structure 1800 for use in bit-packing compression of database components in an in-memory database management system.
[0318] In the example, column data is stored by a dictionary and a ValueID array. The ValueID array can be compressed to save memory usage. Therefore, in practice, bit packing compression can be used with other compression schemes described herein (e.g., sparse, clustered, run-length encoding, indirect, etc.).
[0319] Fig.19 is a block diagram of a bit-packed (i.e., compressed) ValueID array. Only the meaningful bits need to be used to preserve the value. In the example, the value can be stored with fewer bits (e.g., not required to be aligned to a byte boundary, such as 17 bits in the example) than when unpacked (e.g., typically does align to a byte boundary, such as 32 bits in the example). The number of bits can be tracked by the in-memory database and provided as a parameter to the database accelerator to facilitate decompression.
[0320] In-memory database management systems: Column storage compression
[0321] As described herein, a variety of compression schemes can be used for column stores. Such compression can be used on the ValueID array of the main store. A separate delta store can also be maintained, and compression results can be calculated and performed during a delta merge when the delta store is merged with the main store (e.g., in a merge operation). Fig. 20 2000 is a block diagram illustrating different column store compression scenarios: prefix encoding, run-length encoding, cluster encoding, sparse encoding, and indirect encoding. The database accelerator can be configured to perform database operations on source data in any compression format. Thus, a database accelerator that is aware of multiple compression schemes can be implemented.
[0322] Prefix encoding: If the column starts with a long sequence with the same value V, the sequence is replaced by storing the value and the number of occurrences at once. This makes sense if there is one dominant value in the column and the rest are mostly unique or have low redundancy.
[0323] Run-length encoding replaces sequences of identical values with a single instance of that value and its starting position. This variation of run-length encoding was chosen because it allows faster access than storing the number of occurrences of each value.
[0324] Cluster encoding divides the array into N fixed-size chunks (e.g. 1024 elements). If a cluster contains only occurrences of a single value, the cluster is replaced by a single occurrence of that value. A bit vector of length N indicates which clusters are replaced by a single value.
[0325] Sparse coding removes the most frequently occurring values V. The bit vector indicates which positions V were removed from the original array.
[0326] Indirect encoding is also based on division into blocks of 1024 elements. If a block contains only a few different values, an additional dictionary is used to encode the values in this block. The figure illustrates this concept for a block size of 8 elements. The first and third blocks consist of no more than 4 different values, so a dictionary with 4 entries and encoding of values with 2 bits is possible. For the second block, such compression does not make sense. With 8 different values, the dictionary would require the same space as the uncompressed array. The implementation would also need to store information which blocks have been encoded using other dictionaries and links to other dictionaries.
[0327] In-Memory Database Management Systems: Sparse Compression
[0328] Fig.21 is a flow chart of an example method 2100 for sparse compression in an in-memory database management system. Finally, IndexVector itsNonZeroValues contains non-zero values (e.g., all values except the most frequent one), also known as a non-zero vector. BitVector itsNonZeroDocuments contains a list of one-bit values indicating whether the value is zero or non-zero. IndexVector itsPositions is a bit-packed vector of values indicating the starting position of the non-zero vector in each group (e.g., 128) of values.
[0329] The condition is to find zero values (the most frequent value). Compression can also apply prefix compression of zero values (e.g. SpDocuments:itsZeroOffset[aligned by 128]).
[0330] The first example roaming with prefixes assuming a location granularity of 4 is as follows:
[0331] Input: (3),0,0,0,0,1,2,1,1,1,1,1,1,1,2,2,2,2,2,2,0,0,0,1,0,0,0,0,1,1,1,1,1,1,1,1,0,1,2,0,0,0,0,0,0
[0332] Zero value: 0
[0333] Zero offset: 4
[0334] Non-zero vector: 1,2,1,1,1,1,1,1,1,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,2
[0335] Bit vector: 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0
[0336] Position:0,3,7,11,15,16,16,20,24,26,26
[0337] When applying prefix compression, docID=0 is ignored as it is reserved.
[0338] The number of bits in the bit vector matches the size of the data excluding the prefix.
[0339] The number of values in the position vector matches the number of groups without the prefix.
[0340] A second example of prefix-free roaming assuming a location granularity of 4 is as follows:
[0341] Input: (3),0,0,0,0,1,2,1,1,1,1,1,1,1,2,2,2,2,2,2,0,0,0,1,0,0,0,0,1,1,1,1,1,1,1,1,0,1,2
[0342] Zero value: 1
[0343] Zero offset: 0
[0344] Non-zero vector: (3),0,0,0,0,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,2
[0345] Bit vector: 1,1,1,1,1,0,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,1,0,1
[0346] Position:0,4,6,6,8,12,15,19,19,19
[0347] There is no prefix compression because, except for the value at docid=0, none of the values are zero.
[0348] Fig. 22 is a flow chart of an example method 2200 of sparse decompression for use in an in-memory database management system.
[0349] In-memory database management systems: Indirect compression
[0350] In any of the examples herein, indirect compression may also be used for value identifiers. Fig.23is a block diagram of an example of an indirect compression technique 2300 for use in an in-memory database management system. The index vector contains the new dictionary and, for uncompressed blocks, the original values.
[0351] The bit-compressed blocks are formed as follows: each block is re-encoded using the index of the dictionary, then bit-compressed and then stored sequentially in the bit-compressed block vector.
[0352] Offset vector: For each block, the structure keeps a record of where the data relating to the block starts in the index vector, in this case in the bit-compressed block vector, and how many bits are used to encode it.
[0353] Fig.24 is another block diagram of an example of an indirect compression technique 2400 for use in an in-memory database management system.
[0354] Assuming a cluster size of 8, an example of indirect compression without a prefix is as follows:
[0355] Input: (7),0,0,1,0,0,1,0,0,1,1,1,2,1,1,1,0,2,2,1,2,2,2,3,4,0,5,6,3,4,5,2,2,4,2,2,4,2,4,2
[0356] Prefix value: 0
[0357] Prefix offset: 0
[0358] Index vector: (7),0,1,2,0,2,1,3,4,0,5,6,3,4,5,2,2,4
[0359] Vector of IndBlockInfos
[0360] –[0].offset=0,[0].ind=0,1,1,2,1,1,2,1(2-bit)
[0361] –[1].offset=0,[1].ind=1,2,2,2,3,2,2,2(2-bit)
[0362] –[2].offset=4,[2].ind=0,1,1,2,1,1,1,3(2-bit)
[0363] –[3].offset=8,[3].ind=empty(uncompressed)
[0364] –[4].offset=16,[4].ind=0,1,0,0,1,0,1,0(1-bit)
[0365] There is no prefix compression because not all values in a cluster are identical except for the value at docid=0.
[0366] Fig.25 is a flow chart of an indirect compression method 2500 used in an in-memory database management system.
[0367] For indirect compression, the output is as follows:
[0368] The index vector contains
[0369] – a dictionary of clusters (if applied) or a column vector of uncompressed clusters (if not applied); and
[0370] Vector of IndBlockInfos
[0371] – IndBlockInfos::offset – The starting index of the index vector for each cluster
[0372] – IndBlockInfos::ind – Bit-compressed blocks (vector of indices) of compressed clusters if applicable.
[0373] The condition for indirect compression is that, for each cluster, the size of the cluster dictionary plus the size of the bit compression block should be small.
[0374] You can also use IndDocuments::itsPrefixValue and IndDocuments::itsPrefixOffset (e.g., align by 1024) to prefix-compress the first value.
[0375] Fig.26 is a flowchart of the indirect decompression method used in an in-memory database management system. The following can be used:
[0376] writePtr[i]=clusterDict[clusterBuffer[i]];
[0377] In-memory database management system: Cluster dictionary
[0378] The database accelerator can also perform database operations on values involving a cluster dictionary as part of indirect compression. The cluster dictionary can take the form of a vector of distinct values in each cluster and a list of mapping indices into the vector to help look up values in the vector.
[0379] The properties of the cluster dictionary are that the values in the cluster dictionary are integer valueIDs, and they are unordered to avoid rebuilding previous bit-compressed blocks when merging cluster dictionaries.
[0380] The result of the merge is conditional on the bit width of the number of distinct values being the same between the previous and next. It can be accepted when n = 2^(k-1), where k is the bit width. Likewise, the number of other distinct values in the next cluster dictionary does not require any additional bits.
[0381] During the merge operation, the other distinct values are appended to the previous cluster dictionary. The bit-compressed blocks of the current cluster can be reconstructed based on the merged dictionary.
[0382] Fig. 27 is a block diagram of cluster dictionary processing in indirect compression used in an in-memory database management system.
[0383] Example 40 – Example of performance degradation of traditional approach
[0384] Fig.28 The performance degradation of online transaction processing (OLTP) workload due to the interference of scan workload on online analytical processing (OLAP) data in a server with 4 sockets and 72 physical cores is shown. The two workloads managed by two separate processes access different sets of data but compete with each other due to limited hardware resources such as CPU, cache, and memory bandwidth. As the number of scan threads increases, the CPU resources allocated to the OLTP workload decrease, so the throughput of the OLTP workload decreases.
[0385] Since SIMD (Single Instruction, Multiple Data) performs the same operation on multiple data points simultaneously leveraging data-level parallelism, SIMD instructions can be applied to data-intensive operations such as scans within the DBMS. It can be observed that OLTP workloads exhibit greater performance degradation when scan operations are performed using SIMD commands such as AVX2 or AVX 512, due to the greatly increased memory bandwidth usage. As shown in Table 1, with SIMD, the 64 scan threads consume almost all of the memory bandwidth of the 4 sockets, while without SIMD, only 12% of the memory bandwidth is consumed. Interestingly, there is no difference in CPU utilization between SIMD and NO-SIMD, but the OLTP throughput shows that SIMD causes a greater performance degradation. Figure 1 In the 2018 dataset, OLTP CPU utilization was reduced by 30% with 64 scan threads, but OLTP throughput was reduced by about 40% without SIMD and by more than 50% with SIMD. This supports the claim that data-intensive workloads using greater memory bandwidth will further degrade OLTP performance.
[0386] Table 1: Memory bandwidth utilization (%) by scanning workload
[0387] #Threads AVX2 AVX512 No_SIMD 4 11.3 6.0 0.8 8 21.8 12.3 1.3 16 41.3 23.0 2.8 32 73.8 46.3 5.5 64 94.8 85.3 11.3
[0388] Example 41 – Example Scan Operation in an In-Memory Database Management System (IMDBMS)
[0389] The latest in-memory database management systems can be designed to support both OLTP and OLAP workloads and keep data in column stores for fast read access to tables, store most of the data for each column in a read-optimized main store, and maintain a separate delta store to optimize writes. The delta store is periodically merged to the main store. To reduce the memory footprint (or total cost of ownership), the main store uses a dictionary encoding, where different values are stored in a dictionary and each value is replaced with the corresponding value ID of the dictionary and bit compressed. A scan in an IMDBMS reads this array of value IDs with a filter condition. In the example described in this article, two common scan operations: range search (with from / to filter conditions) and inner list search (list with filtered values) can be offloaded to the database accelerator because they are simple and common data-intensive operations that usually consume relatively high CPU usage (5-10% by themselves). They include decompression of the value ID (integer) array and returning row IDs that satisfy the predicate. Offloading only low-level data access operators in the query plan reduces the effort to integrate them with existing query optimizers.
[0390] Example 42 – Example Database Accelerator Architecture: FPGA
[0391] Fig.10 The architecture of the proposed system for measuring the performance of a near-memory database accelerator is shown in Figure 1. This example demonstrates the feasibility of offloading in the current ecosystem, provides a framework for measuring the performance of a standalone database accelerator engine, and enables the study of the impact of this technique on the system. To eliminate unnecessary data movement, the database accelerator will perform database operations in the device memory where the source data is stored. After the database accelerator completes the operation, the resulting output is written back to the device memory in the FPGA. The host can access the device memory through memory mapped I / O (MMIO). This eliminates the speed and consistency limitations of the PCIe interface under study, but still utilizes the current driver software stack with the OS and application.
[0392] Fig.11An example database accelerator FPGA micro-architecture is shown, having a functional partitioning of a host interface 1120, multiple DBA cores 1130, and a memory subsystem 1140. The host interface 1120 exposes database accelerator control parameters to a driver 1105 that manages offloading application API calls to the hardware accelerator. A given database accelerator core 1130 may include a data prefetcher 1132 that reads data, a SIMD engine 1134 that compares data to predicates, and a result processor 1136 that writes results. The memory subsystem 1140 provides an architecture for accessing device memory 1160A-N on the FPGA.
[0393] Internally, the database accelerator core 1130 can read bit-compressed source data (e.g., one block at a time, such as 64B) from memory 1160A-N. Programmable extractor logic can split the source data into multiple values. Multiple values can be fed into an array of simple processing units, each of which can perform simple comparisons independently. The number of parallel units in the array can be determined by the number of values in the data block, so that the database accelerator core can keep up with the input data rate. Compared with fixed-length instruction-based processors, the database accelerator core can take full advantage of the parallelism in the data stream due to the flexibility of the hardware design. The results are packed into blocks (e.g., 64B) and written back to the device memory. Therefore, the data stream can be highly optimized for the available memory bandwidth.
[0394] Figure 5 and Figure 8 An example database accelerator software architecture is shown. Unlike GPU / FPGA accelerators, the database accelerator engine is located in the memory device. Therefore, it allows zero data copying with performance and energy gains. For each request, the database accelerator device driver will assign a database accelerator engine to the thread of the in-memory database management system application. Once offloaded, the thread requesting the offload will release the central processing node for processing. When the offload is completed, the database accelerator driver will wake up the requester to resume.
[0395] Typically, applications use virtual addresses (VA) to access memory in the host system, while the database accelerator engine uses device physical addresses (DPA) to access memory. This means that the DBA driver is responsible for converting all VA parameters of the offload request to DPA. The database accelerator driver first obtains the corresponding system physical address (SPA) by referring to the page table. Then, converting DPA to SPA is trivial because the system BIOS has stored the starting SPA of the device memory in the BAR register of the PCI device at boot time.
[0396] Example 43 – Evaluation: Example Setup
[0397] The system setup used for the evaluation has the embedded Transaction Processing Performance Council Benchmark C (TPCC) benchmark in an in-memory database management system, and a separate microbenchmark program for generating scan workloads in a single server, such as Fig.29 shown.
[0398] In an example, the TPCC benchmark can be used for an online transaction processing workload. Its generator is embedded in the in-memory database management system engine to eliminate communication and session management overhead, because the total throughput is usually bound by the session layer rather than the in-memory database management system engine. For benchmarking, one can try to make TPCC consume as much CPU resources as possible.
[0399] The microbenchmark executes the scan workload on the CPU or through an FPGA. Its data is randomly generated and bit-compressed. The separate data for the scan avoids the internal overhead of the in-memory database management system (such as being locked by two different workloads) and makes it possible to focus on the impact of hardware resources on performance. In the example, the scan reads 2 billion bit-compressed integer values and returns the row IDs that meet the filter conditions. When it runs on the CPU, the same number of scan threads is bound to each socket to prevent the workload from being skewed between sockets on a 4-socket server (Intel Xeon Gold 6140@2.30GHz, 18 cores and 6*64GB memory per socket). For database accelerator offload, each socket can be attached with an Ultrascale+FPGA@250MHz, and each FPGA can hold 6 scan engines with 4*64GB DDR4 DIMMs@1866MHz. The scan data is copied to the memory of each FPGA to simulate the DBA offload running in the memory device where the data resides. It is possible to compare the performance variations of the TPCC workload and measure the latency and throughput scalability of the scan workload in both choices (on CPU vs. on FPGA) while increasing the number of scan threads.
[0400] Example 44 – Evaluation: Results
[0401] The proof of concept results for the database accelerator results can be compared to a recent 4-socket Skylake system with 72 physical cores.
[0402] Fig.30Indicates the system performance gain of in-memory database management system. The TPCC workload was run in the server and the scan microbenchmark was run on the CPU or database accelerator with different numbers of threads. As a result, the database accelerator offload showed less performance degradation as the number of scan threads increased. Therefore, the database accelerator offload showed a 115% improvement in tpmC (transactions per minute) in the TPCC workload when all 64 scan threads were offloaded compared to using AVX2 on the CPU. The results confirm that the database accelerator offload can alleviate CPU conflicts, cache thrashing, and memory bandwidth conflicts with data-intensive operations.
[0403]
[0404] When running the scan without a preceding transaction workload, the database accelerator offload shows better performance in the scan operation itself. As shown in Table 2, the database accelerator offload shows a latency (seconds / scan) that is 1.5 times that of AVX2 and 14.3 times that of NO-SIMD.
[0405] Regarding scalability of throughput (scans / second), database accelerator offloads show very promising performance, such as Fig.31 The solid line represents the scan throughput when the TPCC workload is executed simultaneously. The dashed line represents the scan throughput without the TPCC workload. The database accelerator offload shows similar performance with or without the TPCC workload, while the scan using SIMD / NO-SIMD shows a significant performance drop due to the interference of the TPCC workload. The database accelerator offload outperforms the SIMD / NOSIMD scan using up to 16 threads and shows similar performance to the SIMD scan with 32 threads. In the evaluation implementation, each database accelerator FPGA has 6 scan engines and 4 DIMM slots. The results show that the throughput of the DBA offload has reached saturation with 16 threads (4 threads per FPGA) due to the limited memory bandwidth of the 4 memory channels and resources in the FPGA. Each CPU has 6 DDR channels with a bandwidth of 128GB / sec, while each FPGA has 4 DDR channels with a bandwidth of 60GB / sec. When the database accelerator has the same number of threads, its performance is better than the CPU running SIMD. In a SoC (system on chip) implementation where the database accelerator is offloaded and embedded into the actual memory device, these limitations will be alleviated, and higher clock frequencies or more database accelerator engines will further improve the overall performance.
[0406] In the example, there is a similar performance gain whether in range scans or inlist scans, and the results are similar regardless of the bit case used in the bitpacking compression.
[0407] Example 45 – Example Memory Devices and Accessibility
[0408] Although some examples involve DRAM-DIMMs, and the central processor accesses data on the DRAM via memory mapped I / O, the features described herein may be implemented on any memory device and may typically be accessed via the DDR protocol or through an interface such as CXL, Gen-Z, etc.
[0409] Therefore, the database accelerator engine can be implemented on a memory device. Such a memory device can be byte-addressed by the central processing unit, and the communication between the memory device and the central processing unit can be implemented via a common protocol such as DDR (e.g., DDR4, DDR5, etc.) or other protocols (such as CXL, Gen-Z, etc.).
[0410] Therefore, the results can be retrieved by byte addressing technique.
[0411] Features can also be implemented with memory devices connected to PCIe through memory mapped I / O.
[0412] The device memory may include one memory device or multiple memory devices.
[0413] Example 46 – Example Optimization
[0414] Although the term "optimization" is used herein, such terms do not necessarily mean finding the best possible solution. Rather, optimization can take the form of an improved solution (e.g., a solution that is better than other solutions). In some cases, so-called "optimized" data movement may not involve any movement at all (e.g., processing the source data in place).
[0415] Example 47 – Further description of the evaluation
[0416] The described evaluation was performed using a DIMM-attached FPGA. The host system accesses the device memory through PCIe MMIO (Memory Mapped I / O) by mapping the device memory into the same address space of the host memory. Even though the performance of MMIO is slower in PCIe, the offload performance is not affected because the implemented offload only accesses the local device memory on the FPGA once the offload operation starts.
[0417] Database accelerator offload can be implemented on a variety of memory form factors, each with its own advantages and disadvantages. DIMM-based memory is very common and very fast, but the memory controller will naturally interleave data between memory channels. So even if a value can be interleaved on two DIMMs, the database accelerator driver can handle the data interleaving when processing the offloaded operation.
[0418] Other possible interfaces, such as CXL (Compute Express Link), Gen-Z, and OpenCAPI, will enable new pools of memory that host columnar main storage in the IMDBMS. Although these interfaces introduce higher latency than DIMMs, these memory devices are not part of the host storage controller's pool where data is typically interleaved at 64B granularity. This allows the database accelerator to assume a contiguous data layout in its attached memory and operate without having to consider the interleaving of data across storage channels. There may be non-continuity in the physical address space for data that is contiguous in the virtual address space. Database accelerator offloads can provide so-called "scatter and gather" functionality by building page translation tables.
[0419] In a cloud environment, the microservices of an in-memory database management system can be distributed across multiple nodes (servers) according to their roles, such as computing or storage. The computing nodes used to process front-end transactions (or queries) can be easily expanded to handle more workloads, but the storage nodes cannot be simply expanded. Database accelerator offload can help solve this situation in the cloud.
[0420] Example 48 – Example Advantages
[0421] Possible advantages of the described offloading techniques include improved overall performance when performing database operations in an in-memory database.
[0422] Without a database accelerator, a memory wall can form between the processor and DRAM, resulting in high latency, low bandwidth, and high power consumption. In-memory databases can involve a large number of data accesses, resulting in increased memory bottlenecks, more cache crashes, memory-bound conditions (CPU stalls) when transferring data, etc.
[0423] As described in this article, database operations that are expensive in terms of memory access in an in-memory database environment can be offloaded to where the data resides (e.g., a memory device) using near-memory processing. Although scans (e.g., searches within a range / list) and lookups (e.g., batch retrieval of a range of rows for aggregation) were used in the proof of concept, any database operation can benefit. The result is less CPU usage, fewer cache misses, and fewer memory-bound conditions. The general effect is Fig.32The data path from the CPU to the memory is freed up for other processing other than offloading database operations.
[0424] In any of the examples herein, the technology can be implemented in an in-memory database management system such as HANA from SAP SE of Walldorf, Germany, or other in-memory systems. A driver can be placed to handle the various hardware implementations while maintaining an abstraction layer (e.g., an application programming interface) that allows applications to utilize the DBA in a predictable, uniform manner, regardless of the underlying hardware implementation.
[0425] Although range and inlist database operations are shown in the examples, other database operations can be implemented. Any such database operation can be offloaded to the DBA through the offload API functions.
[0426] Observations show that mission-critical workloads like OLTP can be disrupted by data-intensive operations such as large scans. Near-memory database accelerators (DBAs) can improve (e.g., avoid) data movement, and performing expensive scan operations in memory devices can alleviate CPU load, cache conflicts, and host memory bandwidth bottlenecks. To confirm its feasibility, an example offload system is implemented using an FPGA with DIMMs. Results show more than 2x performance improvement on OLTP workloads when offloading data-intensive operations, and higher or similar throughput scalability with better latency in offloaded scan workloads.
[0427] Aggregation is another data intensive operation in IMDBMS which consumes about 20-50% CPU usage depending on the workload. It reads massive data but most of the data is not reused in subsequent processing steps. DBA offload on aggregation is being studied as the next target operation.
[0428] In any examples herein, operations may be performed on source data in-situ (in-place while the data resides in memory) by hardware associated with or integrated with hardware storing the source data.
[0429] Example 49 – Example Computing System
[0430] Fig.33 An example of a suitable computing system 3300 is depicted in which the described innovation may be implemented. Because the innovation may be implemented in a variety of computing systems, computing system 3300 is not intended to suggest any limitation as to the scope of use or functionality of the disclosure.
[0431] Reference Fig.33 , the computing system 3300 includes one or more processing units 3310, 3315 and memories 3320, 3325. Fig.33, the basic configuration 3330 is included within the dashed line. Processing units 3310, 3315 execute computer executable instructions, such as for implementing the features described in the examples herein. The processing unit may be a general-purpose central processing unit (CPU), a processor in an application-specific integrated circuit (ASIC), or any other type of processor. In a multi-processing system, multiple processing units execute computer executable instructions to increase processing power. For example, Fig.33 A central processing unit 3310 is shown, as well as a graphics processing unit or co-processing unit 3315. Tangible memory 3320, 3325 may be volatile memory (e.g., registers, cache, RAM), non-volatile memory (e.g., ROM, EEPROM, flash memory, etc.), or some combination of both, accessible by the processing units 3310, 3315. The memory 3320, 3325 stores software 3380 implementing one or more innovations described herein in the form of computer-executable instructions suitable for execution by the processing units 3310, 3315.
[0432] In any of the examples described herein, dedicated memory hardware may be included to implement DBA functionality.
[0433] The computing system 3300 may have additional features. For example, the computing system 3300 includes a storage device 3340, one or more input devices 3350, one or more output devices 3360, and one or more communication connections 3370, including input devices, output devices, and communication connections for interacting with a user. An interconnection mechanism (not shown) such as a bus, controller, or network interconnects the components of the computing system 3300. Typically, operating system software (not shown) provides an operating environment for other software executed in the computing system 3300 and coordinates the activities of the components of the computing system 3300.
[0434] Tangible memory 3340 may be removable or non-removable and include disks, tapes or cassettes, CD-ROMs, DVDs, or any other medium that can be used to store information in a non-transitory manner and that can be accessed within computing system 3300. Memory 3340 stores instructions for software 3380 that implement one or more innovations described herein.
[0435] Input device(s) 3350 may be an input device such as a keyboard, mouse, pen or trackball, voice input device, scanning device, touch device (e.g., touchpad, display, etc.), or other device that provides input to the computing system 3300. Output device 3360 may be a display, printer, speaker, CD burner, or other device that provides output from the computing system 3300.
[0436] Communication connection(s) 3370 enable communication with another computing entity via a communication medium. The communication medium conveys information such as computer executable instructions, audio or video input or output, or other data in a modulated data signal. A modulated data signal is a signal that has one or more characteristics set and changed in a manner that encodes information in the signal. By way of example and not limitation, the communication medium may use electrical, optical, RF or other carriers.
[0437] The present invention is described in the context of computer executable instructions (such as those included in program modules) that can be executed in a computing system on a target real or virtual processor (e.g., ultimately executed on one or more hardware processors). Typically, program modules or components include routines, programs, libraries, objects, classes, components, data structures, etc. that perform specific tasks or implement specific abstract data types. In various embodiments, the functionality of program modules can be combined or split between program modules as needed. Computer executable instructions for program modules can be executed within a local or distributed computing system.
[0438] For purposes of presentation, the detailed description uses terms such as "determine" and "use" to describe computer operations in a computing system. These terms are high-level descriptions of operations performed by a computer and should not be confused with operations performed by a human. The actual computer operations that correspond to these terms vary depending on the implementation.
[0439] Example 50 – Computer Readable Medium
[0440] Any computer-readable medium herein may be non-transitory (e.g., volatile memory such as DRAM or SRAM, non-volatile memory such as magnetic storage, optical storage, etc.) and / or tangible. Any storage action described herein may be implemented by storing in one or more computer-readable media (e.g., computer-readable storage media or other tangible media). Anything described as stored (e.g., data created and used during implementation) may be stored in one or more computer-readable media (e.g., computer-readable storage media or other tangible media). Computer-readable media may be limited to implementations that do not include signals.
[0441] Any method described herein can be implemented by computer executable instructions of one or more computer readable media (e.g., computer readable storage media or other tangible media) or one or more computer readable storage devices (e.g., memory, magnetic storage, optical storage, etc.) (e.g., stored on, encoded on, etc.). Such instructions can cause a computing system to perform the method. The techniques described herein can be implemented in a variety of programming languages.
[0442] Example 51 – Example Cloud Computing Environment
[0443] Fig.34 An example cloud computing environment 3400 is depicted in which the described techniques may be implemented. Cloud computing environment 3400 includes cloud computing services 3410. Cloud computing services 3410 may include various types of cloud computing resources, such as computer servers, data repositories, network resources, etc. Cloud computing services 3410 may be centrally located (e.g., provided by a data center of an enterprise or organization) or distributed (e.g., provided by various computing resources located in different locations, such as different data centers and / or located in different cities or countries).
[0444] Cloud computing services 3410 are utilized by various types of computing devices (e.g., client computing devices) such as computing devices 3420, 3422, and 3424. For example, computing devices (e.g., 3420, 3422, and 3424) may be computers (e.g., desktops or laptops), mobile devices (e.g., tablets or smartphones), or other types of computing devices. For example, computing devices (e.g., 3420, 3422, and 3424) may utilize cloud computing services 3410 to perform computing operations (e.g., data processing, data storage, etc.).
[0445] In practice, cloud-based, on-premises, or hybrid solutions can be supported.
[0446] Example 52 – Example Implementation
[0447] Although some disclosed method operations are described in a particular order for ease of presentation, this description includes rearrangement unless specific language set forth herein requires a particular order. For example, operations described in order may be rearranged or performed simultaneously in some cases.
[0448] Example 53 – Other Examples
[0449] Any of the following terms can be implemented:
[0450] Clause 1. A system comprising:
[0451] In an in-memory database management system environment including source data stored in device memory, a plurality of database accelerator engines are configured to perform database operations directly on the source data in-situ.
[0452] Clause 2. The system of clause 1, wherein:
[0453] The database accelerator engine includes an executable database accelerator engine that executes on the near memory processor.
[0454] Clause 3. A system according to any one of clauses 1-2, wherein:
[0455] The database accelerator engine is operable to receive a request from the central processing unit;
[0456] The database accelerator engine is executed by hardware external to the central processing unit; and
[0457] Requests the specified database operation.
[0458] Clause 4. The system of clause 1, wherein:
[0459] The database accelerator engine executes on a near-memory processor separate from the central processing unit.
[0460] Clause 5. A system according to any one of clauses 1-4, wherein:
[0461] The central processing unit retrieves the results of the database operations computed by the database accelerator engine via byte addressing techniques.
[0462] Clause 6. A system according to any one of clauses 1-5, wherein:
[0463] The central processing unit retrieves the results of the database operations computed by the database accelerator engine via the DDR protocol.
[0464] Clause 7. A system according to any one of clauses 1-6, wherein:
[0465] The central processing unit retrieves the results of the database operations computed by the database accelerator engine via memory mapped I / O.
[0466] Clause 8. A system according to any one of clauses 1-7, wherein:
[0467] The database accelerator engine is operable to receive a request from the central processing unit;
[0468] The database accelerator engine is executed by hardware that accesses source data separate from the central processing unit; and
[0469] Requests the specified database operation.
[0470] Clause 9. A system according to any one of clauses 1-8, wherein:
[0471] The database accelerator engine is operable to receive a request from the central processing unit;
[0472] The database accelerator engine is implemented by near memory hardware that accesses source data separate from the central processing unit; and
[0473] Requests the specified database operation.
[0474] Clause 10. A method comprising:
[0475] In an in-memory database management system environment, receiving a request to perform a sequence of database operations on a plurality of values represented in source data stored in a device memory; and
[0476] Performs a series of database operations in-place in device memory.
[0477] Clause 11. The method according to clause 10, wherein:
[0478] A request is received from a central processing unit to offload a series of database operations to a plurality of database accelerator engines.
[0479] Clause 12. The method according to any one of clauses 10-11, further comprising:
[0480] The results of a series of database operations are retrieved to the central processing unit via memory mapped I / O.
[0481] Clause 13. A system comprising:
[0482] In an in-memory database management system environment including source data stored in device memory, a plurality of database accelerator engines configured to perform database operations directly on the source data in-situ; and
[0483] A processor is configured to offload database operations to the database accelerator engine and retrieve results therefrom.
[0484] Clause 14. The system of clause 8, further comprising:
[0485] A hardware processor configured to offload database operations to and retrieve results from a database accelerator engine.
[0486] Clause 15. A method substantially as shown and described.
[0487] Clause 16. A system substantially as shown and described.
[0488] Example 54 – Other further examples
[0489] Any of the following terms can be implemented:
[0490] Clause 1. A method comprising:
[0491] In an in-memory database management system environment, receiving a request to perform a database operation on a plurality of values represented in source data, wherein the source data is stored in a device memory of a near-memory database accelerator;
[0492] offloading database operations to a near-memory database accelerator; and
[0493] An indication is received from the near-memory database accelerator that a result of the database operation is available.
[0494] Clause 2. The method of claim 1, wherein:
[0495] The multiple values represented in the source data are stored in a compressed form in the main storage of the in-memory database management system.
[0496] Clause 3. The method according to any one of clauses 1-2, further comprising:
[0497] Prior to receiving the request, the source data is stored in a device memory of a near memory database accelerator specified by the in-memory database management system configuration information.
[0498] Clause 4. A method according to any one of clauses 1 to 3, wherein:
[0499] The request is received from the in-memory database management system through an application programming interface (API) for scan database operations.
[0500] Clause 5. A method according to any one of clauses 1 to 4, wherein:
[0501] A request is received from the in-memory database management system as a result of a determination within the in-memory database management system that the requested database operation is to be offloaded.
[0502] Clause 6. A method according to any one of clauses 1 to 5, wherein:
[0503] The source data includes an in-memory database component stored in a device memory of a near-memory database accelerator; and
[0504] The near memory database accelerator performs database operations on in-memory database components stored in a device memory of the near memory database accelerator.
[0505] Clause 7. The method according to claim 6, wherein:
[0506] The source data is compressed; and
[0507] The request includes compression information of the source data, and the near memory database accelerator decompresses the source data using the compression information.
[0508] Clause 8. The method of claim 7, wherein:
[0509] The source data is compressed according to a bit packing compression format, and the compression information specifies the number of bits of the bit packing compression format.
[0510] Clause 9. A method according to any one of clauses 1 to 8, wherein:
[0511] The near memory database accelerator includes a database accelerator engine co-resident with the device memory and configured to perform database operations; and
[0512] Device memory is separate from the central processing node.
[0513] Clause 10. A method according to any one of clauses 1 to 9, wherein:
[0514] receiving a request at a central processing unit;
[0515] The device memory is directly accessible by the central processing unit; and
[0516] The near memory database accelerator includes a database accelerator engine separate from the central processing unit, wherein the database accelerator engine is configured to perform database operations.
[0517] Clause 11. The method according to claim 10, wherein:
[0518] Offloading relieves the central processing unit from processing data paths other than database operations.
[0519] Clause 12. A method according to any one of clauses 1 to 11, wherein:
[0520] The source data includes database table values in column format;
[0521] The database operation consists of a table scan for the specified predicate; and
[0522] The results indicate for which database column values the specified predicate is valid.
[0523] Clause 13. A method according to any one of clauses 1 to 12, wherein:
[0524] The request is received from the in-memory database application by the near memory database accelerator driver, which interacts with the near memory database accelerator on behalf of the in-memory database application.
[0525] Clause 14. A method according to any one of clauses 1 to 13, wherein:
[0526] Database operations are performed in-place in device memory by a near-memory database accelerator.
[0527] Clause 15. The method according to any one of clauses 1 to 14, further comprising:
[0528] The results are retrieved from the device memory to the central processing unit, wherein the retrieval bypasses the database accelerator.
[0529] Clause 16. The method of any of clauses 1-15, wherein the request includes a capacity parameter specifying a size of the output buffer, and the method further comprises:
[0530] In a near memory database accelerator, detecting that a size of an output buffer is insufficient to hold the result based on a capacity parameter; and
[0531] In response to detecting that the size of the output buffer is insufficient, a partially completed result is returned.
[0532] Clause 17. A system comprising:
[0533] one or more processing units;
[0534] main memory or extended memory directly accessible to one or more processing units; and
[0535] a near memory database accelerator driver configured to receive a request to perform a database operation on source data stored in a device memory of a near memory database accelerator, the near memory database accelerator comprising at least one database accelerator engine separate from the one or more processing units, offload the database operation to the near memory database accelerator to be performed by the at least one database accelerator engine separate from the one or more processing units, and receive an indication from the near memory database accelerator that a result of the database operation is available;
[0536] The main memory or the extended memory includes a device memory of a near memory database accelerator.
[0537] Clause 18. The system of claim 17, wherein:
[0538] The near memory database accelerator driver is configured to return a partial completion result if the result is too large for the output buffer capacity specified in the request.
[0539] Clause 19. A system according to any of clauses 17-18, wherein:
[0540] The one or more processing units retrieve results of database operations computed by the at least one database accelerator engine via memory mapped I / O.
[0541] Clause 20. One or more computer-readable media comprising computer-executable instructions that, when executed, cause a computing system to perform a method comprising:
[0542] receiving an application programming interface (API) call from an in-memory database management system requesting to offload a database operation to a near memory database accelerator, wherein the database operation is performed on an in-memory column of a database table compressed according to a bit packing compression format, the API call specifying a bit parameter;
[0543] In response to the API call, sending a request to the near memory database accelerator, wherein the sending includes: relaying a bit number parameter, and the near memory database accelerator performs a database operation with the bit number parameter;
[0544] receiving an indication from the near memory database accelerator that the database operation has completed; and
[0545] Notifies the in-memory database management system that a database operation has completed.
[0546] Clause 21. One or more computer-readable media comprising computer-executable instructions that, when executed, cause a computing system to perform the method of any of clauses 1-16.
[0547] Example 55 – Example Alternative
[0548] The technology from any example can be combined with the technology described in any one or more other examples. In view of the many possible embodiments to which the principles of the disclosed technology can be applied, it should be recognized that the illustrated embodiments are examples of the disclosed technology and should not be considered as limiting the scope of the disclosed technology. Rather, the scope of the disclosed technology includes the scope covered by the scope and spirit of the appended claims.
Claims
1. A method comprising: In an in-memory database management system environment, receiving a request to perform a database operation on a plurality of values represented in source data, wherein the source data is stored in a device memory of a near-memory database accelerator; offloading database operations to a near-memory database accelerator; and receiving an indication from the near memory database accelerator that a result of the database operation is available, The request includes a capacity parameter specifying a size of the output buffer, and the method further includes: In a near memory database accelerator, detecting based on a capacity parameter that a size of an output buffer is insufficient to hold the result; and In response to detecting that the size of the output buffer is insufficient, a partially completed result is returned.
2. The method according to claim 1, wherein: The multiple values represented in the source data are stored in a compressed form in the main storage of the in-memory database management system.
3. The method according to claim 1, further comprising: Prior to receiving the request, the source data is stored in a device memory of a near memory database accelerator specified by the in-memory database management system configuration information.
4. The method according to claim 1, wherein: The request is received from the in-memory database management system through an application programming interface API for a scan database operation.
5. The method according to claim 1, wherein: The request is received from an in-memory database management system as a result of a determination within the in-memory database management system that a database operation of the request is to be offloaded.
6. The method according to claim 1, wherein: The source data includes an in-memory database component stored in a device memory of a near-memory database accelerator; as well as The near memory database accelerator performs database operations on in-memory database components stored in a device memory of the near memory database accelerator.
7. The method according to claim 6, wherein: The source data is compressed; and The request includes compression information of the source data, and the near memory database accelerator decompresses the source data using the compression information.
8. The method according to claim 7, wherein: The source data is compressed according to a bit packing compression format, and the compression information specifies the number of bits of the bit packing compression format.
9. The method according to claim 1, wherein: The near memory database accelerator includes a database accelerator engine co-resident with the device memory and configured to perform database operations; and Device memory is separate from the central processing node.
10. The method of claim 1, wherein: receiving the request at a central processing unit; The device memory is directly accessible by the central processing unit; as well as The near memory database accelerator includes a database accelerator engine separate from the central processing unit, wherein the database accelerator engine is configured to perform database operations.
11. The method according to claim 10, wherein: The offload alleviates the central processing unit to memory data path for processing other than database operations.
12. The method of claim 1, wherein: The source data includes database table values in column format; The database operation consists of a table scan for the specified predicate; and The result indicates for which database column values the specified predicate is valid.
13. The method of claim 1, wherein: The request is received by a near memory database accelerator driver from an in-memory database application, the near memory database accelerator driver interacting with the near memory database accelerator on behalf of the in-memory database application.
14. The method of claim 1, wherein: Database operations are performed in-place in device memory by a near-memory database accelerator.
15. The method of claim 1, wherein: The database operation is performed by a near memory database accelerator engine of the near memory database accelerator; as well as The method further comprises: Results are retrieved directly from device memory to a central processing unit, wherein the retrieval bypasses the near memory database accelerator engine.
16. A system comprising: one or more processing units; Main or extended memory directly accessible to one or more processing units; as well as a near memory database accelerator driver configured to receive a request to perform a database operation on source data stored in a device memory of the near memory database accelerator, offload the database operation to the near memory database accelerator for execution by at least one database accelerator engine separate from the one or more processing units, and receive an indication from the near memory database accelerator that a result of the database operation is available, the near memory database accelerator comprising at least one database accelerator engine separate from the one or more processing units; wherein the main memory or the extended memory includes a device memory of a near memory database accelerator; and Wherein, the near memory database accelerator driver is configured to return a partially completed result if the result is too large for the output buffer capacity specified in the request.
17. The system of claim 16, wherein: The one or more processing units retrieve results of database operations computed by the at least one database accelerator engine via memory mapped I / O.
18. One or more computer-readable media comprising computer-executable instructions that, when executed, cause a computing system to perform a method comprising: receiving an application programming interface API call from an in-memory database management system, the API call requesting to offload a database operation to a near memory database accelerator, wherein the database operation is performed on an in-memory column of a database table compressed according to a bit packing compression format, and the API call specifies a bit number parameter; In response to the API call, sending a request to a near memory database accelerator, wherein the sending includes a relay bit number parameter, and the near memory database accelerator performs a database operation using the bit number parameter; receiving an indication from the near memory database accelerator that the database operation has completed; and Notify the in-memory database management system that the database operation has been completed. The request includes a capacity parameter specifying a size of the output buffer, and the method further includes: In a near memory database accelerator, detecting based on a capacity parameter that a size of an output buffer is insufficient to hold a result of a database operation; and In response to detecting that the size of the output buffer is insufficient, a partially completed result is returned.
