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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/Over.pm b/lib/PublicInbox/Over.pm
index e0f20ea6d3d..e32104f0cf8 100644
--- a/lib/PublicInbox/Over.pm
+++ b/lib/PublicInbox/Over.pm
@@ -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);
 }
 
--
unsubscribe: one-click, see List-Unsubscribe header
archive: https://public-inbox.org/meta/

Reply via email to