There's little point reading a row from the db if rev_parent_id != null, as the parent id has already been populated.
Added this as an extra condition, filtering on this after limiting to a relatively small batch should be ok (rev_parent_id isn't indexed)
Change-Id: I85b5813ab214869350c95f3bee58daca3e92eba0
$cond = "rev_id BETWEEN $blockStart AND $blockEnd";
$res = $db->select( 'revision',
array( 'rev_id', 'rev_page', 'rev_timestamp', 'rev_parent_id' ),
- $cond, __METHOD__ );
+ array( $cond, 'rev_parent_id' => null ), __METHOD__ );
# Go through and update rev_parent_id from these rows.
# Assume that the previous revision of the title was
# the original previous revision of the title when the