Re: [PATCH] Store "from" and "subject" headers in the database.
authorJani Nikula <jani@nikula.org>
Sun, 6 Nov 2011 22:30:01 +0000 (00:30 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:01 +0000 (09:40 -0800)
4e/0f8ea7e44f52d029754a992b47690492130132 [new file with mode: 0644]

diff --git a/4e/0f8ea7e44f52d029754a992b47690492130132 b/4e/0f8ea7e44f52d029754a992b47690492130132
new file mode 100644 (file)
index 0000000..a75c165
--- /dev/null
@@ -0,0 +1,121 @@
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id E25FB429E21\r
+       for <notmuch@notmuchmail.org>; Sun,  6 Nov 2011 14:30:08 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id UAdSoxWlDEYy for <notmuch@notmuchmail.org>;\r
+       Sun,  6 Nov 2011 14:30:07 -0800 (PST)\r
+Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com\r
+       [209.85.161.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 05E43431FB6\r
+       for <notmuch@notmuchmail.org>; Sun,  6 Nov 2011 14:30:06 -0800 (PST)\r
+Received: by faan15 with SMTP id n15so1784925faa.26\r
+       for <notmuch@notmuchmail.org>; Sun, 06 Nov 2011 14:30:05 -0800 (PST)\r
+Received: by 10.223.61.131 with SMTP id t3mr13737950fah.26.1320618605753;\r
+       Sun, 06 Nov 2011 14:30:05 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi.\r
+       [80.220.92.23])\r
+       by mx.google.com with ESMTPS id w11sm28669430fad.7.2011.11.06.14.30.03\r
+       (version=SSLv3 cipher=OTHER); Sun, 06 Nov 2011 14:30:04 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: Austin Clements <amdragon@mit.edu>\r
+Subject: Re: [PATCH] Store "from" and "subject" headers in the database.\r
+In-Reply-To:\r
+ <CAH-f9WufXM30kZsU31RDheOSvHoOkrLh=vAh_jiqSkJfz=Lw8g@mail.gmail.com>\r
+References: <1320599856-24078-1-git-send-email-amdragon@mit.edu>\r
+       <87k47dt0wo.fsf@nikula.org>\r
+       <CAH-f9WufXM30kZsU31RDheOSvHoOkrLh=vAh_jiqSkJfz=Lw8g@mail.gmail.com>\r
+User-Agent: Notmuch/0.9+47~gda5693d (http://notmuchmail.org) Emacs/23.3.1\r
+       (i686-pc-linux-gnu)\r
+Date: Mon, 07 Nov 2011 00:30:01 +0200\r
+Message-ID: <87hb2gubo6.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: quoted-printable\r
+Cc: notmuch@notmuchmail.org, notmuch@kismala.com\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 06 Nov 2011 22:30:09 -0000\r
+\r
+On Sun, 6 Nov 2011 17:01:14 -0500, Austin Clements <amdragon@mit.edu> wrote:\r
+> On Sun, Nov 6, 2011 at 4:07 PM, Jani Nikula <jani@nikula.org> wrote:\r
+> > On Sun, =C2=A06 Nov 2011 12:17:36 -0500, Austin Clements <amdragon@MIT.=\r
+EDU> wrote:\r
+> >> Taking full advantage of this requires a database rebuild, but it will\r
+> >> fall back to the old behavior for messages that do not have headers\r
+> >> stored in the database.\r
+> >\r
+> > ...what's the most convenient way of rebuilding the database while\r
+> > preserving my tags etc.? If this was merged, would an older version of\r
+> > notmuch choke on the rebuilt database with these headers? (To me it\r
+> > looks like it would be fine.)\r
+>=20\r
+> The standard way to rebuild the database is to do a notmuch dump, move\r
+> .notmuch out of the way, notmuch new, then notmuch restore.  Some day\r
+> this process should be made automatic.\r
+>=20\r
+> Old versions of notmuch will be blissfully unaware of the new headers\r
+> stored in the database.  They can even safely add messages to an\r
+> upgraded database without breaking new versions of notmuch.\r
+\r
+Hi, I ran a quick test with/without the patch. I don't have much mail,\r
+but on my aging laptop the performance increase is significant. See\r
+below. 'du -h' on the .notmuch dir increased from 82M to 83M with the\r
+patch, IMHO well worth it.\r
+\r
+\r
+BR,\r
+Jani.\r
+\r
+\r
+WITHOUT THE PATCH:\r
+\r
+$ sudo bash -c "/bin/sync; /bin/echo 3 > /proc/sys/vm/drop_caches"\r
+$ time notmuch search "*" | wc -l\r
+8167\r
+\r
+real   0m43.216s\r
+user   0m3.860s\r
+sys    0m2.268s\r
+$ time notmuch search "*" | wc -l\r
+8167\r
+\r
+real   0m2.762s\r
+user   0m2.196s\r
+sys    0m0.564s\r
+\r
+WITH THE PATCH:\r
+\r
+$ sudo bash -c "/bin/sync; /bin/echo 3 > /proc/sys/vm/drop_caches"\r
+$ time notmuch search "*" | wc -l\r
+8167\r
+\r
+real   0m8.019s\r
+user   0m2.088s\r
+sys    0m0.720s\r
+$ time notmuch search "*" | wc -l\r
+8167\r
+\r
+real   0m2.033s\r
+user   0m1.592s\r
+sys    0m0.440s\r