"rebuildrecentchanges" can be accelerated considerably.
I've tested the new version with the German database.
It yields exactly the same result as the old version
and is about 5 times faster.
(I know this improvement will be obsolete once the
table structure is changed so that the revisions table
contains the id of the previous revision. But who knows
when that'll happen. ;-)
de:Benutzer:El
$id = $obj2->cur_id;
$ct = $obj2->cur_timestamp;
$id = $obj2->cur_id;
$ct = $obj2->cur_timestamp;
+
+ $sql = "SELECT old_id FROM old WHERE old_namespace={$ns} " .
+ "AND old_title='{$title}' ORDER BY old_timestamp DESC";
+ $res2 = wfQuery( $sql, DB_WRITE );
+ $numRows = wfNumRows( $res2 );
- $sql = "SELECT old_id FROM old WHERE old_namespace={$ns} " .
- "AND old_title='{$title}' AND old_timestamp < '" .
- "{$obj->rc_timestamp}' ORDER BY old_timestamp DESC LIMIT 1";
- $res2 = wfQuery( $sql, DB_WRITE );
- if ( 0 != wfNumRows( $res2 ) ) {
+ if ( 0 != $numRows-- ) {
$obj2 = wfFetchObject( $res2 );
$sql = "UPDATE recentchanges SET rc_cur_id={$id},rc_cur_time=" .
$obj2 = wfFetchObject( $res2 );
$sql = "UPDATE recentchanges SET rc_cur_id={$id},rc_cur_time=" .