Skip to content
Snippets Groups Projects
Commit b64538c6 authored by Timo Kösters's avatar Timo Kösters
Browse files

Merge branch 'efficient-sqlite' into 'next'

improvement: more efficient sqlite

See merge request famedly/conduit!199
parents 178451e9 2c8412fe
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,7 @@ fn prepare_conn(path: &Path, cache_size_kb: u32) -> Result<Connection> {
conn.pragma_update(Some(Main), "journal_mode", &"WAL")?;
conn.pragma_update(Some(Main), "synchronous", &"NORMAL")?;
conn.pragma_update(Some(Main), "cache_size", &(-i64::from(cache_size_kb)))?;
conn.pragma_update(Some(Main), "wal_autocheckpoint", &2000)?;
conn.pragma_update(Some(Main), "wal_autocheckpoint", &0)?;
Ok(conn)
}
......@@ -77,7 +77,7 @@ fn read_lock_iterator(&self) -> &Connection {
pub fn flush_wal(self: &Arc<Self>) -> Result<()> {
self.write_lock()
.pragma_update(Some(Main), "wal_checkpoint", &"TRUNCATE")?;
.pragma_update(Some(Main), "wal_checkpoint", &"RESTART")?;
Ok(())
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment