]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Msgmap.pm
No ext_urls
[public-inbox.git] / lib / PublicInbox / Msgmap.pm
index 1041cd177ed2dbb5589228354b29a1bf0b2eccd4..cb4bb2956ba2e6f856596a7dffccf7d6a888b34b 100644 (file)
@@ -144,13 +144,17 @@ sub max {
        $sth->fetchrow_array // 0;
 }
 
-sub minmax {
-       # breaking MIN and MAX into separate queries speeds up from 250ms
-       # to around 700us with 2.7million messages.
+sub min {
        my $sth = $_[0]->{dbh}->prepare_cached('SELECT MIN(num) FROM msgmap',
                                                undef, 1);
        $sth->execute;
-       ($sth->fetchrow_array // 0, max($_[0]));
+       $sth->fetchrow_array // 0;
+}
+
+sub minmax {
+       # breaking MIN and MAX into separate queries speeds up from 250ms
+       # to around 700us with 2.7million messages.
+       (min($_[0]), max($_[0]));
 }
 
 sub mid_delete {