Skip to content

Instantly share code, notes, and snippets.

View hediet's full-sized avatar

Henning Dieterichs hediet

View GitHub Profile
@phiresky
phiresky / tune.md
Last active March 25, 2024 13:34
SQLite performance tuning

You can scale a SQLite database to multiple GByte in size and many concurrent readers by applying the below optimizations.

Run these every time you connect to the db

(some are applied permanently, but others are reset on new connection)

pragma journal_mode = WAL;

Instead of writing directly to the db file, write to a write-ahead-log instead and regularily commit the changes. Allows multiple concurrent readers, and can significantly improve performance.