From 011462eec7275411829c7d620f24665d90e71a77 Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Mon, 21 Nov 2005 23:25:04 +0000 Subject: [PATCH] make it a bit faster --- ...ate_to_dot9_logs.py => migrate_logs_to_dot9_db.py} | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) rename scripts/{migrate_to_dot9_logs.py => migrate_logs_to_dot9_db.py} (94%) diff --git a/scripts/migrate_to_dot9_logs.py b/scripts/migrate_logs_to_dot9_db.py similarity index 94% rename from scripts/migrate_to_dot9_logs.py rename to scripts/migrate_logs_to_dot9_db.py index ad4769df4..2676209e5 100644 --- a/scripts/migrate_to_dot9_logs.py +++ b/scripts/migrate_logs_to_dot9_db.py @@ -27,10 +27,6 @@ cur.executescript( show TEXT, message TEXT ); - - - CREATE UNIQUE INDEX JID_Index ON jids (jid); - CREATE INDEX JID_ID_Index ON logs (jid_id); ''' ) @@ -129,3 +125,10 @@ if __name__ == '__main__': f.write('You can always run the migration script to import you old logs to the database\n') f.write('Thank you\n') f.close() + # after huge import create the indices (they are slow on massive insert) + cur.executescript( + ''' + CREATE UNIQUE INDEX JID_Index ON jids (jid); + CREATE INDEX JID_ID_Index ON logs (jid_id); + ''' + )