]> Sergey Matveev's repositories - public-inbox.git/commitdiff
over: uid_range: remove LIMIT
authorEric Wong <e@yhbt.net>
Wed, 10 Jun 2020 07:05:18 +0000 (07:05 +0000)
committerEric Wong <e@yhbt.net>
Sat, 13 Jun 2020 07:55:45 +0000 (07:55 +0000)
The IMAP code already limits the range to UID_SLICE (50K),
so that's about 1.6MB of of IVs for an ephemeral allocation
that won't live beyond one iteration of the event loop.

lib/PublicInbox/Over.pm

index e0f20ea6d3da2de5a1e92cdd84fee2e66e68e4bd..e32104f0cf81754bf8ed1d6e8012eb13420f506c 100644 (file)
@@ -216,7 +216,7 @@ SELECT num,ts,ds,ddd FROM over WHERE num = ? LIMIT 1
        load_from_row($smsg);
 }
 
-# IMAP search
+# IMAP search, this is limited by callers to UID_SLICE size (50K)
 sub uid_range {
        my ($self, $beg, $end, $sql) = @_;
        my $dbh = $self->connect;
@@ -225,7 +225,7 @@ sub uid_range {
        # This is read-only, anyways; but caller should verify it's
        # only sending \A[0-9]+\z for ds and ts column ranges
        $q .= $$sql if $sql;
-       $q .= ' ORDER BY num ASC LIMIT ' . DEFAULT_LIMIT;
+       $q .= ' ORDER BY num ASC';
        $dbh->selectcol_arrayref($q, undef, $beg, $end);
 }