diff options
author | Eric Wong <e@80x24.org> | 2021-07-23 10:56:11 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-07-25 00:11:36 +0000 |
commit | 1218bee34cf04498ac36add5c7e847698be541c2 (patch) | |
tree | 142afb972faffd2f01c1369cd1858cf36eb5b8ea /lib/PublicInbox/LeiToMail.pm | |
parent | d15bd6a20a836473479d8431682ba305e2dcdfbe (diff) | |
download | public-inbox-1218bee34cf04498ac36add5c7e847698be541c2.tar.gz |
SQLite COUNT() is a slow operation that does a full table scan with no conditions. There's no need for it, since lei dedupe only needs to know if it's empty or not to decide between new/ and cur/ for Maildir outputs.
Diffstat (limited to 'lib/PublicInbox/LeiToMail.pm')
-rw-r--r-- | lib/PublicInbox/LeiToMail.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/LeiToMail.pm b/lib/PublicInbox/LeiToMail.pm index b9405c0c..d782d4c7 100644 --- a/lib/PublicInbox/LeiToMail.pm +++ b/lib/PublicInbox/LeiToMail.pm @@ -198,7 +198,7 @@ sub _mbox_write_cb ($$) { my $dedupe = $lei->{dedupe}; $dedupe->prepare_dedupe; my $lse = $lei->{lse}; # may be undef - my $set_recent = $dedupe->dedupe_nr; + my $set_recent = $dedupe->has_entries; sub { # for git_to_mail my ($buf, $smsg, $eml) = @_; $eml //= PublicInbox::Eml->new($buf); @@ -293,7 +293,7 @@ sub _maildir_write_cb ($$) { # Favor cur/ and only write to new/ when augmenting. This # saves MUAs from having to do a mass rename when the initial # search result set is huge. - my $dir = $dedupe && $dedupe->dedupe_nr ? 'new/' : 'cur/'; + my $dir = $dedupe && $dedupe->has_entries ? 'new/' : 'cur/'; sub { # for git_to_mail my ($bref, $smsg, $eml) = @_; $dst // return $lei->fail; # dst may be undef-ed in last run |