Follow-up r86482: patch to add an index on user_email. Not a problem if this is...
authorHappy-melon <happy-melon@users.mediawiki.org>
Wed, 20 Apr 2011 15:33:04 +0000 (15:33 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Wed, 20 Apr 2011 15:33:04 +0000 (15:33 +0000)
includes/DefaultSettings.php
includes/installer/MysqlUpdater.php
includes/specials/SpecialPasswordReset.php
maintenance/archives/patch-user_email_index.sql [new file with mode: 0644]

index 6bc9437..bd6c733 100644 (file)
@@ -3012,7 +3012,7 @@ $wgLivePasswordStrengthChecks = false;
  */
 $wgPasswordResetRoutes = array(
        'username' => true,
-       'email' => false, // Warning: enabling this will be *very* slow on large wikis
+       'email' => false,
 );
 
 /**
index f9f212d..3ab4b92 100644 (file)
@@ -163,21 +163,22 @@ class MysqlUpdater extends DatabaseUpdater {
                        // 1.17
                        array( 'addTable', 'iwlinks',                           'patch-iwlinks.sql' ),
                        array( 'addIndex', 'iwlinks', 'iwl_prefix_title_from',  'patch-rename-iwl_prefix.sql' ),
-                       array( 'addField', 'updatelog', 'ul_value',              'patch-ul_value.sql' ),
+                       array( 'addField', 'updatelog',     'ul_value',         'patch-ul_value.sql' ),
                        array( 'addField', 'interwiki',     'iw_api',           'patch-iw_api_and_wikiid.sql' ),
-                       array( 'dropIndex', 'iwlinks', 'iwl_prefix',  'patch-kill-iwl_prefix.sql' ),
-                       array( 'dropIndex', 'iwlinks', 'iwl_prefix_from_title', 'patch-kill-iwl_pft.sql' ),
-                       array( 'addField', 'categorylinks', 'cl_collation', 'patch-categorylinks-better-collation.sql' ),
+                       array( 'dropIndex', 'iwlinks',      'iwl_prefix',       'patch-kill-iwl_prefix.sql' ),
+                       array( 'dropIndex', 'iwlinks',      'iwl_prefix_from_title', 'patch-kill-iwl_pft.sql' ),
+                       array( 'addField', 'categorylinks', 'cl_collation',     'patch-categorylinks-better-collation.sql' ),
                        array( 'doClFieldsUpdate' ),
                        array( 'doCollationUpdate' ),
                        array( 'addTable', 'msg_resource',                      'patch-msg_resource.sql' ),
                        array( 'addTable', 'module_deps',                       'patch-module_deps.sql' ),
-                       array( 'dropIndex', 'archive', 'ar_page_revid',         'patch-archive_kill_ar_page_revid.sql' ),
-                       array( 'addIndex', 'archive', 'ar_revid',               'patch-archive_ar_revid.sql' ),
+                       array( 'dropIndex', 'archive',      'ar_page_revid',    'patch-archive_kill_ar_page_revid.sql' ),
+                       array( 'addIndex', 'archive',       'ar_revid',         'patch-archive_ar_revid.sql' ),
                        array( 'doLangLinksLengthUpdate' ),
 
                        // 1.18
                        array( 'doUserNewTalkTimestampNotNull' ),
+                       array( 'addIndex', 'user',          'user_email',       'patch-user_email_index.sql' ),
                );
        }
 
index fe9d924..ee2b10b 100644 (file)
@@ -105,8 +105,6 @@ class SpecialPasswordReset extends FormSpecialPage {
                        && Sanitizer::validateEmail( $data['Email'] ) )
                {
                        $method = 'email';
-
-                       // FIXME: this is an unindexed query
                        $res = wfGetDB( DB_SLAVE )->select(
                                'user',
                                '*',
diff --git a/maintenance/archives/patch-user_email_index.sql b/maintenance/archives/patch-user_email_index.sql
new file mode 100644 (file)
index 0000000..7218c95
--- /dev/null
@@ -0,0 +1 @@
+ ALTER TABLE /*$wgDBprefix*/user ADD INDEX ( `user_email`, `user_name` );
\ No newline at end of file