unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Matt Armstrong <marmstrong@google.com>
To: David Bremner <david@tethera.net>,
	Daniel Kahn Gillmor <dkg@fifthhorseman.net>,
	Xu Wang <xuwang762@gmail.com>,
	notmuch@notmuchmail.org
Subject: Re: find threads where I and Jian participated but not Dave
Date: Thu, 15 Jun 2017 18:07:53 -0700	[thread overview]
Message-ID: <qf5k24c4u52.fsf@google.com> (raw)
In-Reply-To: <8737b1rojw.fsf@tethera.net>

David Bremner <david@tethera.net> writes:

> Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:
>
>>
>> One of my long-standing wishes is to be able to say "show me mails in my
>> inbox from people who have replied to messages i've sent them".
>>
>> This could be re-framed as "show me threads in which i've participated,
>> where there are some messages flagged with 'inbox'".  but generating a
>> huge list of all threads in which i've participated, just to be able to
>> do an intersection operation with a (much smaller) list of all threads
>> that have a message with the inbox flag seems like a pretty gross
>> inefficiency.
>
> At the moment the best we could do is essentially the same algorithm,
> but in C instead of shell / python. Threads are not documents in the
> database, so they can't efficiently be searched for.  Of course we could
> change that, but those kind of changes take a fair amount of effort, and
> some careful design work.

Even if the C level does the same algorithm, it may be able to do some
optimizations on behalf of the "scripting layer" queries.

I suspect that a separate "thread based" query language may be an
interesting area of investigation.

Taking Daniel's last example, "show me mails in my inbox from people who
have replied to messages I've sent them".  That isn't even an entirely
unambiguous query specification.  What is *actually* desired:

a) show me messages from X that are part of threads where at least one
message is in the inbox and for which at least one message is from me.

or,

b) same as (a) but the "message from X" must be in the inbox (not just
any other message in the thread)

or,

c) same as (a) or (b) but the "message from X" is a reply (e.g. dated
after, or in-reply-to) a message from me.

or,

d) same as (c) but "message from X" is "unread", etc.

Like David's 'comm -12 A B' solution, these pretty quickly start looking
like multi-pass, or structed/nested, queries.  They are a lot more like
relational database queries (SQL) than the single-pass, flat (NoSQL)
queries we typically use with notmuch.

  reply	other threads:[~2017-06-16  1:07 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-09 21:55 find threads where I and Jian participated but not Dave Xu Wang
2017-06-13 15:57 ` Xu Wang
2017-06-13 23:31   ` David Bremner
2017-06-14  0:24     ` Xu Wang
2017-06-14  3:32     ` Brian Sniffen
2017-06-15 17:54     ` Daniel Kahn Gillmor
2017-06-15 20:20       ` David Bremner
2017-06-16  1:07         ` Matt Armstrong [this message]
2017-06-16  6:28         ` Gaute Hope
2017-06-21 20:04           ` Matt Armstrong
2017-06-21 21:30             ` Daniel Kahn Gillmor
2017-06-22  6:08               ` Gaute Hope
2017-06-22  6:22                 ` Gaute Hope
2017-06-23  0:00                   ` Matt Armstrong
2017-06-25 15:46                     ` finding incoming messages in threads in which i've participated [was: Re: find threads where I and Jian participated but not Dave] Daniel Kahn Gillmor
2017-06-25 17:14                       ` David Bremner
2017-06-26 20:49                         ` Matt Armstrong
2017-06-26 23:09                           ` David Bremner
2017-08-20 13:35                           ` Jani Nikula
2017-08-20 13:48                         ` Jani Nikula
2017-08-20 21:32                           ` [PATCH] WIP: add thread subqueries David Bremner
2017-08-21  1:35                             ` David Bremner
2017-09-07 17:47                               ` Gaute Hope
2017-09-07 18:51                                 ` David Bremner
2017-06-25 17:40                       ` finding incoming messages in threads in which i've participated [was: Re: find threads where I and Jian participated but not Dave] Brian Sniffen
2017-06-26 20:54                       ` Matt Armstrong
2017-06-22 20:15               ` find threads where I and Jian participated but not Dave Matt Armstrong

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=qf5k24c4u52.fsf@google.com \
    --to=marmstrong@google.com \
    --cc=david@tethera.net \
    --cc=dkg@fifthhorseman.net \
    --cc=notmuch@notmuchmail.org \
    --cc=xuwang762@gmail.com \
    /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).