Bug 132145 - Very slow emptying huge trash folder
Summary: Very slow emptying huge trash folder
Status: RESOLVED DUPLICATE of bug 135717
Alias: None
Product: kmail
Classification: Applications
Component: maildir (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-09 15:43 UTC by Julian Seward
Modified: 2007-09-14 12:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Seward 2006-08-09 15:43:44 UTC
Version:            (using KDE KDE 3.5.2)
Installed from:    Compiled From Sources
Compiler:          gcc (GCC) 4.0.2 20050901 (prerelease) (SUSE Linux)
 Standard x86 SuSE 10.0 gcc/g++ installation; compiled from sources; -g -O
OS:                Linux

Due to the way my spam filtering works, most of my mail
is moved directly to the trash folder.  After a couple of
weeks it gets to 50000+ entries, and I have to empty it.
The problem is that kmail takes forever to do this - often
overnight - and sometimes I think it is looping, kill it and
restart, and the trash is empty.  I think it should take
maybe a couple of minutes to delete 50k messages - not hang
or run overnight.

This is a standard SuSE 10 x86 install, with a konstruct-compiled
KDE 3.5.2 which otherwise works fine.  The underlying filesystem
is the default SuSE 10 one, which I think is ReiserFS 3.

Shouldn't kmail be built on top of a database engine, so that
these operations with huge numbers of mail messages run reliably
in reasonable time?
Comment 1 Ingo Klöcker 2006-08-09 16:16:56 UTC
IIUC then this is a local trash folder, right? Moreover, I assume it's a maildir folder.

I suggest using message expiration to control the number of messages in your trash folder. Then messages which are older than a specified amount of days will be deleted automatically. The deletion happens periodically in the background so each time only a small number of messages will be deleted.

As for the db engine, in KDE 4 we'll use one in our new backend.
Comment 2 Julian Seward 2006-08-15 13:12:45 UTC
> IIUC then this is a local trash folder, right?

yes.  On a local IDE disk with no obvious performance problems,
on a 1.7 GHz P4 with 1G memory.
> Moreover, I assume it's a maildir folder.

yes
> As for the db engine, in KDE 4 we'll use one in our new backend.

That would be good.  Please make sure it scales well.  I tried
again to delete the 54000+ trash messages and kmail had still not 
completed after 569 CPU minutes (== overnight).
Comment 3 Christian Janoff 2007-01-21 18:22:58 UTC
KMail takes about 1 minute (60 boring seconds, which is
still to much) here to delete 17,000 e-mails from my
local maildir trash folder.

(Gentoo Linux, compiled from source, KDE 3.5.5, KMail
1.9.5.)

There's also heavy load (100% CPU time) on the machine,
since KMail seems to a) first mark and b) then delete
every single e-mail in the folder.

Wouldn't it be possible to delete and then re-create
the local (trash) folder on a filesystem level, just
like when a user starts KMail for the first time? It
would take < 1 second in this case - at least, if it's
a local folder.
Comment 4 Thomas McGuire 2007-07-17 14:32:37 UTC

*** This bug has been marked as a duplicate of 135717 ***