From: Tim Starling Date: Mon, 22 Jan 2007 19:18:36 +0000 (+0000) Subject: In Special:Watchlist: do user/user talk page existence queries in a batch. User:... X-Git-Tag: 1.31.0-rc.0~54220 X-Git-Url: http://git.cyclocoop.org/%22.%24redirect_annul.%22?a=commitdiff_plain;h=e38ece33c5721343c54f66c1b988546bf661e0a7;p=lhc%2Fweb%2Fwiklou.git In Special:Watchlist: do user/user talk page existence queries in a batch. User::edits() queries are still a problem. --- diff --git a/includes/SpecialWatchlist.php b/includes/SpecialWatchlist.php index e75a66e80f..be28bc0c7e 100644 --- a/includes/SpecialWatchlist.php +++ b/includes/SpecialWatchlist.php @@ -352,6 +352,18 @@ function wfSpecialWatchlist( $par ) { /* End bottom header */ + /* Do link batch query */ + $linkBatch = new LinkBatch; + while ( $row = $dbr->fetchObject( $res ) ) { + $userNameUnderscored = str_replace( ' ', '_', $row->rc_user_text ); + if ( $row->rc_user != 0 ) { + $linkBatch->add( NS_USER, $userNameUnderscored ); + } + $linkBatch->add( NS_USER_TALK, $userNameUnderscored ); + } + $linkBatch->execute(); + $dbr->dataSeek( $res, 0 ); + $list = ChangesList::newFromUser( $wgUser ); $s = $list->beginRecentChangesList();