From: Tim Starling Date: Mon, 25 Jul 2005 07:10:49 +0000 (+0000) Subject: live hack by Brion to improve performance X-Git-Tag: 1.5.0beta4~32 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/Special:BookSources/2753300917?a=commitdiff_plain;h=a7df0528815555d3f2a9e6beb8833b9ce3f37c92;p=lhc%2Fweb%2Fwiklou.git live hack by Brion to improve performance --- diff --git a/includes/Title.php b/includes/Title.php index f0a4c9d96f..33f728b780 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -490,6 +490,7 @@ class Title { $timestamp = $dbw->timestamp(); } $page = $dbw->tableName( 'page' ); + /* $sql = "UPDATE $page SET page_touched='{$timestamp}' WHERE page_id IN ("; $first = true; @@ -509,6 +510,18 @@ class Title { if ( ! $first ) { $dbw->query( $sql, 'Title::touchArray' ); } + */ + // hack hack hack -- brion 2005-07-11. this was unfriendly to db. + // do them in small chunks: + $fname = 'Title::touchArray'; + foreach( $titles as $title ) { + $dbw->update( 'page', + array( 'page_touched' => $timestamp ), + array( + 'page_namespace' => $title->getNamespace(), + 'page_title' => $title->getDBkey() ), + $fname ); + } } #----------------------------------------------------------------------------