* Wrap message page insertions in a transaction to speed up installation
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 22 Oct 2005 06:57:23 +0000 (06:57 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 22 Oct 2005 06:57:23 +0000 (06:57 +0000)
Testing 1.5 on my Mac w/ MySQL 5.0.13 this gets the message page setup down
to under a minute; fast enough that the browser doesn't time out. :P
Still too slow; bulk inserts would perhaps be an improvement.

RELEASE-NOTES
maintenance/InitialiseMessages.inc

index 41fbe94..bb8e79b 100644 (file)
@@ -161,6 +161,7 @@ fully support the editing toolbar, but was found to be too confusing.
 * Added a limit to the size of image files which can be thumbnailed
 * (bug 2981) Linktrail for Tamil (ta)
 * (bug 3722) Update of Arabic language (ar) Namespace changes
+* Wrap message page insertions in a transaction to speed up installation
 
 
 === Caveats ===
index 7544c91..afdc939 100755 (executable)
@@ -171,6 +171,9 @@ function initialiseMessagesReal( $overwrite = false, $messageArray = false ) {
        $talk = $wgContLang->getNsText( NS_TALK );
        $mwtalk = $wgContLang->getNsText( NS_MEDIAWIKI_TALK );
        
+       # Merge these into a single transaction for speed
+       $dbw->begin();
+
        # Process each message
        foreach ( $sortedArray as $key => $enMsg ) {
                if ( $key == '' ) {
@@ -211,6 +214,7 @@ function initialiseMessagesReal( $overwrite = false, $messageArray = false ) {
                        $article->updateRevisionOn( $dbw, $revision );
                }
        }
+       $dbw->commit();
 
        # Clear the relevant memcached key
        print 'Clearing message cache...';