post-new [was: Re: query on a subset of messages ?]
authorSebastien Binet <binet@cern.ch>
Mon, 9 Jul 2012 17:04:45 +0000 (19:04 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:48:05 +0000 (09:48 -0800)
04/9b9c669b82532f1ab86493b678aaa175854bd2 [new file with mode: 0644]

diff --git a/04/9b9c669b82532f1ab86493b678aaa175854bd2 b/04/9b9c669b82532f1ab86493b678aaa175854bd2
new file mode 100644 (file)
index 0000000..1292371
--- /dev/null
@@ -0,0 +1,138 @@
+Return-Path: <sebastien.binet@cern.ch>\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 5C0C1431FD7\r
+       for <notmuch@notmuchmail.org>; Mon,  9 Jul 2012 10:04:48 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -5\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-5 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_HI=-5] 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 9SMI4FCexOWZ for <notmuch@notmuchmail.org>;\r
+       Mon,  9 Jul 2012 10:04:47 -0700 (PDT)\r
+Received: from CERNMX32.cern.ch (cernmx32.cern.ch [137.138.144.178])\r
+       (using TLSv1 with cipher AES128-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 5A354431FAE\r
+       for <notmuch@notmuchmail.org>; Mon,  9 Jul 2012 10:04:47 -0700 (PDT)\r
+Received: from CERNFE22.cern.ch (137.138.144.151) by cernmxgwlb2.cern.ch\r
+       (137.138.144.178) with Microsoft SMTP Server (TLS) id 14.2.283.3;\r
+       Mon, 9 Jul 2012 19:04:45 +0200\r
+Received: from localhost (134.158.88.68) by smtp.cern.ch (137.138.144.172)\r
+       with Microsoft SMTP Server (TLS) id 14.2.298.4; Mon, 9 Jul 2012 19:04:45\r
+       +0200\r
+From: Sebastien Binet <binet@cern.ch>\r
+To: Jameson Graef Rollins <jrollins@finestructure.net>, Notmuch developer list\r
+       <notmuch@notmuchmail.org>\r
+Subject: post-new [was: Re: query on a subset of messages ?]\r
+In-Reply-To: <87wr2c3mtj.fsf@cern.ch>\r
+References: <871ukl5oj7.fsf@cern.ch> <87ehol2aku.fsf@servo.finestructure.net>\r
+       <87wr2c3mtj.fsf@cern.ch>\r
+User-Agent: Notmuch/0.13.2+60~g7ecf77d (http://notmuchmail.org) Emacs/24.1.1\r
+       (x86_64-unknown-linux-gnu)\r
+Date: Mon, 9 Jul 2012 19:04:45 +0200\r
+Message-ID: <87r4sk3lxu.fsf@cern.ch>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1;\r
+       protocol="application/pgp-signature"\r
+X-Originating-IP: [134.158.88.68]\r
+Keywords: CERN SpamKiller Note: -50\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: Mon, 09 Jul 2012 17:04:48 -0000\r
+\r
+--=-=-=\r
+Content-Type: text/plain\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+Sebastien Binet <binet@cern.ch> writes:\r
+\r
+> Jamie,\r
+>\r
+> Jameson Graef Rollins <jrollins@finestructure.net> writes:\r
+>\r
+>> On Mon, Jul 09 2012, Sebastien Binet <binet@cern.ch> wrote:\r
+>>> I was trying to reduce the I/O stress during my usual email\r
+>>> fetching+tagging by writing a little program using the go bindings to\r
+>>> notmuch.\r
+>>>\r
+>>> ie:\r
+>>> db, status :=3D notmuch.OpenDatabase(db_path,\r
+>>>                    notmuch.DATABASE_MODE_READ_WRITE)\r
+>>> query :=3D db.CreateQuery("(tag:new AND tag:inbox)")\r
+>>> msgs :=3D query.SearchMessages()\r
+>>> for _,msg :=3D range msgs {\r
+>>>   tag_msg(msg, tagqueries)\r
+>>> }\r
+>>>\r
+>>>\r
+>>> where tagqueries is a subquery of the form:\r
+>>> [\r
+>>>     {\r
+>>>         "Cmd": "+to-me",\r
+>>>         "Query": "(to:sebastien.binet@cern.ch and not tag:to-me)"\r
+>>>     },\r
+>>>     {\r
+>>>         "Cmd": "+sci-notmuch",\r
+>>>         "Query": "from:notmuch@notmuchmail.org or to:notmuch@notmuchmai=\r
+l.org or subject:notmuch"\r
+>>>     }\r
+>>> ]\r
+>>\r
+>>\r
+>> Hi, Sebastian.  It's really hard for me to believe that this is much\r
+>> faster than simply making the two tagging calls in full:\r
+>>\r
+>> notmuch tag +to-me -- tag:new and tag:inbox and (to:sebastien.binet@cern=\r
+.ch and not tag:to-me)\r
+>> notmuch tag +sci-notmuch -- tag:new and tag:inbox and from:notmuch@notmu=\r
+chmail.org or to:notmuch@notmuchmail.org or subject:notmuch"\r
+>>\r
+>> After the first call the cache will be fresh, so the overhead should be\r
+>> minimal.  It looks to me you're looking in to this as a post-new hook.\r
+>> I do pretty much the same thing, and with the above properly constructed\r
+>> searches the tagging is super fast.\r
+>\r
+> well, of course I don't have just those two:\r
+>\r
+> $ grep -He "^tag_new " emacs/notmuch-lib/notmuch-tag.sh | wc -l\r
+> 54\r
+>\r
+> also:\r
+> $ du -hs mail-notmuch/.notmuch=20\r
+> 2.9G mail-notmuch/.notmuch\r
+>\r
+> that said, most of the I/O wait seem to come from 'notmuch new' (after\r
+> having dropped all fs caches.)\r
+>\r
+> ok, post-new hook it is then :)\r
+\r
+hum... is post-new supposed to be run even if there is no new message ?\r
+\r
+=2Ds\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v2.0.19 (GNU/Linux)\r
+\r
+iEYEARECAAYFAk/7Dy0ACgkQPj4AVbsZCCYbhwCfSIExENOQ3sNYfUkzdVwspDfg\r
+ev4AoLw/UVxCscG9quFzyVpXv54h5kn8\r
+=fqLI\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r