Reputation: 66945
So I wonder how sqlite C/C++ API keeps opened DB: does it use Memory-mapped file? Or how to make it do so?
Upvotes: 0
Views: 2272
Reputation: 763
By default, SQLite uses memory mapping for shared memory file which only gets used in WAL journal mode. As per SQLite documentation https://sqlite.org/mmap.html, we can set PRAGMA mmap_size to force SQLite to use memory mapped file i/o in other modes as well. However, SQLite falls back to regular file i/o if it fails to map files in the memory.
Upvotes: 0