diff OrthancServer/DatabaseWrapper.cpp @ 374:42e87c17cab8

some refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 15 Apr 2013 17:00:26 +0200
parents 6ab6cdeedf4e
children 4d5f0857ec9c
line wrap: on
line diff
--- a/OrthancServer/DatabaseWrapper.cpp	Mon Mar 25 12:12:37 2013 +0100
+++ b/OrthancServer/DatabaseWrapper.cpp	Mon Apr 15 17:00:26 2013 +0200
@@ -750,6 +750,14 @@
 
   void DatabaseWrapper::Open()
   {
+    // Performance tuning of SQLite with PRAGMAs
+    // http://www.sqlite.org/pragma.html
+    db_.Execute("PRAGMA SYNCHRONOUS=NORMAL;");
+    db_.Execute("PRAGMA JOURNAL_MODE=WAL;");
+    db_.Execute("PRAGMA LOCKING_MODE=EXCLUSIVE;");
+    db_.Execute("PRAGMA WAL_AUTOCHECKPOINT=1000;");
+    //db_.Execute("PRAGMA TEMP_STORE=memory");
+
     if (!db_.DoesTableExist("GlobalProperties"))
     {
       LOG(INFO) << "Creating the database";