[Xfce4-commits] <postler:master> Create indexes on id and threads in messages

Christian Dywan noreply at xfce.org
Sat Jul 2 17:08:10 CEST 2011


Updating branch refs/heads/master
         to f70f44801a1fa182ea86b33323c35b6534a61f2a (commit)
       from c98130270d6800f729e89b55a19be45a614f0af5 (commit)

commit f70f44801a1fa182ea86b33323c35b6534a61f2a
Author: Christian Dywan <christian at twotoasts.de>
Date:   Fri Jul 1 02:54:48 2011 +0200

    Create indexes on id and threads in messages

 postler/postler-index.vala |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/postler/postler-index.vala b/postler/postler-index.vala
index fa42b8f..ba963ba 100644
--- a/postler/postler-index.vala
+++ b/postler/postler-index.vala
@@ -99,6 +99,15 @@ namespace Postler {
                 """
                 ) != Sqlite.OK)
                 throw new GLib.FileError.FAILED (_("Failed to open database: %s"), database.errmsg ());
+
+            string[] indices = {
+                "CREATE INDEX IF NOT EXISTS id_index ON messages (id);",
+                "CREATE INDEX IF NOT EXISTS threads_index ON messages (threads);",
+            };
+            foreach (string index_statement in indices) {
+                if (database.exec (index_statement) != Sqlite.OK)
+                    throw new GLib.FileError.FAILED (_("Failed to open database: %s"), database.errmsg ());
+            }
         }
 
         public void insert_received_message (Message message) throws GLib.Error {



More information about the Xfce4-commits mailing list