rogerbinns / apsw

Another Python SQLite wrapper
https://rogerbinns.github.io/apsw/
Other
715 stars 96 forks source link

Set SQLITE_MAX_MMAP_SIZE to 1TB (or some other huge value) #491

Closed yuri-kilochek closed 7 months ago

yuri-kilochek commented 8 months ago

The current default is ~2GB which is too small for 64 bit host. Since Memory-mapped I/O is opt-in anyway (via PRAGMA mmap_size), I see no reason to keep the hard limit.

rogerbinns commented 8 months ago

You can compile APSW/SQLite yourself to change this default, although that is somewhat annoying.

I've posted on the SQLite forum to see if we can get the default changed in SQLite itself.

rogerbinns commented 7 months ago

No comments on the forum post. It isn't possible to reliably detect 64 bit compilation in the preprocessor, but it turns out SQLite will clamp SQLITE_MAX_MMAP_SIZE to 2GB on 32 bit anyway. So I've made the limit 256 terabytes.

yuri-kilochek commented 7 months ago

Awesome, thanks!