From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id WFb9KxPQJ2PUkQAAbAwnHQ (envelope-from ) for ; Mon, 19 Sep 2022 04:12:35 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id GNcMLBPQJ2NhKQAA9RJhRA (envelope-from ) for ; Mon, 19 Sep 2022 04:12:35 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2E1DA1687C for ; Mon, 19 Sep 2022 04:12:35 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 43DA55E00F; Mon, 19 Sep 2022 02:12:32 +0000 (UTC) Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by mail.notmuchmail.org (Postfix) with ESMTPS id 699625DC08 for ; Mon, 19 Sep 2022 02:12:29 +0000 (UTC) Received: from fencepost.gnu.org ([2001:470:142:3::e]:35990) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oa6Gn-0002jy-H7; Sun, 18 Sep 2022 22:12:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=3i2EHNrL5VoXSGvDbmmF+xdJnLqcndzg7TAvweh9pac=; b=Aies64F0GukY0AJSsMf2 JM0+nilAYz2iE+hI2NOFJb6UmelqvblaxdjaBYB3aMR+XYC+jt6AcqPUooHBM1IH1yk7MDayrgwbu oZKNn/SPVrncanMyNgYkvdl90vtKF9Dd14H9KtxJpGBS1FaMmcFsTjD9bH6e8x0hCYivFOUWie1Ux HDpouTNJFzr9MeX6bMBH3sWBIh8AHoXTuf8R/PVL67DSWKHpR/sTjm4dT92FGsxp9Qr/4CiJ2795W SIiKctslYpfY449TRVzUt/s3hGSdXb4C2u7L0jg8UyIZ+E9UcHno2/hchnS61FUCUU5q/3SA51W4Z Ufo/xudpCeBU4g==; Received: from cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net ([92.233.85.247]:50312 helo=rivendell.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oa6Gm-0003rM-3l; Sun, 18 Sep 2022 22:12:24 -0400 Received: from localhost (rivendell.localdomain [local]) by rivendell.localdomain (OpenSMTPD) with ESMTPA id c77b47f4; Mon, 19 Sep 2022 02:12:21 +0000 (UTC) From: Jose A Ortega Ruiz To: David Bremner , notmuch@notmuchmail.org Subject: Re: Notmuch emacs client is slow when opening inbox. In-Reply-To: <87zgew6tpv.fsf@tethera.net> References: <875yhmfglb.fsf@gmail.com> <871qs9riqd.fsf@mail.jao.io> <87zgew6tpv.fsf@tethera.net> X-Attribution: jao X-Clacks-Overhead: GNU Terry Pratchett X-URL: Date: Mon, 19 Sep 2022 03:12:21 +0100 Message-ID: <87r108p0xm.fsf@mail.jao.io> MIME-Version: 1.0 Message-ID-Hash: NWIM73A6V7VHKLEPAWTWM5VBGE7RVHBD X-Message-ID-Hash: NWIM73A6V7VHKLEPAWTWM5VBGE7RVHBD X-MailFrom: jao@gnu.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1663553555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=QDKROD64ZgHzyowDOdzCZcNN69KarmwNzyRIfGfODqU=; b=cVOoQcaPxaq2KL2MYR4EfjnAjheTNZLg9+5iZ6V4v4isq44zthJoSAxQD3JCzjYFzmi7lt QpjI5RaIat1Ymi0sxJwCYuJfuF/1Hi3eN8MSabvccgRBpi3mGDatC58Gm8JNTh1dIt50KT AJZOB4MNCvkY4i71Uj2Bbsy2o9XuEuzu65uAmlY7pzbFm9rnRMdI6vLk0sVro/wCQp1Syo fe0k/DOi5QS19LXu2A5G5/uk/MpSfnJYBpxcIrmFWDxkAowJiHcuFOH4U90QEnGK2bz3ee adVEl3HlpIRc704a6Y2zpIoDVJybgRfrGRVHj5m9bil8AUmUs/lGMD5u4m8e3w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1663553555; a=rsa-sha256; cv=none; b=RdTuZu60ANnz3IugWCjh5eA/pOTWQ3tPklt+VQpeanNDn9ccNBG+CLWTDieaJ6nDDg6oEP EwMaQc8iM90TUEI9HpLgzVbv06ra5UbUwDoINaZn8jnRlHBgslF+Lc6bCD0oSaXYtgM7bp k96RAnowBO5RYg3JDQ08CAeLIa/xW5M3zAbpbwIeUaCpMDGrN4vJafd0mXGQgSeb4nG0YO qj7ukKu5M+l4r3IlKr/TJr2SpzevVfgNzZ0ZHB+befJeDke2k00iDgMusaZ2ZPgnTIL/kx jPNqVYrW/wKfog/krWRI9G/IDmlcV45jweSPstuiltbNKh8WOT20F2vbKsKtaA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b=Aies64F0; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gnu.org (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 6.47 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b=Aies64F0; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gnu.org (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 2E1DA1687C X-Spam-Score: 6.47 X-Migadu-Scanner: scn1.migadu.com X-TUID: XgBMrLn/pPqt On Sun, Sep 18 2022, David Bremner wrote: > Jose A Ortega Ruiz 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