Bug 79808 - Searching should be faster
Summary: Searching should be faster
Status: RESOLVED FIXED
Alias: None
Product: kmail2
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian stable Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 84159 88408 91209 113496 230586 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-04-17 13:05 UTC by Erik Schnetter
Modified: 2014-04-03 14:29 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.13


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Schnetter 2004-04-17 13:05:21 UTC
Version:            (using KDE KDE 3.2.2)
Installed from:    Debian stable Packages

Searching emails in kmail is slow.  Kmail seems to need to look at each message.  It would be nice to have an index or some other method by which searching could be sped up.
Comment 1 Till Adam 2004-04-23 09:13:45 UTC
Erik, KMail does use an index, of course, albeit only for selected headers of the message. There is a fulltext index as well, but it is currently disabled. I assume you are referring to searches over the body of mails?
Comment 2 Anonymous Coward 2004-05-26 21:24:36 UTC
> you are referring to searches over the body of mails? 

Even headers-only searches are very slow in KMail on large folders - they are O(#messages), fulltext is really the only solution to that.
Comment 3 Ismail Donmez 2004-07-20 21:07:19 UTC
*** Bug 84159 has been marked as a duplicate of this bug. ***
Comment 4 Daniel Naber 2004-07-20 21:50:14 UTC
I've written a small prototype maildir indexer at http://www.danielnaber.de/tmp/. It uses Lupy, a Python version of Lucene. There's also a C++ version of Lucene which could be integrated into KMail. Lucene is a powerful but easy to use fulltext search library. If anybody is willing to work on this I can help you with the Lucene part.
Comment 5 Daniel Naber 2004-08-30 00:19:18 UTC
*** Bug 88408 has been marked as a duplicate of this bug. ***
Comment 6 Soren Holstebroe 2005-02-21 12:25:58 UTC
I just did a search for a match in the "From" field. I use an IMAP account with subfolders containing about 10,000 emails.
This search took about 3,5 minutes resulting in 52 hits. A second search (for another From match was clearly taking advantage of some cache and took only a few seconds.
Shutting down kmail and repeating the search I got the long search time again.
I did the same search with a freshly started Mozilla Thunderbird and got my result after about 30 seconds. A second search on another From match took only a few seconds.

Conclusion: Non-cached kmail searches are substantially slower than in competing email clients. Since Thunderbird is also open source I would suggest that the developer take a peek in the code.
Comment 7 Brad Hards 2005-02-21 12:37:22 UTC
OK, maybe you are seeing some cached behaviour on the server too (eg files in memory?). Can we put some science into this?

Pick a standard search, based on From:
Run it with KMail (report time)
Run it with KMail again (report time)
Shutdown KMail
Run it with Thunderbird (report time)
Run it with Thunderbird again (report time)
Shutdown Thunderbird
Run it with KMail (report time)
Run it with KMail again (report time)
Shutdown KMail
Run it with Thunderbird (report time)
Run it with Thunderbird again (report time)
Shutdown Thunderbird
Comment 8 Carsten Burghardt 2005-02-21 15:27:52 UTC
> Conclusion: Non-cached kmail searches are substantially slower than in
> competing email clients. Since Thunderbird is also open source I would
> suggest that the developer take a peek in the code.

Thanks for the suggestion but this is not comparable.
You're right about the initial time which is simply because we have to
make sure the folder is complete when you start your search. If you first
select your folder and then start a search you get the same effect. We'll
work on this but please keep in mind that imap searching is brand new in
kmail.

Comment 9 Soren Holstebroe 2005-02-21 16:22:51 UTC
On Monday 21 February 2005 12:37, Brad Hards wrote:
> ------- You are receiving this mail because: -------
> You are a voter for the bug, or are watching someone who is.
>
> http://bugs.kde.org/show_bug.cgi?id=79808
>
>
>
>
> ------- Additional Comments From bradh frogmouth net  2005-02-21 12:37
> ------- OK, maybe you are seeing some cached behaviour on the server too
> (eg files in memory?). Can we put some science into this?

Pick a standard search, based on From: "Mads"
Run it with KMail (report time)      3:59 - 256 hits of 9962 messages
Run it with KMail again (report time)    0:13
Shutdown KMail
Run it with Thunderbird (report time)    0:34 - 257 hits
Run it with Thunderbird again (report time)  0:03
Shutdown Thunderbird
Run it with KMail (report time)      3:56
Run it with KMail again (report time)    0:12
Shutdown KMail
Run it with Thunderbird (report time) 			0:13
Run it with Thunderbird again (report time) 	0:03
Shutdown Thunderbird
Run it with Horde/IMP 								0.06 (257 hits)
Run it with Horde/IMP again 						0.03

The horde webmail is installed on the mail server.
KMail and Thunderbird is using an uncrypted connection to the mailserver

Søren<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:10pt;font-family:Georgia">
<p>On Monday 21 February 2005 12:37, Brad Hards wrote:</p>
<p>&gt; ------- You are receiving this mail because: -------</p>
<p>&gt; You are a voter for the bug, or are watching someone who is.</p>
<p>&gt;</p>
<p>&gt; http://bugs.kde.org/show_bug.cgi?id=79808</p>
<p>&gt;</p>
<p>&gt;</p>
<p>&gt;</p>
<p>&gt;</p>
<p>&gt; ------- Additional Comments From bradh frogmouth net  2005-02-21 12:37</p>
<p>&gt; ------- OK, maybe you are seeing some cached behaviour on the server too</p>
<p>&gt; (eg files in memory?). Can we put some science into this?</p>
<p></p>
<p><span style="font-family:Courier New">Pick a standard search, based on From: &quot;Mads&quot;</span></p>
<p><span style="font-family:Courier New">Run it with KMail (report time) 					3:59 - 256 hits of 9962 messages</span></p>
<p><span style="font-family:Courier New">Run it with KMail again (report time) 			0:13</span></p>
<p><span style="font-family:Courier New">Shutdown KMail</span></p>
<p><span style="font-family:Courier New">Run it with Thunderbird (report time) 			0:34 - 257 hits</span></p>
<p><span style="font-family:Courier New">Run it with Thunderbird again (report time) 	0:03</span></p>
<p><span style="font-family:Courier New">Shutdown Thunderbird</span></p>
<p><span style="font-family:Courier New">Run it with KMail (report time) 					3:56</span></p>
<p><span style="font-family:Courier New">Run it with KMail again (report time) 			0:12</span></p>
<p><span style="font-family:Courier New">Shutdown KMail</span></p>
<p><span style="font-family:Courier New">Run it with Thunderbird (report time) 			0:13</span></p>
<p><span style="font-family:Courier New">Run it with Thunderbird again (report time) 	0:03</span></p>
<p><span style="font-family:Courier New">Shutdown Thunderbird</span></p>
<p><span style="font-family:Courier New">Run it with Horde/IMP 								0.06 (257 hits)</span></p>
<p><span style="font-family:Courier New">Run it with Horde/IMP again 						0.03</span></p>
<p></p>
<p><span style="font-family:Courier New">The horde webmail is installed on the mail server.</span></p>
<p><span style="font-family:Courier New">KMail and Thunderbird is using an uncrypted connection to the mailserver</span></p>
<p></p>
<p><span style="font-family:Courier New">Søren</span></p>
</body></html>
Comment 10 Soren Holstebroe 2005-02-21 16:44:01 UTC
On Monday 21 February 2005 15:28, Carsten Burghardt wrote:
> ------- You are receiving this mail because: -------
> You are a voter for the bug, or are watching someone who is.
>
> http://bugs.kde.org/show_bug.cgi?id=79808
>
>
>
>
> ------- Additional Comments From burghardt kde org  2005-02-21 15:27
> -------
>
> > Conclusion: Non-cached kmail searches are substantially slower than in
> > competing email clients. Since Thunderbird is also open source I would
> > suggest that the developer take a peek in the code.
>
> Thanks for the suggestion but this is not comparable.
> You're right about the initial time which is simply because we have to
> make sure the folder is complete when you start your search. If you first
> select your folder and then start a search you get the same effect. We'll
> work on this but please keep in mind that imap searching is brand new in
> kmail.

I thought you did this check on startup. KMail takes about 40 seconds to 
launch on my Gentoo Athlon 1800+ system before I can read my new mails. Most 
of the time is spent on "Checking xxxx account for new messages".
Launch time for Thunderbird is about eight seconds before I can read the first 
mail. I repeated the shutdown/startup procedure several times.
I like KMail, but Thunderbird is definately a competitive client.
IMap supports serverside searching. Is kmail supporting this feature ?

best regards
Søren

Comment 11 Carsten Burghardt 2005-02-21 20:47:24 UTC
On Monday 21 February 2005 16:44, Soren Holstebroe wrote:
> I thought you did this check on startup. KMail takes about 40 seconds to
> launch on my Gentoo Athlon 1800+ system before I can read my new mails.
> Most of the time is spent on "Checking xxxx account for new messages".

This a check for new mail. You can reduce this time when you either do not 
check for new mails on startup or reduce the folders that are checked.

> Launch time for Thunderbird is about eight seconds before I can read the
> first mail. I repeated the shutdown/startup procedure several times.
> I like KMail, but Thunderbird is definately a competitive client.
> IMap supports serverside searching. Is kmail supporting this feature ?

Yes, automatically.

Comment 12 Dexter Filmore 2006-08-30 21:00:42 UTC
In case this helps: the search function in Sylpheed used to satisfy all my mail search needs - and is blazing fast. Even when it has to look inside the message.
Since I was told over and over open src is about not reinventing the wheel all the time...
Comment 13 Bram Schoenmakers 2007-03-10 20:47:36 UTC
*** Bug 113496 has been marked as a duplicate of this bug. ***
Comment 14 Bram Schoenmakers 2007-03-10 20:48:28 UTC
Allen Winter said in bug 113496:

"run configure with the --enable-indexlib option and you can try it out."
Comment 15 Tristan Miller 2007-03-10 21:10:00 UTC
See also Bug 93844 (Tools->Find Messages should not search (binary) attachments).
Comment 16 David Anderson 2007-06-28 16:25:09 UTC
I came here to file a bug asking for faster search in kmail, and found this bug.

kmail is fine until you start getting several thousand mails in your folders - but now I find it really slow.

I saw one blogger saying that he used to use a mail client that used CLucene (http://clucene.sourceforge.net/) to index mails and it was lightning-fast. CLucene is used in sword/bibletime which I use and is very fast there. Maybe worth looking at?
Comment 17 Tristan Miller 2008-11-24 23:34:32 UTC
Possible workaround: Use kerry, a KDE front-end to the beagle search engine.  However, kerry seems to have plenty of bugs of its own...
Comment 18 Björn Ruberg 2009-12-20 00:35:26 UTC
*** Bug 91209 has been marked as a duplicate of this bug. ***
Comment 19 Christophe Marin 2010-03-29 10:37:55 UTC
*** Bug 230586 has been marked as a duplicate of this bug. ***
Comment 20 Anne-Marie Mahfouf 2011-12-01 11:42:34 UTC
Please reporters check KMail2 and report against it so we can see if this is still valid.

Meanwhile reassigning to kmail2 product
Comment 21 Laurent Montel 2014-04-03 14:29:37 UTC
Fixed in 4.13 with baloo