From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 8F4646DE0F22 for ; Sun, 17 Feb 2019 16:25:32 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.007 X-Spam-Level: X-Spam-Status: No, score=-0.007 tagged_above=-999 required=5 tests=[AWL=-0.006, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9KHO4jI_Jp4z for ; Sun, 17 Feb 2019 16:25:31 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 759BE6DE0F17 for ; Sun, 17 Feb 2019 16:25:31 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1gvWkS-00014G-8I; Sun, 17 Feb 2019 19:25:28 -0500 Received: (nullmailer pid 1195 invoked by uid 1000); Mon, 18 Feb 2019 00:25:25 -0000 From: David Bremner To: Matt Armstrong , notmuch@notmuchmail.org Subject: Re: On properties and the notmuch CLI In-Reply-To: References: Date: Sun, 17 Feb 2019 20:25:25 -0400 Message-ID: <874l92gcy2.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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: Mon, 18 Feb 2019 00:25:32 -0000 Matt Armstrong writes: > (c) it is not possible to set or modify properties from the command > line. > > True? Are queries like these any more efficient than tag doing a prefix > regex search over tags? By this I mean, does the Xapian side keep an > efficient index of all messages that have at least one property "P"? It's pretty much the same (or would be, if implimented). Properties are stored as xapian terms attached to mail document. This means there is a sorted list of P=a, P=b, etc..., we can jump efficiently to the first one, and construct a query that matches them all. It does mean if you have an enormous number of values for one property it will be expensive. Xapian has support for "wildcard" terms ending in "*". If I remember correctly this is not supported for boolean ("exact") prefixes like property: and tag: ; internally this does something similar, although quite possibly a bit faster since it's internal to Xapian (and written by Xapian experts). > Second, a question: is there any possibility of relaxing restriction > (c) It's possible. It would require a bit of coding (roughly duplicating notmuch-tag.c, but with a simpler command line syntax, I suppose). It could be a bit of a footgun since e.g. notmuch is using some properties to maintain encryption state. But people can already make themselves sad with mass tag operations. > As far as the risk of property name collisions, perhaps encourage an > x-- prefix convention for all properties not registered with > the notmuch project? That seems to have served well enough for email > headers. BTW, notmuch is currently using . as a namespace separator, so this would look more like "x-project." . Your proposal seems plausible to me; if others agree we can document it.