From 2f9fafc128b6fa5688cb39762f56bf1248784ae4 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Thu, 19 Jul 2012 21:08:38 +0200 Subject: [PATCH] [entropy.db] EntropyRepository: create index for trashedcounters --- lib/entropy/db/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/entropy/db/__init__.py b/lib/entropy/db/__init__.py index a448b7812..6a6f5e9dc 100644 --- a/lib/entropy/db/__init__.py +++ b/lib/entropy/db/__init__.py @@ -5654,6 +5654,7 @@ class EntropyRepository(EntropyRepositoryBase): if not self.__indexing: return + self._createTrashedCountersIndex() self._createMirrorlinksIndex() self._createContentIndex() self._createBaseinfoIndex() @@ -5679,6 +5680,14 @@ class EntropyRepository(EntropyRepositoryBase): self._createCategoriesIndex() self._createCompileFlagsIndex() + def _createTrashedCountersIndex(self): + try: + self._cursor().execute(""" + CREATE INDEX IF NOT EXISTS trashedcounters_counter + ON trashedcounters ( counter )""") + except OperationalError: + pass + def _createMirrorlinksIndex(self): try: self._cursor().execute("""