From c2e7f3b51b2ea2dab56d0ee394733c2a8bb6127b Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Fri, 24 Sep 2010 14:27:59 +0200 Subject: [PATCH] [entropy.db] EntropyRepository: small sqlite3 performance improvement, make it store temp tables in RAM --- libraries/entropy/db/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/entropy/db/__init__.py b/libraries/entropy/db/__init__.py index a3c378aa0..140f38e6f 100644 --- a/libraries/entropy/db/__init__.py +++ b/libraries/entropy/db/__init__.py @@ -514,6 +514,10 @@ class EntropyRepository(EntropyRepositoryBase): # !!! enable foreign keys pragma !!! do not remove this # otherwise removePackage won't work properly cursor.execute("pragma foreign_keys = 1") + # setup temporary tables and indices storage + # to in-memory value + # http://www.sqlite.org/pragma.html#pragma_temp_store + cursor.execute("pragma temp_store = 2") self.__cursor_cache[c_key] = cursor # memory databases are critical because every new cursor brings # up a totally empty repository. So, enforce initialization.