# HG changeset patch # User Sebastien Jodogne # Date 1366038026 -7200 # Node ID 42e87c17cab822833d6ab563caeed183e844b2a8 # Parent 7000726bade70d23c1b18c6b52e09f17ae622231 some refactoring diff -r 7000726bade7 -r 42e87c17cab8 Core/SQLite/Connection.cpp --- a/Core/SQLite/Connection.cpp Mon Mar 25 12:12:37 2013 +0100 +++ b/Core/SQLite/Connection.cpp Mon Apr 15 17:00:26 2013 +0200 @@ -88,15 +88,7 @@ // Execute PRAGMAs at this point // http://www.sqlite.org/pragma.html Execute("PRAGMA FOREIGN_KEYS=ON;"); - Execute("PRAGMA RECURSIVE_TRIGGERS=ON;"); - - // Performance tuning - Execute("PRAGMA SYNCHRONOUS=NORMAL;"); - Execute("PRAGMA JOURNAL_MODE=WAL;"); - Execute("PRAGMA LOCKING_MODE=EXCLUSIVE;"); - Execute("PRAGMA WAL_AUTOCHECKPOINT=1000;"); - //Execute("PRAGMA TEMP_STORE=memory"); } void Connection::OpenInMemory() diff -r 7000726bade7 -r 42e87c17cab8 OrthancServer/DatabaseWrapper.cpp --- 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";