From 1d75209df049d6440d231ea400012a4b3b37f162 Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Mon, 4 Jan 2010 08:25:41 +0800 Subject: [PATCH] Optimize sqlite for better performance. --- src/Database.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Database.cc b/src/Database.cc index 39a3b87..a5f78f9 100644 --- a/src/Database.cc +++ b/src/Database.cc @@ -92,6 +92,12 @@ Database::init (void) /* Using memory for temp store */ m_sql << "PRAGMA temp_store=MEMORY;\n"; + /* Set journal mode */ + m_sql << "PRAGMA journal_mode=TRUNCATE;\n"; + + /* Set the sync mode */ + m_sql << "PRAGMA synchronous=NORMAL;\n"; + /* Using EXCLUSIVE locking mode on main database * for better performance */ m_sql << "PRAGMA main.locking_mode=EXCLUSIVE;\n"; -- 2.7.4