live hack by Brion to improve performance
authorTim Starling <tstarling@users.mediawiki.org>
Mon, 25 Jul 2005 07:10:49 +0000 (07:10 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Mon, 25 Jul 2005 07:10:49 +0000 (07:10 +0000)
includes/Title.php

index f0a4c9d..33f728b 100644 (file)
@@ -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 );
+               }
        }
 
 #----------------------------------------------------------------------------