From 628ffefe491a175575922a07a28a33b5f42bb581 Mon Sep 17 00:00:00 2001 From: Seif Lotfy Date: Sat, 2 Jun 2012 16:35:20 +0200 Subject: [PATCH] Optimize the indexes by adding subj_interpretation to the end of subj_id --- src/sql-schema.vala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sql-schema.vala b/src/sql-schema.vala index 5bd9d78..71200f2 100644 --- a/src/sql-schema.vala +++ b/src/sql-schema.vala @@ -454,27 +454,27 @@ namespace Zeitgeist.SQLite exec_query (database, """DROP INDEX IF EXISTS event_subj_id"""); exec_query (database, """ CREATE INDEX IF NOT EXISTS event_subj_id - ON event(subj_id, timestamp) + ON event(subj_id, timestamp, subj_interpretation) """); exec_query (database, """DROP INDEX IF EXISTS event_subj_id_current"""); exec_query (database, """ CREATE INDEX IF NOT EXISTS event_subj_id_current - ON event(subj_id_current, timestamp) + ON event(subj_id_current, timestamp, subj_interpretation) """); exec_query (database, """DROP INDEX IF EXISTS event_subj_interpretation"""); exec_query (database, """ CREATE INDEX IF NOT EXISTS event_subj_interpretation - ON event(subj_interpretation,timestamp) + ON event(subj_interpretation, timestamp, subj_id) """); exec_query (database, """DROP INDEX IF EXISTS event_subj_manifestation"""); exec_query (database, """ CREATE INDEX IF NOT EXISTS event_subj_manifestation - ON event(subj_manifestation, timestamp) + ON event(subj_manifestation, timestamp, subj_id) """); exec_query (database, """DROP INDEX IF EXISTS event_subj_origin"""); exec_query (database, """ CREATE INDEX IF NOT EXISTS event_subj_origin - ON event(subj_origin, timestamp) + ON event(subj_origin, timestamp, subj_interpretation, subj_id) """); exec_query (database, """DROP INDEX IF EXISTS event_subj_mimetype"""); exec_query (database, """ -- 1.7.9.5