Bug 181370 - saved "last search" is always done in IMAP, performance problems because of that
Summary: saved "last search" is always done in IMAP, performance problems because of that
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kmail
Classification: Unmaintained
Component: search (show other bugs)
Version: 1.10.3
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-20 07:51 UTC by Michael Monnerie
Modified: 2015-04-12 09:50 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Monnerie 2009-01-20 07:51:50 UTC
Version:           1.10.3 (using KDE 4.1.3)
OS:                Linux
Installed from:    SuSE RPMs

I recently switch my IMAP server from Cyrus to DBmail and suddenly had problems reading my mail. It took up to 90 seconds to browse a new folder. Investigation showed me that kmail always made an IMAP search for "kwf" in a mail, then I looked into known bugs and that brought me to "Last Search".
In .kde4/share/apps/kmail/search/Last\ Search was the following content:
*****************************************************
[Search Folder]
Base=
Recursive=true
contentsA=kwf
contentsB=parship
fieldA=<message>
fieldB=From
funcA=contains
funcB=contains
name=<unknown>
operator=or
rules=1
*****************************************************
that caused kmail always doing the IMAP search
11798 UID SEARCH TEXT "kwf" UID 3613866
which is done on *every* folder change again. If the last search is auto saved (can I switch that off?), then at least it should be run only once after app start, not all the time.

There are two bugs related to this one:
Bug 72017:  search folder appears twice in different language
https://bugs.kde.org/show_bug.cgi?id=72017

Bug 111422: Updating IMAP folders seems to update Last Sear... 
https://bugs.kde.org/show_bug.cgi?id=111422

Because my kde language is *ALWAYS* german, but still there are 2 saved searches:
-rw------- 1 zmi users  163 20. Jan 07:13 Last Search
-rw-r--r-- 1 zmi users   33 20. Jan 07:13 .Last Search.index.ids
-rw------- 1 zmi users   34  6. Jan 10:55 .Last Search.index.search
-rw------- 1 zmi users  194 20. Jan 07:13 Letzte Suche
-rw-r--r-- 1 zmi users   33 20. Jan 07:13 .Letzte Suche.index.ids
-rw------- 1 zmi users   34 19. Jan 20:18 .Letzte Suche.index.search

The "Last Search" was the problematic one. From the beginning of having problems I tried making a new search with silly values, to see if the "kwf" search vanishes, but it didn't. Now I know that's because my "silly search" was saved as "Letzte Suche", but the "kwf" search was "Last Search". And I didn't want to save that searches at all. It had a huge performance impact, so please fix that as it's very hard to find.
Comment 1 Jaime Torres 2009-02-13 19:49:41 UTC
The searches can be saved with an arbitrary name, look at the bottom of the Find Messages window for a field called "Search Folder Name".
Also, these searches are shown at the bottom of the folder tree, and can be edited or deleted.

Please close this bug if this information is enought to handle your problem.
Comment 2 Michael Monnerie 2009-02-22 21:21:22 UTC
That may be, I can't look anymore as I solved it already.

But I did never save a search, and my language setting was german forever. So the system alone saved it under that name. So it's a bug.

Also, even if I save a search, that doesn't mean I want that search to be immediately started whenever I change a folder. It's enough when the search is done as I click on that saved search virtual folder. I'd also call the current situation a bug.

As long as such things happen, KDE is not ready for end users to replace Windows :-( I don't mean it bad, but even me, I would call myself an expert, I was searching everywhere trying to trace the bug. When I found it was kmail initiated, and the search was "kwf", I wondered a lot because that must have been a very old search suddenly activated again. As it hit me in the middle of migrating the mail server, I thought on everything but kmail being the culprit. So, it might be an old saved search, re-used by an update or whatever. Still, it was never saved by me, at least I didn't want that to happen.
Comment 3 Emil Obermayr 2009-09-24 09:36:57 UTC
Similar problem in kmail 1.11.2

The last done search is repeated on startup locally, so it maybe is not IMAP related. 

To reproduce:

do a big search (over all local folders), close kmail, start kmail in konsole and see lots of

kontact(4082)/kmail (storage internals) KMFolderMaildir::getDwString: KDE_fopen(abs_file= "/home/nobs/Mail/.software.directory/rsnapshot/cur/1242104952.4862.fkUiV:2,S" , "r+") == stream ==  0x284e7e0                                                               
kontact(4082)/kmail (storage internals) KMFolderMaildir::getDwString: fclose(mIndexStream =  0x284e7e0 )                           

Workaround:

 delete files in ~/.kde/share/apps/kmail/search

Suggestion:

change request to kmail: Do not repeat searches automatically by default.
Comment 4 Tristan Miller 2014-04-06 09:01:53 UTC
I can reproduce this not just for IMAP accounts but for local ones using KMail 1.13.6.  I understand KMail 1 is no longer maintained, unfortunately. :(
Comment 5 Laurent Montel 2015-04-12 09:50:43 UTC
Thank you for taking the time to file a bug report.

KMail2 was released in 2011, and the entire code base went through significant changes. We are currently in the process of porting to Qt5 and KF5. It is unlikely that these bugs are still valid in KMail2.

We welcome you to try out KMail 2 with the KDE 4.14 release and give your feedback.