From 87dca6d8d5988c5eb54019cca342450b0b7dd6b7 Mon Sep 17 00:00:00 2001 From: "Eric Wong (Contractor, The Linux Foundation)" Date: Mon, 2 Apr 2018 00:04:55 +0000 Subject: www: rework query responses to avoid COUNT in SQLite In many cases, we do not care about the total number of messages. It's a rather expensive operation in SQLite (Xapian only provides an estimate). For LKML, this brings top-level /$INBOX/ loading time from ~375ms to around 60ms on my system. Days ago, this operation was taking 800-900ms(!) for me before introducing the SQLite overview DB. --- t/v2-add-remove-add.t | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 't/v2-add-remove-add.t') diff --git a/t/v2-add-remove-add.t b/t/v2-add-remove-add.t index b6c58872..c8d12d34 100644 --- a/t/v2-add-remove-add.t +++ b/t/v2-add-remove-add.t @@ -35,8 +35,8 @@ ok($im->add($mime), 'message added'); ok($im->remove($mime), 'message added'); ok($im->add($mime), 'message added again'); $im->done; -my $res = $ibx->recent({limit => 1000}); -is($res->{msgs}->[0]->{mid}, 'a-mid@b', 'message exists in history'); -is(scalar @{$res->{msgs}}, 1, 'only one message in history'); +my $msgs = $ibx->recent({limit => 1000}); +is($msgs->[0]->{mid}, 'a-mid@b', 'message exists in history'); +is(scalar @$msgs, 1, 'only one message in history'); done_testing(); -- cgit v1.2.3-24-ge0c7