From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 223CF1F513 for ; Sat, 7 Apr 2018 03:41:55 +0000 (UTC) From: "Eric Wong (Contractor, The Linux Foundation)" To: meta@public-inbox.org Subject: [PATCH 2/8] over: avoid excessive SELECT Date: Sat, 7 Apr 2018 03:41:48 +0000 Message-Id: <20180407034154.2309-3-e@80x24.org> In-Reply-To: <20180407034154.2309-1-e@80x24.org> References: <20180407034154.2309-1-e@80x24.org> List-Id: 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/PublicInbox/Over.pm b/lib/PublicInbox/Over.pm index da0f11e..07e54b6 100644 --- a/lib/PublicInbox/Over.pm +++ b/lib/PublicInbox/Over.pm @@ -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; -- EW