Mercurial > dovecot > core-2.2
changeset 21472:1d4c93fafa9f
lib-storage: Expunging now uses GUID only if it's in cache.
Otherwise the GUID lookup may be expensive, which is especially bad when
deleting a large number of mails.
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Wed, 25 Jan 2017 23:26:35 +0200 |
parents | 9d407a044289 |
children | 1797e9ead19b |
files | src/lib-storage/index/index-mail.c |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/index-mail.c Fri Feb 03 19:40:54 2017 +0200 +++ b/src/lib-storage/index/index-mail.c Wed Jan 25 23:26:35 2017 +0200 @@ -2157,9 +2157,11 @@ void index_mail_expunge(struct mail *mail) { + enum mail_lookup_abort old_abort = mail->lookup_abort; const char *value; guid_128_t guid_128; + mail->lookup_abort = MAIL_LOOKUP_ABORT_NOT_IN_CACHE; if (mail_get_special(mail, MAIL_FETCH_GUID, &value) < 0) mail_index_expunge(mail->transaction->itrans, mail->seq); else { @@ -2167,6 +2169,7 @@ mail_index_expunge_guid(mail->transaction->itrans, mail->seq, guid_128); } + mail->lookup_abort = old_abort; } static void index_mail_parse(struct mail *mail, bool parse_body)