3 ms·
You definitely want WAL mode (unless you’re accessing SQLite over NFS). It’s only not the default for backwards compatibility. I’d enable: PRAGMA journal_mode
by wmanley 2y ago
You definitely want WAL mode (unless you’re accessing SQLite over NFS). It’s only not the default for backwards compatibility. I’d enable:
PRAGMA journal_mode = WAL;
PRAGMA foreign_keys = 1;
PRAGMA mmap_size = 1099511627776;
Unless you know a reason that you can’t (like NFS or using a 32-bit cpu).
- znpy 2y ago> Unless you know a reason that you can’t (like NFS or using a 32-bit cpu). interesting, why there's that limitation when nfs and a 32-bit cpu are involved?
- wmanley 2y agoWAL mode requires shared memory, so doesn’t work over the network. mmap_size = 1TiB requires 1TiB of address space per connection. This is fine on 64-bit, unless you have millions of connections. Doesn’t work with 32-bit (4GiB) address space. You want mmap_size to be greater than the size of your database. If you know your database will be small then you could set it to a smaller number, but you could still become address space constrained with many connections.