Philipp Hörist pushed to branch storage at gajim / gajim


Commits:
5b9bc84a by Philipp Hörist at 2023-07-15T18:56:38+02:00
Run ANALYZE on close

- - - - -


1 changed file:

- gajim/common/storage/base.py


Changes:

=====================================
gajim/common/storage/base.py
=====================================
@@ -191,9 +191,13 @@ def _set_journal_mode(self, mode: str) -> None:
     def _set_synchronous(self, mode: str) -> None:
         self._con.execute(f'PRAGMA synchronous={mode}')
 
-    def _enable_secure_delete(self):
+    def _enable_secure_delete(self) -> None:
         self._con.execute('PRAGMA secure_delete=1')
 
+    def _run_analyze(self) -> None:
+        self._con.execute('PRAGMA analysis_limit=400')
+        self._con.execute('PRAGMA optimize')
+
     @property
     def user_version(self) -> int:
         return self._con.execute('PRAGMA user_version').fetchone()[0]
@@ -274,5 +278,6 @@ def shutdown(self) -> None:
             GLib.source_remove(self._commit_source_id)
 
         self._commit()
+        self._run_analyze()
         self._con.close()
         del self._con



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/5b9bc84af300a53cb3f2dcd6e6deb20c6bdea69a

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/5b9bc84af300a53cb3f2dcd6e6deb20c6bdea69a
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to