unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Matt Armstrong <marmstrong@google.com>, notmuch@notmuchmail.org
Subject: Re: On properties and the notmuch CLI
Date: Sun, 17 Feb 2019 20:25:25 -0400	[thread overview]
Message-ID: <874l92gcy2.fsf@tethera.net> (raw)
In-Reply-To: <qf5a7iup5s8.fsf@naz.kir.corp.google.com>

Matt Armstrong <marmstrong@google.com> 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-<project>- 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.

      parent reply	other threads:[~2019-02-18  0:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-17 19:35 On properties and the notmuch CLI Matt Armstrong
2019-02-17 20:14 ` VA
2019-02-17 20:22   ` rhn
2019-02-18  0:25 ` David Bremner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874l92gcy2.fsf@tethera.net \
    --to=david@tethera.net \
    --cc=marmstrong@google.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).