Introduction
For the last decade, GPU-accelerated databases have relied on CUDA cores to crunch data. While incredibly fast, these systems have hit a "memory wall." Modern implementations, such as the state-of-the-art Crystal engine, are so efficient that they saturate nearly 100% of the GPU's memory bandwidth. When a system is already using the full capacity of the memory "pipes" to move data, adding more compute power cannot increase performance.
RTCUDB addresses this bottleneck by leveraging specialized hardware: Ray Tracing (RT) cores. Found in modern NVIDIA RTX GPUs, these cores are designed to navigate complex 3D structures (Bounding Volume Hierarchies or BVHs) at lightning speed. RTCUDB is the first query engine to offload entire database queries—combining Scan, GroupBy, and Aggregation—into a single ray-tracing job.
Methods: Mapping Data to 3D Space
RTCUDB reimagines a database query as a 3D rendering problem. The core innovation lies in how relational data is mapped to a 3D coordinate system:
- Data as Primitives: Every data record is transformed into a geometric primitive (a right triangle) in 3D space.
- Z-axis: Encodes attributes used for filtering (
Scan). - Y-axis: Encodes attributes used for grouping (
GroupBy). - X-axis: Encodes attributes used for calculations (
Aggregation). - Queries as Rays: A database query is represented as a set of rays. For example, a range filter on the Z-axis corresponds to the length and position of the ray.
- Unified RT Jobs: Unlike previous attempts that used RT cores for single operators, RTCUDB fuses Scan, GroupBy, and Aggregation into one single ray-tracing pass. This avoids the massive overhead of rebuilding spatial indices (BVHs) between every step.
To handle complex queries with multiple attributes, RTCUDB utilizes Bijective Encoding and Dictionary Encoding to pack data into the 32-bit floating-point coordinates required by RT hardware. When a ray "hits" a triangle, a custom "Any Hit" shader performs the database logic—such as incrementing counts or calculating sums—using atomic operations in GPU memory.
Key Insights and Performance
By offloading search logic to RT hardware, RTCUDB shifts the bottleneck from memory bandwidth to compute speed. Traditional CUDA engines must fetch almost all data to check predicates; in contrast, RTCUDB uses hardware-accelerated BVH traversal to "skip" irrelevant data. This approach dropped average memory bandwidth usage from 97.4% down to 36.7%.
The performance gains are significant. Evaluated using the Star Schema Benchmark (SSB) with up to 120 million tuples, RTCUDB outperformed Crystal by an average of 8.5×, reaching up to 18.3× in specific scenarios. To confirm the RT cores were the primary driver, the authors tested a "pure-CUDA" version of the same algorithm, which was 423× slower than the RT-core implementation.
Limitations and Future Work
While RTCUDB represents a major leap in GPU database performance, it faces some hardware-imposed constraints. Current RT hardware primarily supports single-precision floats, which can limit the range of data attributes that can be encoded. Additionally, building the BVH structure is a relatively slow process, making the system currently best suited for "read-heavy" data warehouses where BVHs can be pre-built as materialized views. Future research aims to integrate more complex operators, such as Joins, directly into the RT pipeline.
Summary updated