stop using memory for sqlite temp store

On large collections this can end up consuming hundreds of megabytes
of RAM on operations like a vacuum.
This commit is contained in:
Damien Elmes 2020-05-10 13:52:07 +10:00
parent 70cc1699a6
commit 5ec7251f6e

View file

@ -44,7 +44,6 @@ fn open_or_create_collection_db(path: &Path) -> Result<Connection> {
db.pragma_update(None, "cache_size", &(-40 * 1024))?; db.pragma_update(None, "cache_size", &(-40 * 1024))?;
db.pragma_update(None, "legacy_file_format", &false)?; db.pragma_update(None, "legacy_file_format", &false)?;
db.pragma_update(None, "journal_mode", &"wal")?; db.pragma_update(None, "journal_mode", &"wal")?;
db.pragma_update(None, "temp_store", &"memory")?;
db.set_prepared_statement_cache_capacity(50); db.set_prepared_statement_cache_capacity(50);