From 9fd85c94de90ec91ccf8a4bf04e8911e6e3e483b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 24 Feb 2010 14:22:34 +0000 Subject: [PATCH] * Use `truncate' journal mode, which should be a bit faster. --- src/libstore/local-store.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 67a91bb49f..6963ba5a15 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -227,6 +227,10 @@ LocalStore::LocalStore() if (sqlite3_exec(db, ("pragma synchronous = " + syncMode + ";").c_str(), 0, 0, 0) != SQLITE_OK) throw SQLiteError(db, "setting synchronous mode"); + /* Use `truncate' journal mode, which should be a bit faster. */ + if (sqlite3_exec(db, "pragma main.journal_mode = truncate;", 0, 0, 0) != SQLITE_OK) + throw SQLiteError(db, "setting journal mode"); + /* Check the current database schema and if necessary do an upgrade. !!! Race condition: several processes could start the upgrade at the same time. */