r91219 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91218‎ | r91219 | r91220 >
Date:20:32, 30 June 2011
Author:aaron
Status:ok
Tags:
Comment:
* Follow-up r84397: make sure that mysql uses the job_id index even with the job_cmd clause
* Removed redundant 'LIMIT' option, already added by using selectRow()
Modified paths:
  • /trunk/phase3/includes/job/JobQueue.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/job/JobQueue.php
@@ -117,8 +117,12 @@
118118 }
119119 }
120120 $offset = intval( $offset );
121 - $row = $dbr->selectRow( 'job', '*', array_merge( $conditions, array( "job_id >= $offset" ) ) , __METHOD__,
122 - array( 'ORDER BY' => 'job_id', 'LIMIT' => 1 )
 121+ $options = array( 'ORDER BY' => 'job_id', 'USE INDEX' => 'PRIMARY' );
 122+
 123+ $row = $dbr->selectRow( 'job', '*',
 124+ array_merge( $conditions, array( "job_id >= $offset" ) ),
 125+ __METHOD__,
 126+ $options
123127 );
124128
125129 // Refetching without offset is needed as some of job IDs could have had delayed commits
@@ -126,8 +130,7 @@
127131 //
128132 if ( $row === false ) {
129133 if ( $offset != 0 ) {
130 - $row = $dbr->selectRow( 'job', '*', $conditions, __METHOD__,
131 - array( 'ORDER BY' => 'job_id', 'LIMIT' => 1 ) );
 134+ $row = $dbr->selectRow( 'job', '*', $conditions, __METHOD__, $options );
132135 }
133136
134137 if ( $row === false ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84397(bug 27336) Add $wgJobTypesExcludedFromDefaultQueue for job types that aren't...catrope16:52, 20 March 2011

Status & tagging log