From a7df0528815555d3f2a9e6beb8833b9ce3f37c92 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 25 Jul 2005 07:10:49 +0000 Subject: [PATCH] live hack by Brion to improve performance --- includes/Title.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 ); + } } #---------------------------------------------------------------------------- -- 2.20.1