Skip to content

Instantly share code, notes, and snippets.


Henning Dieterichs hediet

View GitHub Profile
phiresky /
Last active Sep 26, 2022
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.