Re: [PATCH v7 3/3] Use the structured formatters in notmuch-search.c.
[notmuch-archives.git] / 04 / 9b9c669b82532f1ab86493b678aaa175854bd2
1 Return-Path: <sebastien.binet@cern.ch>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 5C0C1431FD7\r
6         for <notmuch@notmuchmail.org>; Mon,  9 Jul 2012 10:04:48 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -5\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-5 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_HI=-5] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 9SMI4FCexOWZ for <notmuch@notmuchmail.org>;\r
16         Mon,  9 Jul 2012 10:04:47 -0700 (PDT)\r
17 Received: from CERNMX32.cern.ch (cernmx32.cern.ch [137.138.144.178])\r
18         (using TLSv1 with cipher AES128-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 5A354431FAE\r
21         for <notmuch@notmuchmail.org>; Mon,  9 Jul 2012 10:04:47 -0700 (PDT)\r
22 Received: from CERNFE22.cern.ch (137.138.144.151) by cernmxgwlb2.cern.ch\r
23         (137.138.144.178) with Microsoft SMTP Server (TLS) id 14.2.283.3;\r
24         Mon, 9 Jul 2012 19:04:45 +0200\r
25 Received: from localhost (134.158.88.68) by smtp.cern.ch (137.138.144.172)\r
26         with Microsoft SMTP Server (TLS) id 14.2.298.4; Mon, 9 Jul 2012 19:04:45\r
27         +0200\r
28 From: Sebastien Binet <binet@cern.ch>\r
29 To: Jameson Graef Rollins <jrollins@finestructure.net>, Notmuch developer list\r
30         <notmuch@notmuchmail.org>\r
31 Subject: post-new [was: Re: query on a subset of messages ?]\r
32 In-Reply-To: <87wr2c3mtj.fsf@cern.ch>\r
33 References: <871ukl5oj7.fsf@cern.ch> <87ehol2aku.fsf@servo.finestructure.net>\r
34         <87wr2c3mtj.fsf@cern.ch>\r
35 User-Agent: Notmuch/0.13.2+60~g7ecf77d (http://notmuchmail.org) Emacs/24.1.1\r
36         (x86_64-unknown-linux-gnu)\r
37 Date: Mon, 9 Jul 2012 19:04:45 +0200\r
38 Message-ID: <87r4sk3lxu.fsf@cern.ch>\r
39 MIME-Version: 1.0\r
40 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1;\r
41         protocol="application/pgp-signature"\r
42 X-Originating-IP: [134.158.88.68]\r
43 Keywords: CERN SpamKiller Note: -50\r
44 X-BeenThere: notmuch@notmuchmail.org\r
45 X-Mailman-Version: 2.1.13\r
46 Precedence: list\r
47 List-Id: "Use and development of the notmuch mail system."\r
48         <notmuch.notmuchmail.org>\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
52 List-Post: <mailto:notmuch@notmuchmail.org>\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
56 X-List-Received-Date: Mon, 09 Jul 2012 17:04:48 -0000\r
57 \r
58 --=-=-=\r
59 Content-Type: text/plain\r
60 Content-Transfer-Encoding: quoted-printable\r
61 \r
62 Sebastien Binet <binet@cern.ch> writes:\r
63 \r
64 > Jamie,\r
65 >\r
66 > Jameson Graef Rollins <jrollins@finestructure.net> writes:\r
67 >\r
68 >> On Mon, Jul 09 2012, Sebastien Binet <binet@cern.ch> wrote:\r
69 >>> I was trying to reduce the I/O stress during my usual email\r
70 >>> fetching+tagging by writing a little program using the go bindings to\r
71 >>> notmuch.\r
72 >>>\r
73 >>> ie:\r
74 >>> db, status :=3D notmuch.OpenDatabase(db_path,\r
75 >>>                     notmuch.DATABASE_MODE_READ_WRITE)\r
76 >>> query :=3D db.CreateQuery("(tag:new AND tag:inbox)")\r
77 >>> msgs :=3D query.SearchMessages()\r
78 >>> for _,msg :=3D range msgs {\r
79 >>>   tag_msg(msg, tagqueries)\r
80 >>> }\r
81 >>>\r
82 >>>\r
83 >>> where tagqueries is a subquery of the form:\r
84 >>> [\r
85 >>>     {\r
86 >>>         "Cmd": "+to-me",\r
87 >>>         "Query": "(to:sebastien.binet@cern.ch and not tag:to-me)"\r
88 >>>     },\r
89 >>>     {\r
90 >>>         "Cmd": "+sci-notmuch",\r
91 >>>         "Query": "from:notmuch@notmuchmail.org or to:notmuch@notmuchmai=\r
92 l.org or subject:notmuch"\r
93 >>>     }\r
94 >>> ]\r
95 >>\r
96 >>\r
97 >> Hi, Sebastian.  It's really hard for me to believe that this is much\r
98 >> faster than simply making the two tagging calls in full:\r
99 >>\r
100 >> notmuch tag +to-me -- tag:new and tag:inbox and (to:sebastien.binet@cern=\r
101 .ch and not tag:to-me)\r
102 >> notmuch tag +sci-notmuch -- tag:new and tag:inbox and from:notmuch@notmu=\r
103 chmail.org or to:notmuch@notmuchmail.org or subject:notmuch"\r
104 >>\r
105 >> After the first call the cache will be fresh, so the overhead should be\r
106 >> minimal.  It looks to me you're looking in to this as a post-new hook.\r
107 >> I do pretty much the same thing, and with the above properly constructed\r
108 >> searches the tagging is super fast.\r
109 >\r
110 > well, of course I don't have just those two:\r
111 >\r
112 > $ grep -He "^tag_new " emacs/notmuch-lib/notmuch-tag.sh | wc -l\r
113 > 54\r
114 >\r
115 > also:\r
116 > $ du -hs mail-notmuch/.notmuch=20\r
117 > 2.9G  mail-notmuch/.notmuch\r
118 >\r
119 > that said, most of the I/O wait seem to come from 'notmuch new' (after\r
120 > having dropped all fs caches.)\r
121 >\r
122 > ok, post-new hook it is then :)\r
123 \r
124 hum... is post-new supposed to be run even if there is no new message ?\r
125 \r
126 =2Ds\r
127 \r
128 --=-=-=\r
129 Content-Type: application/pgp-signature\r
130 \r
131 -----BEGIN PGP SIGNATURE-----\r
132 Version: GnuPG v2.0.19 (GNU/Linux)\r
133 \r
134 iEYEARECAAYFAk/7Dy0ACgkQPj4AVbsZCCYbhwCfSIExENOQ3sNYfUkzdVwspDfg\r
135 ev4AoLw/UVxCscG9quFzyVpXv54h5kn8\r
136 =fqLI\r
137 -----END PGP SIGNATURE-----\r
138 --=-=-=--\r