From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4F2yI9mw52LYAAAAbAwnHQ (envelope-from ) for ; Mon, 01 Aug 2022 12:54:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id mBeWI9mw52LJewEAauVa8A (envelope-from ) for ; Mon, 01 Aug 2022 12:54:17 +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 5501716FD1 for ; Mon, 1 Aug 2022 12:54:17 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id E626D5F37F; Mon, 1 Aug 2022 10:54:14 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id C4D4E5F026 for ; Mon, 1 Aug 2022 10:54:11 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 8EFE15FBC0; Mon, 1 Aug 2022 06:54:10 -0400 (EDT) Received: (nullmailer pid 3381763 invoked by uid 1000); Mon, 01 Aug 2022 10:54:09 -0000 From: David Bremner To: Al Haji-Ali , notmuch@notmuchmail.org Subject: Re: lastmod based on date/time In-Reply-To: References: Date: Mon, 01 Aug 2022 07:54:09 -0300 Message-ID: <87edy0p73i.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: O4CC7O2ULMR2WMXLVKAFCE5JTNLJZWQ7 X-Message-ID-Hash: O4CC7O2ULMR2WMXLVKAFCE5JTNLJZWQ7 X-MailFrom: david@tethera.net 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=1659351257; 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; bh=CLWF7ep9/3eblPUWAJiZUkSoGstYU8cz9cNsQh3yM94=; b=iA+CkdO5EXiNaF7u15ifc0b12kWEHNgdZNLi8xNHA623yPfLu0yMY8LK4v2uOumBgOZQ91 4mnWd+1r0SNKlVItRdMSMKg2/NR2lroJNlcxEOazVWRlBXIkYKTfSiILQMEcSZtCHfAZfo wsk3lsQx81nL6k+caC2XeqnAWNClARiGAxVo37kejgxUemsYBDFNurJkbk4FlzMkZ2p+JN 0D6/KRbdmBjyOr+CIA5/jJvPb++T8lePzwxErUPHeheDccJsme300utGFPET1P014d+oLD dsHfv2jj4cmuhCo3wnp2XjumGbgSV4l8EknKaK/3TQkR+QRY9zG7fwUd+jPW9g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659351257; a=rsa-sha256; cv=none; b=d9wQvrReaUX4zxI1LbKXxKlljPuIUnoTuQx70W14GE1QcgD3fQBFCWBeIBhUorPzJLwSWk VR5l8ANnvleq05ycXEk7m56NL7ZpWKCp2FIrj14WNxwoYNw8KEWW/+QzSR0pKg6QammZ50 Zq0nDvqVBOe/q7lEAyoIIyfQm47hIT7Jon0MI9CJErK5he1L90abKGckcZ1Tud52gmBgWw XtUzJIGTkopwqEnHgxA4xRhhvo3szhD0qbhOLMLMZDmjtZ0sMxLO2H0DMHajDHJSG57VQj HnoRz9HYXFqv6Q/0NQ1egchnP8PqlOCowKcnteSeyhyefUGSC9rRmjnHBGPyJw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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: -2.76 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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: 5501716FD1 X-Spam-Score: -2.76 X-Migadu-Scanner: scn0.migadu.com X-TUID: ElCnkGi59iXd Al Haji-Ali writes: > Would it be possible to search for lastmod messages based on time > rather than revision ID? Using revision ID is convenient for > tools/scripts, but not for actual everyday use. > The modification time is not saved in the database. > I sometimes find myself needing to find a message that I accidentally > archived/moved and it would be convenient if I can list all the > messages that I modified (tag or otherwise) in the past day for > example. I currently use the current value of revision ID minus a few > hundreds as a proxy for time. A workaround could be to run a cron job or equivalent that logs (lastmod,timestamp) pairs to a file. Of course that would make using the information a bit inconvenient without further tooling. Because of concerns about performance, we have so far resisted having a "tagging hook". 'lastmod:' was added at some point because it addressed some of the usecases for a tagging hook. At the time (2014) we chose the counter approach over timestamps because of the difficulty of synchronizing clocks between machines and the possibility of clock changes on a given machine [1]. In principle modification timestamps could be added as additional data for each message. I'm not sure about the cost/benefit here (either for implementation or performance) but if someone wants to investigate further I can point them in the right direction (mostly, copy the lastmod stuff). [1]: I think most of the discussion is in the thread https://nmbug.notmuchmail.org/nmweb/show/1396800683-9164-1-git-send-email-eg%40gaute.vetsj.com