Skip to content
DuckDB community extension

cache_prewarm

Prewarm data blocks into DuckDB's buffer pool or OS page cache for faster queries

01 / SETUP

Install and load

Run these commands in a Haybarn SQL session. The extension is available from the community repository.

Haybarn 2.0.0 · SQL
INSTALL cache_prewarm FROM community;
LOAD cache_prewarm FROM community;

Using upstream DuckDB? Follow the maintainer’s installation instructions.

02 / QUERY

Usage example

Prewarm a table into the buffer pool

SQL
-- Prewarm a table into the buffer pool
SELECT prewarm('table_name');

-- With explicit mode
SELECT prewarm('table_name', 'buffer');

-- With size limit (human-readable format)
SELECT prewarm('table_name', 'buffer', '1GB');

-- With qualified table name
SELECT prewarm('my_schema.table_name');

-- Prewarm a remote file into the on-disk cache
SELECT prewarm_remote('https://example.com/data/file.parquet');

-- Prewarm with a glob pattern (multiple files)
SELECT prewarm_remote('https://example.com/data/*.parquet');

Provided by dentiny. Not yet verified on Haybarn 2.0.0.

Sample data & setup

About this extension

A DuckDB extension that preloads table data blocks into the buffer pool or OS page cache, inspired by PostgreSQL's pg_prewarm extension.

Use cases include cold start optimization and predictable query latency.

Project overview from the community descriptor.

Documentation and resources

Project and build details
Repository
dentiny/duckdb-cache-prewarm
License
MIT
Maintainers
peterxcli, dentiny
Written in
C++
Build source
c1ab04d975cc
Build definition
Community descriptor