Implement #629, sqlite performance optimizatons for export db

This commit is contained in:
Rhet Turnbull 2022-02-10 22:32:22 -08:00
parent 3cde0b79c9
commit 5bdd52df25

View File

@ -649,6 +649,14 @@ class ExportDB(ExportDB_ABC):
else:
self.was_upgraded = ()
self.version = OSXPHOTOS_EXPORTDB_VERSION
# turn on performance optimizations
c = conn.cursor()
c.execute("PRAGMA journal_mode=WAL;")
c.execute("PRAGMA synchronous=NORMAL;")
c.execute("PRAGMA cache_size=-100000;")
c.execute("PRAGMA temp_store=MEMORY;")
return conn
def _get_db_connection(self, dbfile):