From 20d563c288b46525223d79cd3c2d79c2cda7d822 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 22 Oct 2005 06:57:23 +0000 Subject: [PATCH] * Wrap message page insertions in a transaction to speed up installation 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 | 1 + maintenance/InitialiseMessages.inc | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 41fbe94718..bb8e79bef1 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/maintenance/InitialiseMessages.inc b/maintenance/InitialiseMessages.inc index 7544c9119a..afdc939818 100755 --- a/maintenance/InitialiseMessages.inc +++ b/maintenance/InitialiseMessages.inc @@ -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...'; -- 2.20.1