From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id F01B31F55F for ; Mon, 2 Oct 2023 14:58:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1696258694; bh=9gcRR8mOTqE/oYegfjbw8NZYyJ9tip6grM2OANQ4ML8=; h=From:To:Subject:Date:From; b=Y82+5FVIdU7ohF8nis9f7X4CrHM4OOqnwZO1PajTT7Fe/FbnTkHfmBv71p4efP2gq d+tXJycfh9V9NjmrtV4n0Akn5NHkDq2OZ5yktGeaT9JP2PuHrUoKEJFW03Gqm6tYEr 5nWDCCz5DnK8jr+GYzc3T4QdB7lFJSfbVxBDuep0= From: Eric Wong To: spew@80x24.org Subject: [PATCH] lei up: faster non-thread, single-source incremental query Date: Mon, 2 Oct 2023 14:58:13 +0000 Message-ID: <20231002145813.2665392-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: When using isearch (that is v1/v2 inbox relying on extindex for search), there's actually no guarantee that IMAP UIDs are in the correct order with regard to Xapian docids. Thus we must iterate through every UID(num) to see if it's suitable to display in a saved search. The old grep filter (before commit a6fe84489127) was not effective since it didn't account for the mset->items correspondence. Fortunately, this bug merely manifests in reduced performance as of a6fe84489127. Prior to that, it could cause incorrect keywords and labels to be applied. Unfortunately, this behavior is hard-to-test so no test case is included. Followup-to: a6fe84489127 (lei up: fix missing -t/--threads matches w/ saved search) --- lib/PublicInbox/LeiXSearch.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm index 5f105567..4e0849e8 100644 --- a/lib/PublicInbox/LeiXSearch.pm +++ b/lib/PublicInbox/LeiXSearch.pm @@ -211,9 +211,10 @@ sub query_one_mset { # for --threads and l2m w/o sort } } else { $first_ids = $ids; - my @items = $mset->items; + my @items = $mset->items; # parallel with @$ids for my $n (@$ids) { my $mitem = $items[$i++]; + next if $n <= $min; my $smsg = $over->get_art($n) or next; next if $smsg->{bytes} == 0; mitem_kw($srch, $smsg, $mitem, $fl) if $can_kw;