about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-02-24T14·22+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-02-24T14·22+0000
commit9fd85c94de90ec91ccf8a4bf04e8911e6e3e483b (patch)
treee758205911f6a3df7a5bb1bee07ab083c462e932 /src/libstore
parentfefd467539683e45e3682a54cefc67ead33eb346 (diff)
* Use `truncate' journal mode, which should be a bit faster.
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/local-store.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index 67a91bb49f65..6963ba5a15d8 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. */