From e38ece33c5721343c54f66c1b988546bf661e0a7 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 22 Jan 2007 19:18:36 +0000 Subject: [PATCH] In Special:Watchlist: do user/user talk page existence queries in a batch. User::edits() queries are still a problem. --- includes/SpecialWatchlist.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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(); -- 2.20.1