Skip to content

Instantly share code, notes, and snippets.

Avatar

Henning Dieterichs hediet

View GitHub Profile
@phiresky
phiresky / tune.md
Last active Jun 25, 2020
SQLite performance tuning
View tune.md

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.

You can’t perform that action at this time.