We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e3ea7fd + c93b398 commit cea7923Copy full SHA for cea7923
src/db/mod.rs
@@ -19,6 +19,12 @@ struct ConnectionCustomizer;
19
impl CustomizeConnection<Connection, ::rusqlite::Error> for ConnectionCustomizer {
20
fn on_acquire(&self, conn: &mut Connection) -> Result<(), ::rusqlite::Error> {
21
conn.execute("PRAGMA foreign_keys = ON;", [])?;
22
+ // Increase cache size from ~2 MB (current default) to ~100 MB.
23
+ //
24
+ // This should help sqlite keep pages in memory rather than needing to
25
+ // seek and read. Those typically hit the OS cache, but syscalls are
26
+ // still somewhat expensive at these volumes.
27
+ conn.execute("PRAGMA cache_size = -100000;", [])?;
28
Ok(())
29
}
30
0 commit comments