[Dovecot] Possible sort optimization (?)

Timo Sirainen tss at iki.fi
Fri Feb 22 14:32:12 EET 2013


On 6.2.2013, at 1.02, Michael M Slusarz <slusarz at curecanti.org> wrote:

> a UID SORT RETURN (ALL COUNT) (DATE) UTF-8 SUBJECT "foo"
> 
> is always about 10 percent slower than this split query (I've done this 4-5 times, and the numbers are similar):
> 
> a UID SEARCH RETURN (SAVE) CHARSET UTF-8 SUBJECT "foo"
> b UID SORT RETURN (ALL COUNT) (DATE) UTF-8 UID $
> 
> (The particular query I used matched 5 messages out of the 21,000+)

I think the main difference is that the first command fetches also Date: header from dovecot.index.cache. Did you check if the slowness was because of additional userspace CPU usage (instead of disk IO)?

See if the attached patch makes a difference?

One possible solution would be to do the prefetching when search program is "all", but not otherwise. But if most of the messages match the search query then this is slower..

-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff
Type: application/octet-stream
Size: 422 bytes
Desc: not available
URL: <http://dovecot.org/pipermail/dovecot/attachments/20130222/77dd07f3/attachment-0003.obj>


More information about the dovecot mailing list