dovecot-2.2: lib-storage: When searching with a sort program, do...

dovecot at dovecot.org dovecot at dovecot.org
Sun May 20 03:26:26 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/0c3cb8976e81
changeset: 14295:0c3cb8976e81
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Mar 05 18:43:05 2012 +0200
description:
lib-storage: When searching with a sort program, don't prefetch any mails.
The prefetching probably ends up being pointless.

diffstat:

 src/lib-storage/index/index-search.c |  8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diffs (18 lines):

diff -r 8a47994cd509 -r 0c3cb8976e81 src/lib-storage/index/index-search.c
--- a/src/lib-storage/index/index-search.c	Mon Mar 05 18:41:53 2012 +0200
+++ b/src/lib-storage/index/index-search.c	Mon Mar 05 18:43:05 2012 +0200
@@ -1501,6 +1501,14 @@
 		ret = search_more_with_mail(ctx, mail);
 		if (ret <= 0)
 			break;
+
+		if (ctx->mail_ctx.sort_program != NULL) {
+			/* don't prefetch when using a sort program,
+			   since the mails' access order will change */
+			i_assert(ctx->unused_mail_idx == 0);
+			*mail_r = mail;
+			return 1;
+		}
 		if (mail_prefetch(mail) && ctx->unused_mail_idx == 0) {
 			/* no prefetching done, return it immediately */
 			*mail_r = mail;


More information about the dovecot-cvs mailing list