Changed some sqlite settings to improve performance

This commit is contained in:
Patrick Speiser
2012-09-15 23:58:09 +02:00
parent 490b4bc909
commit 6304d27266

View File

@@ -40,6 +40,12 @@ class DBConnection:
self.filename = filename
self.connection = sqlite3.connect(dbFilename(filename), timeout=20)
#don't wait for the disk to finish writing
self.connection.execute("PRAGMA synchronous = OFF")
#journal disabled since we never do rollbacks
self.connection.execute("PRAGMA journal_mode = OFF")
#64mb of cache memory,probably need to make it user configurable
self.connection.execute("PRAGMA cache_size=-65536")
self.connection.row_factory = sqlite3.Row
def action(self, query, args=None):