Why open source databases hardly use GPUs
Summary
At the end of 2013 a Slashdot reader asked why open source databases do not use graphics cards. The occasion was Red Fox from Georgia Tech: the system ran the complete TPC-H benchmark on an NVIDIA Titan, seven times faster than a commercial database on a 32-core Amazon EC2 node and 68 times faster than a single Xeon core. Despite several such research projects, no code had made its way into MonetDB, MySQL or similar systems.
Why GPUs for databases?
Graphics cards have thousands of simple compute cores and very fast memory of their own. Many database operations such as filtering, sorting or aggregating large tables can be parallelised well. For this purpose, Red Fox translated queries into GPU programs and optimised them as a whole.
TPC-H is a standard benchmark for analytical queries such as those found in evaluations and reports. That a research system managed all of its queries was remarkable, because many earlier approaches only accelerated individual operations.
Why it did not reach the big databases
The answers in the discussion come down to one problem: the data first has to get to the graphics card. Graphics memory was small and the route via PCIe was slow compared with the computing time. In addition, for many everyday queries computing is not the bottleneck; reading from disk or managing transactions is. On top of that came the lock-in to CUDA and thus to one vendor.
What became of it
Specialised GPU databases emerged nevertheless, such as MapD, later HEAVY.AI, or the PostgreSQL extension PG-Strom. GPUs have caught on above all for analyses of very large data volumes and in machine learning. Classic databases today rely more on columnar storage and the CPU's vector instructions.
Ideas
- Analytical database queries can be spread across thousands of GPU cores.
- Entire queries are translated into GPU programs and optimised together.
- Standard benchmarks such as TPC-H make database systems comparable.
Insights
- Computing power helps little when transporting the data to the processor is the bottleneck.
- Research results only reach large open source projects if someone takes on integration and maintenance.
- Vendor lock-in slows the adoption of new technology in general-purpose software.
Facts
- Red Fox ran on an NVIDIA GeForce GTX Titan.
- The speed-up was sevenfold compared with a commercial database on 32 EC2 cores.
- Compared with a single Xeon core, Red Fox was 68 times faster.
References
Remarks
- Red Fox comes from the same research group at Georgia Tech as the CUDA compiler Ocelot.
Recommendations
- Before using accelerators, measure whether computing time or data transport is the bottleneck.
- For analytical workloads, look at columnar databases before relying on special hardware.
Found a mistake or have something to add? Get in touch.
Links to the original source and the Web Archive open in a new tab.