[Kde-pim] [PATCH] Akonadi database optimization

Volker Krause vkrause at kde.org
Sat Jul 31 11:12:45 BST 2010


On Friday 30 July 2010 21:30:57 Tobias König wrote:
> Hej,
>
> as a proud user of KMail 4.5 I faced some performance problems lately which
> happened when entering a folder with many (in words 200) emails.
> In this case KMail was waiting nearly 30 seconds until it continued to show
> the emails in the message list.
>
> After some debugging, blaming nearly every component of the PIM stack
> (sorry Kevin, it was not the maildirresource ;)) and adding debug
> statements all over the places, mysqld was identified as the culprit. The
> problematic call was the fetch statement for all header payloads of all
> mails in the current folder. Just for fun I changed the fetch scope to
> FullPayload and to my suprise it was _faster_ then only fetching the
> headers.
> So the SQL query, which varies for both calls must be the issue.
> After some discussion with our MySQL-optimizer-Guru (aka milian) we came to
> the conclusion that the 'AND PimItemTable.id >= 1' condition in the
> statement leads to a performance bottleneck. The reason is that the >=
> operator will imply a so called range-join which has a bad performance.
> Fortunately this special condition is not really needed, because the 'id'
> column will always contain values >= 1 per definition. So we can just
> optimize this condition away and KMail 4.5 works as fast as it is supposed
> to do :)
>
> Attached is a patch that fixes QueryHelper to not add unnecessary >=
> conditions. Does somebody see any problems with it?

looks good to me, thanks!

regards
Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20100731/313101cd/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list