summaryrefslogtreecommitdiffstats
path: root/src/Database.cc
diff options
context:
space:
mode:
authorPeng Huang <shawn.p.huang@gmail.com>2010-01-04 08:25:41 +0800
committerPeng Huang <shawn.p.huang@gmail.com>2010-01-04 08:25:41 +0800
commit1d75209df049d6440d231ea400012a4b3b37f162 (patch)
tree9d8a615ecd3b5938172a699e472d8bc9163d4e74 /src/Database.cc
parent209e5a877991fd8e2c31b51dfd6a155df08da208 (diff)
downloadibus-libpinyin-1d75209df049d6440d231ea400012a4b3b37f162.tar.gz
ibus-libpinyin-1d75209df049d6440d231ea400012a4b3b37f162.tar.xz
ibus-libpinyin-1d75209df049d6440d231ea400012a4b3b37f162.zip
Optimize sqlite for better performance.
Diffstat (limited to 'src/Database.cc')
-rw-r--r--src/Database.cc6
1 files changed, 6 insertions, 0 deletions
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";