Implement #629, sqlite performance optimizatons for export db

This commit is contained in:
Rhet Turnbull
2022-02-10 22:36:35 -08:00
parent a43bfc5a33
commit cb11967eac

View File

@@ -637,6 +637,14 @@ class ExportDB(ExportDB_ABC):
else: else:
self.was_upgraded = () self.was_upgraded = ()
self.version = OSXPHOTOS_EXPORTDB_VERSION 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 return conn
def _get_db_connection(self, dbfile): def _get_db_connection(self, dbfile):