The following IMAP SORT with 2 sort criteria is very slow on an mdbox mailbox with lots of mails (more than 10,000) and an empty cache:
. SORT (ARRIVAL DATE) UTF-8 ALL
Each mail is opened when the SORT is executed, which is slow, given the number of mails in the mailbox.
Debug: Mailbox INBOX: UID 1003: Opened mail because: header stream <repeated for each mail>
Repeating the SORT opens all mails again and again:
Debug: Mailbox INBOX: UID 1003: Opened mail because: header stream <repeated for each mail>
If I just sort by ARRIVAL, the SORT is fast and I don't see any "Opened mail because" messages in the debug log.
. SORT (ARRIVAL) UTF-8 ALL
If I just sort by DATE, the first SORT is slow.
. SORT (DATE) UTF-8 ALL
The debug log looks like this:
Debug: Mailbox INBOX: UID 1003: Opened mail because: header Date (Mail has other cached fields, reset_id=1633683216) <repeated for each mail>
This fills the cache and if I sort by DATE again, the SORT is fast and I don't get any more "Opened mail because" messages in the debug log.
If I now repeat "SORT (ARRIVAL DATE)", the SORT is fast, the mails are not opened. If I clear the cache, "SORT (ARRIVAL DATE)" goes back to being slow, not filling the cache.
This doesn't seem right. "SORT (ARRIVAL DATE)" should also fill the cache to execute repeated SORTS faster, right?
On 15.08.2022 11:43, Ewald Dieterich wrote:
The following IMAP SORT with 2 sort criteria is very slow on an mdbox mailbox with lots of mails (more than 10,000) and an empty cache:
. SORT (ARRIVAL DATE) UTF-8 ALL
Each mail is opened when the SORT is executed, which is slow, given the number of mails in the mailbox.
There might be a bug, but "SORT (ARRIVAL DATE)" itself does not make much sense. It means "sort by arrival timestamp and for all messages with identical arrival timestamp use Date header instead".
-- Aleksander Machniak Kolab Groupware Developer [https://kolab.org] Roundcube Webmail Developer [https://roundcube.net]
PGP: 19359DC1 # Blog: https://kolabian.wordpress.com
There is a old bug that we are aware. Maybe we look at it again.
Aki
On 16/08/2022 16:21 EEST Aleksander Machniak alec@alec.pl wrote:
On 15.08.2022 11:43, Ewald Dieterich wrote:
The following IMAP SORT with 2 sort criteria is very slow on an mdbox mailbox with lots of mails (more than 10,000) and an empty cache:
. SORT (ARRIVAL DATE) UTF-8 ALL
Each mail is opened when the SORT is executed, which is slow, given the number of mails in the mailbox.
There might be a bug, but "SORT (ARRIVAL DATE)" itself does not make much sense. It means "sort by arrival timestamp and for all messages with identical arrival timestamp use Date header instead".
-- Aleksander Machniak Kolab Groupware Developer [https://kolab.org] Roundcube Webmail Developer [https://roundcube.net]
PGP: 19359DC1 # Blog: https://kolabian.wordpress.com
participants (3)
-
Aki Tuomi
-
Aleksander Machniak
-
Ewald Dieterich