madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r23516: LJSUP-14739: remove "USE INDEX (rlogtime...

Committer: sbelyaev
LJSUP-14739: remove "USE INDEX (rlogtime)" from sql query to log2 table
U   trunk/cgi-bin/LJ/Entry.pm
Modified: trunk/cgi-bin/LJ/Entry.pm
===================================================================
--- trunk/cgi-bin/LJ/Entry.pm	2013-01-09 07:05:56 UTC (rev 23515)
+++ trunk/cgi-bin/LJ/Entry.pm	2013-01-09 11:00:32 UTC (rev 23516)
@@ -2147,7 +2147,6 @@
             jitemid, posterid, eventtime, rlogtime,
             security, allowmask, anum, replycount
          FROM log2
-         USE INDEX (rlogtime)
          WHERE
                 journalid=?
          " .
@@ -2316,7 +2315,7 @@
     my $result_ref;
     foreach my $limit (2, 10, 50, 100) {
         $result_ref = $dbr->selectall_arrayref(
-            "SELECT jitemid, anum, $field FROM log2 use index (rlogtime,revttime) ".
+            "SELECT jitemid, anum, $field FROM log2 ".
                 "WHERE journalid=? AND $field $cmp1 ? AND jitemid <> ? ".
                 $secwhere. " ".
                 "ORDER BY $field $order LIMIT $limit",
@@ -2388,7 +2387,7 @@
         }
     }
 
-    my $res = $dbr->selectcol_arrayref( "SELECT jitemid, anum FROM log2 use index (rlogtime,revttime) ".
+    my $res = $dbr->selectcol_arrayref( "SELECT jitemid, anum FROM log2 ".
                                         "WHERE journalid=? ".
                                         $secwhere. " ".
                                         "ORDER BY $field LIMIT 1", undef, $jid);

Tags: livejournal, madeon, pm, sbelyaev
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 1 comment