[Yum-devel] [PATCH] Add an index on files.pkgKey ... needed for .simpleFiles() to not suck

James Antill james at and.org
Mon Nov 2 17:28:33 UTC 2009


---
 db.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/db.c b/db.c
index a1e4fe8..4d49595 100644
--- a/db.c
+++ b/db.c
@@ -455,6 +455,15 @@ yum_db_index_primary_tables (sqlite3 *db, GError **err)
         return;
     }
 
+    sql = "CREATE INDEX IF NOT EXISTS pkgfiles ON files (pkgKey)";
+    rc = sqlite3_exec (db, sql, NULL, NULL, NULL);
+    if (rc != SQLITE_OK) {
+        g_set_error (err, YUM_DB_ERROR, YUM_DB_ERROR,
+                     "Can not create index on files table: %s",
+                     sqlite3_errmsg (db));
+        return;
+    }
+
     const char *deps[] = { "requires", "provides", "conflicts", "obsoletes", NULL };
     int i;
 
-- 
1.6.2.5



More information about the Yum-devel mailing list