[Patch v3 15/15] test: add machinery to download and verify databases
[notmuch-archives.git] / 45 / 12ee2f136bd0b87c65e876cfc1565025314bcc
1 Return-Path: <jrollins@finestructure.net>\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 1311A431FBD\r
6         for <notmuch@notmuchmail.org>; Mon,  9 Jul 2012 08:55:49 -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: -2.29\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.29 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3, T_MIME_NO_TEXT=0.01] 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 xJIPSg+O6NNx for <notmuch@notmuchmail.org>;\r
16         Mon,  9 Jul 2012 08:55:46 -0700 (PDT)\r
17 Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
18         [131.215.239.19])\r
19         by olra.theworths.org (Postfix) with ESMTP id BFCE7431FAE\r
20         for <notmuch@notmuchmail.org>; Mon,  9 Jul 2012 08:55:46 -0700 (PDT)\r
21 Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
22         by earth-doxen-postvirus (Postfix) with ESMTP id 5B34266E00D1;\r
23         Mon,  9 Jul 2012 08:55:44 -0700 (PDT)\r
24 X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new\r
25 Received: from finestructure.net (unknown [76.89.192.57])\r
26         (Authenticated sender: jrollins)\r
27         by earth-doxen-submit (Postfix) with ESMTP id 5FA9166E00AE;\r
28         Mon,  9 Jul 2012 08:55:32 -0700 (PDT)\r
29 Received: by finestructure.net (Postfix, from userid 1000)\r
30         id ECC6C378; Mon,  9 Jul 2012 08:55:31 -0700 (PDT)\r
31 From: Jameson Graef Rollins <jrollins@finestructure.net>\r
32 To: Sebastien Binet <binet@cern.ch>,\r
33         Notmuch developer list <notmuch@notmuchmail.org>\r
34 Subject: Re: query on a subset of messages ?\r
35 In-Reply-To: <871ukl5oj7.fsf@cern.ch>\r
36 References: <871ukl5oj7.fsf@cern.ch>\r
37 User-Agent: Notmuch/0.13.2+54~ga0426dc (http://notmuchmail.org) Emacs/23.4.1\r
38         (x86_64-pc-linux-gnu)\r
39 Date: Mon, 09 Jul 2012 08:55:29 -0700\r
40 Message-ID: <87ehol2aku.fsf@servo.finestructure.net>\r
41 MIME-Version: 1.0\r
42 Content-Type: multipart/signed; boundary="=-=-=";\r
43         micalg=pgp-sha256; protocol="application/pgp-signature"\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 15:55:49 -0000\r
57 \r
58 --=-=-=\r
59 \r
60 On Mon, Jul 09 2012, Sebastien Binet <binet@cern.ch> wrote:\r
61 > I was trying to reduce the I/O stress during my usual email\r
62 > fetching+tagging by writing a little program using the go bindings to\r
63 > notmuch.\r
64 >\r
65 > ie:\r
66 > db, status := notmuch.OpenDatabase(db_path,\r
67 >               notmuch.DATABASE_MODE_READ_WRITE)\r
68 > query := db.CreateQuery("(tag:new AND tag:inbox)")\r
69 > msgs := query.SearchMessages()\r
70 > for _,msg := range msgs {\r
71 >   tag_msg(msg, tagqueries)\r
72 > }\r
73 >\r
74 >\r
75 > where tagqueries is a subquery of the form:\r
76 > [\r
77 >     {\r
78 >         "Cmd": "+to-me",\r
79 >         "Query": "(to:sebastien.binet@cern.ch and not tag:to-me)"\r
80 >     },\r
81 >     {\r
82 >         "Cmd": "+sci-notmuch",\r
83 >         "Query": "from:notmuch@notmuchmail.org or to:notmuch@notmuchmail.org or subject:notmuch"\r
84 >     }\r
85 > ]\r
86 \r
87 \r
88 Hi, Sebastian.  It's really hard for me to believe that this is much\r
89 faster than simply making the two tagging calls in full:\r
90 \r
91 notmuch tag +to-me -- tag:new and tag:inbox and (to:sebastien.binet@cern.ch and not tag:to-me)\r
92 notmuch tag +sci-notmuch -- tag:new and tag:inbox and from:notmuch@notmuchmail.org or to:notmuch@notmuchmail.org or subject:notmuch"\r
93 \r
94 After the first call the cache will be fresh, so the overhead should be\r
95 minimal.  It looks to me you're looking in to this as a post-new hook.\r
96 I do pretty much the same thing, and with the above properly constructed\r
97 searches the tagging is super fast.\r
98 \r
99 Have you tried profiling the two options?  Is it really high I/O stress\r
100 on your system?  If so, maybe there's another issue that can be\r
101 addressed.\r
102 \r
103 As an aside I should point out that a lot of people want to see the\r
104 "to:me" search term.  But I think the right place to achieve that is in\r
105 the query parser.\r
106 \r
107 jamie.\r
108 \r
109 --=-=-=\r
110 Content-Type: application/pgp-signature\r
111 \r
112 -----BEGIN PGP SIGNATURE-----\r
113 Version: GnuPG v1.4.12 (GNU/Linux)\r
114 \r
115 iQIcBAEBCAAGBQJP+v7xAAoJEO00zqvie6q8DUYP/iaZK9Y0Ve92jlIPiKyLkvYf\r
116 7xy6IcRLeph/VnHtbIIRskGeZrmNTjIIZjGHiwf35twaAm3Sfb6JedMheEv5ZUld\r
117 c/qUUA5eR2otJTe910aNAijOlHoeVRe0sG/S1wv0WIYBADlpnWU4pph5TbQQdcyv\r
118 /YdhhxKKlCPRDhojjzYcco46RkzietCO3AL3DulbJWqWVA3jC2dFDiu7RtuQCoXo\r
119 Lqr4eavU0/sYsGjoPWmJyF5Xrna57jLtPwJ+WlSeXTEBiz62rB8AsqRUv5WQu/Gr\r
120 DVZQebRG05I+yMteBr0UKko/Vk4IkePmO+/MdHM2sGkYA60AwIoxvhhgpLVaO1Tv\r
121 Y2NUmPcUFYSL5HOlfMBvhNF0dhW0HmyWISCGSNkal9px3nSybYp84xlA6gsH0uqg\r
122 H3ri3oP08orej94vpw9rXCqjL68YNS9NpNKdLXSn9o50U6ILBgjaSzVKXEOXxAGW\r
123 tRzcOIW0Vz0ryY1Hb2U/ryhTjEVTUzPqHQx16sMOIGnL4qvyt4YLvpRszrCQH4dW\r
124 HQ3XaeXMjz7MFqFV73u43AwJ7ln0fGjIAZ8FzhWvY6ZyOrT3te5vZy7MicEUs3zp\r
125 655EGIZ1wUvn9JY5UvEGED1s+rd4LNii8YBGzRCx83xCe9PphdVOpsbUnxs1hT7o\r
126 JbbyLteArCoFiwskE+MK\r
127 =yswv\r
128 -----END PGP SIGNATURE-----\r
129 --=-=-=--\r