Gábor Szárnyas
Published on
2025-01-17
TL;DR: DuckDB can run all TPC-H SF300 queries on a Raspberry Pi board.
The Raspberry Pi is an initiative to provide affordable and easy-to-program microcomputer boards.
The initial model in 2012 had a single CPU core running at 0.7 GHz, 256 MB RAM and an SD card slot, making it a great educational platform.
Over time the Raspberry Pi Foundation introduced more and more powerful models.
The latest model, the Raspberry Pi 5, has a 2.4 GHz quad-core CPU and – with extra connectors – can even make use of NVMe SSDs for storage.
Last week, the Pi 5 got another upgrade:
it can now be purchased with 16 GB RAM.
The DuckDB team likes to experiment with DuckDB in unusual setups such as smartphones dipped into dry ice, so we were eager to get our hands on a new Raspberry Pi 5.
After all, 16 GB or memory is equivalent to the amount found in the median gaming machine as reported in the 2024 December Steam survey.
So, surely, the Pi must be able to handle a few dozen GBs of data, right?
We ventured to find out.
Do you have a cool DuckDB setup?
We would like to hear about it!
Please post about it on social media or email it to [email protected].
Our setup consisted of the following components, priced at a total of $281:
We installed the heat sinks, popped the SSD into place, and assembled the house.
Here is a photo of our machine:
So what is this little box capable of? We used the TPC-H workload to find out.
We first updated the Raspberry Pi OS (a fork of Debian Linux) to its latest version, 2024-11-19.
We then compiled DuckDB version 0024e5d4be
using the Raspberry Pi build instruction.
To make the queries easy to run, we also included the TPC-H extension in the build:
GEN=ninja CORE_EXTENSIONS="tpch" make
We then downloaded DuckDB database files containing the TPC-H datasets at different scale factors (SF):
wget https://blobs.duckdb.org/data/tpch-sf100.db
wget https://blobs.duckdb.org/data/tpch-sf300.db
We used two different storage options for both scale factors.
For the first run, we stored the database files on the microSD card, which is the storage that most Raspberry Pi setups have.
This card works fine for serving the OS and programs,
and it can also store DuckDB databases but it’s rather slow, especially for write-intensive operations, which include spilling to disk.
Therefore, for t