From 810e90b14919aba8486a710ecec59a538199d95a Mon Sep 17 00:00:00 2001 From: Shawn Wilsher Date: Thu, 16 Oct 2008 15:59:33 -0400 Subject: [PATCH] Bug 460315 - set journal_mode to TRUNCATE Sets the journal_mode to the places database to TRUNCATE r=dietrich --- toolkit/components/places/src/nsNavHistory.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/toolkit/components/places/src/nsNavHistory.cpp b/toolkit/components/places/src/nsNavHistory.cpp index 10cd7ead7f0..29815d92930 100644 --- a/toolkit/components/places/src/nsNavHistory.cpp +++ b/toolkit/components/places/src/nsNavHistory.cpp @@ -800,6 +800,11 @@ nsNavHistory::InitDB(PRInt16 *aMadeChanges) NS_LITERAL_CSTRING("PRAGMA locking_mode = EXCLUSIVE")); NS_ENSURE_SUCCESS(rv, rv); + // We use the TRUNCATE journal mode to reduce the number of fsyncs + rv = mDBConn->ExecuteSimpleSQL( + NS_LITERAL_CSTRING("PRAGMA journal_mode = TRUNCATE")); + NS_ENSURE_SUCCESS(rv, rv); + // moz_places if (!tableExists) { *aMadeChanges = DB_MIGRATION_CREATED;