r34667 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r34666‎ | r34667 | r34668 >
Date:15:57, 12 May 2008
Author:aaron
Status:old
Tags:
Comment:
Give rev_page to avoid secondary lookup
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -639,7 +639,9 @@
640640 $row = $db->selectRow( array('flaggedrevs','revision'),
641641 $columns,
642642 array( 'fr_page_id' => $title->getArticleID(),
643 - 'fr_rev_id' => $rev_id, 'fr_rev_id = rev_id',
 643+ 'fr_rev_id' => $rev_id,
 644+ 'rev_id = fr_rev_id',
 645+ 'rev_page = fr_page_id',
644646 'rev_deleted & '.Revision::DELETED_TEXT => 0 ),
645647 __METHOD__ );
646648 # Sorted from highest to lowest, so just take the first one if any
@@ -723,7 +725,8 @@
724726 $columns,
725727 array( 'fr_page_id' => $title->getArticleID(),
726728 'fr_quality >= 1',
727 - 'fr_rev_id = rev_id',
 729+ 'rev_id = fr_rev_id',
 730+ 'rev_page = fr_page_id',
728731 'rev_deleted & '.Revision::DELETED_TEXT => 0),
729732 __METHOD__,
730733 array( 'ORDER BY' => 'fr_rev_id DESC') );
@@ -734,7 +737,8 @@
735738 $row = $dbw->selectRow( array('flaggedrevs','revision'),
736739 $columns,
737740 array( 'fr_page_id' => $title->getArticleID(),
738 - 'fr_rev_id = rev_id',
 741+ 'rev_id = fr_rev_id',
 742+ 'rev_page = fr_page_id',
739743 'rev_deleted & '.Revision::DELETED_TEXT => 0),
740744 __METHOD__,
741745 array( 'ORDER BY' => 'fr_rev_id DESC' ) );
@@ -765,7 +769,7 @@
766770
767771 if( !$count ) {
768772 $dbr = wfGetDB( DB_SLAVE );
769 - $count = $dbr->selectField('revision', 'COUNT(*)',
 773+ $count = $dbr->selectField( 'revision', 'COUNT(*)',
770774 array('rev_page' => $article->getId(), "rev_id > " . intval($from_rev) ),
771775 __METHOD__ );
772776 # Save to cache
@@ -1237,7 +1241,8 @@
12381242 $maxQuality = $dbw->selectField( array('flaggedrevs','revision'),
12391243 'fr_quality',
12401244 array( 'fr_page_id' => $article->getTitle()->getArticleID(),
1241 - 'fr_rev_id = rev_id',
 1245+ 'rev_id = fr_rev_id',
 1246+ 'rev_page = fr_page_id',
12421247 'rev_deleted & '.Revision::DELETED_TEXT => 0 ),
12431248 __METHOD__,
12441249 array( 'ORDER BY' => 'fr_quality DESC', 'LIMIT' => 1 ) );

Status & tagging log