You must set it to a value higher than the size of your DB. I use:
PRAGMA mmap_size = 1099511627776;
(1TB)You must set it to a value higher than the size of your DB. I use:
PRAGMA mmap_size = 1099511627776;
(1TB)https://sqlite.org/compile.html#max_mmap_size
Ubuntu system pragma compile_options:
MAX_MMAP_SIZE=0x7fff0000
Changing this default requires knowing it is a 64 bit platform when the C preprocessor runs, and would surprise anyone who was ok with the 2GB value.
There are two downsides of mmap - I/O errors can't be caught and handled by SQLite code, and buggy stray writes by other code in the process could corrupt the database.
It is best practise to directly include the SQLite amalgamation into your own projects which allows you to control version updating, and configuration.
True. https://www.sqlite.org/mmap.html lists 3 other issues as well.
> and buggy stray writes by other code in the process could corrupt the database.
Not true: "SQLite uses a read-only memory map to prevent stray pointers in the application from overwriting and corrupting the database file."