unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jose A Ortega Ruiz <jao@gnu.org>
To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
Subject: Re: Notmuch emacs client is slow when opening inbox.
Date: Mon, 19 Sep 2022 03:12:21 +0100	[thread overview]
Message-ID: <87r108p0xm.fsf@mail.jao.io> (raw)
In-Reply-To: <87zgew6tpv.fsf@tethera.net>

On Sun, Sep 18 2022, David Bremner wrote:

> Jose A Ortega Ruiz <mail@jao.io> writes:
>>
>> interesting!  if we were to have this, i think i'd prefer pagination
>> rather than increasing the limit and keeping the old ones, and make it
>> work for tree searches too.  and perhaps the limit (page size) could be
>> a query parameter, so that one could have different page sizes for
>> different queries.  if that makes sense (and i'm not missing a better
>> way already in place), i might try to implement it when i have a bit of
>> time.
>
> Before going to far with pagination, maybe get Jani to recap the
> difficulties he saw at the time that led him to propose the simpler
> approach.
>
> I can think of a few issues, but I don't really know if they are
> blockers.
> - the result set is going to vary dynamically as messages are added and
>   removed from the database
>
> - As far as I can tell, there isn't really an easy way to jump to page
> n of the results.

fwiw, my idea here was to always run the full, non-paginated query, and
populate its result buffer just as now, but show, instead of that
buffer, an indirect buffer pointing to it, narrowed to the page at hand.

in that scenario, one can always compute easily how many pages of output
are available so far, and know whether there are more to come (and ask
the user to wait a bit).  my feeling is that, in most cases, by the time
the user has perused one or two pages, all the results will already be
available and it'll be just a matter of changing narrow regions.

this also avoids the complication that changing tags as one reads
messages would also, in general, change the result set.

not as efficient as a limit/offset query per page, but i think the
bottleneck here is in displaying results rather than running the query
in most cases, isn't it?

jao
-- 
Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we. -Georges W. Bush

  reply	other threads:[~2022-09-19  2:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-17 10:19 Notmuch emacs client is slow when opening inbox sam.hedin
2022-09-17 10:45 ` Teemu Likonen
2022-09-17 19:08   ` Sam Hedin
2022-09-17 17:52 ` Jose A Ortega Ruiz
2022-09-19  1:25   ` David Bremner
2022-09-19  2:12     ` Jose A Ortega Ruiz [this message]
2022-09-19  9:46       ` David Bremner

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=87r108p0xm.fsf@mail.jao.io \
    --to=jao@gnu.org \
    --cc=david@tethera.net \
    --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).