Speed up total-count info, by counting indexed read.
authorSrinivasa Ragavan <sragavan@novell.com>
Tue, 13 Jan 2009 09:18:08 +0000 (09:18 +0000)
committerSrinivasa Ragavan <sragavan@src.gnome.org>
Tue, 13 Jan 2009 09:18:08 +0000 (09:18 +0000)
2009-01-13  Srinivasa Ragavan  <sragavan@novell.com>

* camel/camel-db.c: Speed up total-count info, by counting indexed
read.

svn path=/trunk/; revision=9930

camel/ChangeLog
camel/camel-db.c

index 020718c..5165b0d 100644 (file)
@@ -1,3 +1,8 @@
+2009-01-13  Srinivasa Ragavan  <sragavan@novell.com>
+
+       * camel/camel-db.c: Speed up total-count info, by counting indexed
+       read.
+
 2009-01-12  Philip Van Hoof  <philip@codeminded.be>
 
        * camel-db.c: Allowing the developer to add migration code for in
index 24268b3..2f9bb6c 100644 (file)
@@ -452,7 +452,7 @@ camel_db_count_total_message_info (CamelDB *cdb, const char *table_name, guint32
        if (!cdb)
                return -1;
        
-       query = sqlite3_mprintf ("SELECT COUNT (*) FROM %Q", table_name);
+       query = sqlite3_mprintf ("SELECT COUNT (*) FROM %Q where read=0 or read=1", table_name);
 
        ret = camel_db_count_message_info (cdb, query, count, ex);
        sqlite3_free (query);