]> Sergey Matveev's repositories - public-inbox.git/commitdiff
over: avoid excessive SELECT
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Sat, 7 Apr 2018 03:41:48 +0000 (03:41 +0000)
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Sat, 7 Apr 2018 03:42:25 +0000 (03:42 +0000)
No need to read what we don't need into the Perl process.
Fix some broken capitalization while we're at it.

lib/PublicInbox/Over.pm

index da0f11e5dfded738323b92a1233a0d827ae447d8..07e54b64ca5de9448a4cf35399faaa37d7e6295a 100644 (file)
@@ -59,7 +59,7 @@ sub do_get {
 sub query_xover {
        my ($self, $beg, $end) = @_;
        do_get($self, <<'', {}, $beg, $end);
-SELECT * FROM over WHERE num >= ? AND num <= ?
+SELECT num,ts,ds,ddd FROM over WHERE num >= ? AND num <= ?
 ORDER BY num ASC
 
 }
@@ -131,7 +131,7 @@ sub recent {
                }
        }
        my $msgs = do_get($self, <<"", $opts, @v);
-SELECT * FROM over WHERE $s
+SELECT ts,ds,ddd FROM over WHERE $s
 
        return $msgs unless wantarray;
 
@@ -145,7 +145,7 @@ sub get_art {
        my ($self, $num) = @_;
        my $dbh = $self->connect;
        my $smsg = $dbh->selectrow_hashref(<<'', undef, $num);
-SELECT * from OVER where num = ? LIMIT 1
+SELECT num,ds,ts,ddd FROM over WHERE num = ? LIMIT 1
 
        return load_from_row($smsg) if $smsg;
        undef;