Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id CEBCB431FB6 for ; Tue, 21 Oct 2014 16:17:34 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.098 X-Spam-Level: X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oZpYtTZUOGog for ; Tue, 21 Oct 2014 16:17:26 -0700 (PDT) Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id BABC1431FAE for ; Tue, 21 Oct 2014 16:17:26 -0700 (PDT) Received: from smtp.qmul.ac.uk ([138.37.6.40]) by mail2.qmul.ac.uk with esmtp (Exim 4.71) (envelope-from ) id 1Xgig6-0006iN-Q7; Wed, 22 Oct 2014 00:17:24 +0100 Received: from 5751dfa2.skybroadband.com ([87.81.223.162] helo=localhost) by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) (envelope-from ) id 1Xgig6-0003bG-40; Wed, 22 Oct 2014 00:17:22 +0100 From: Mark Walters To: Austin Clements , notmuch@notmuchmail.org Subject: Re: [PATCH v2 12/12] lib: Remove unnecessary thread linking steps when using ghost messages In-Reply-To: <1412637438-4821-13-git-send-email-aclements@csail.mit.edu> References: <1412637438-4821-1-git-send-email-aclements@csail.mit.edu> <1412637438-4821-13-git-send-email-aclements@csail.mit.edu> User-Agent: Notmuch/0.18.1+86~gef5e66a (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) Date: Wed, 22 Oct 2014 00:17:20 +0100 Message-ID: <87wq7thv27.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Sender-Host-Address: 87.81.223.162 X-QM-Geographic: According to ripencc, this message was delivered by a machine in Britain (UK) (GB). X-QM-SPAM-Info: Sender has good ham record. :) X-QM-Body-MD5: 8f205de2c1ce8354d0314db30b07b78c (of first 20000 bytes) X-SpamAssassin-Score: -0.1 X-SpamAssassin-SpamBar: / X-SpamAssassin-Report: The QM spam filters have analysed this message to determine if it is spam. We require at least 5.0 points to mark a message as spam. This message scored -0.1 points. Summary of the scoring: * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (markwalters1009[at]gmail.com) * -0.1 AWL AWL: From: address is in the auto white-list X-QM-Scan-Virus: ClamAV says the message is clean X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2014 23:17:35 -0000 On Tue, 07 Oct 2014, Austin Clements wrote: > From: Austin Clements > > Previously, it was necessary to link new messages to children to work > around some (though not all) problems with the old metadata-based > approach to stored thread IDs. With ghost messages, this is no longer > necessary, so don't bother with child linking when ghost messages are > in use. > --- > lib/database.cc | 21 +++++++++++++++++---- > 1 file changed, 17 insertions(+), 4 deletions(-) > > diff --git a/lib/database.cc b/lib/database.cc > index 1316529..6e51a72 100644 > --- a/lib/database.cc > +++ b/lib/database.cc > @@ -2169,10 +2169,23 @@ _notmuch_database_link_message (notmuch_database_t *notmuch, > if (status) > goto DONE; > > - status = _notmuch_database_link_message_to_children (notmuch, message, > - &thread_id); > - if (status) > - goto DONE; > + if (! (notmuch->features & NOTMUCH_FEATURE_GHOSTS)) { > + /* In general, it shouldn't be necessary to link children, > + * since the earlier indexing of those children will have > + * stored a thread ID for the missing parent. However, prior > + * to ghost messages, these stored thread IDs were NOT > + * rewritten during thread merging (and there was no > + * performant way to do so), so if indexed children were > + * pulled into a different thread ID by a merge, it was > + * necessary to pull them *back* into the stored thread ID of > + * the parent. With ghost messages, we just rewrite the > + * stored thread IDs during merging, so this workaround isn't > + * necessary. */ > + status = _notmuch_database_link_message_to_children (notmuch, message, > + &thread_id); > + if (status) > + goto DONE; > + } Ok so this basically answers my earlier comment. It might be worth updating the big comment at the start of the function to match the new code though. Best wishes Mark > > /* If not part of any existing thread, generate a new thread ID. */ > if (thread_id == NULL) { > -- > 2.1.0 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch