Index: trunk/phase3/maintenance/archives/patch-archive-user-index.sql |
— | — | @@ -0,0 +1,4 @@ |
| 2 | +-- Adds a user,timestamp index to the archive table
|
| 3 | +-- Used for browsing deleted contributions and renames
|
| 4 | +ALTER TABLE /*$wgDBprefix*/archive
|
| 5 | + ADD INDEX usertext_timestamp ( ar_user_text , ar_timestamp )
|
Index: trunk/phase3/maintenance/updaters.inc |
— | — | @@ -76,8 +76,8 @@ |
77 | 77 | array( 'archive', 'ar_len', 'patch-ar_len.sql' ), |
78 | 78 | array( 'revision', 'rev_parent_id', 'patch-rev_parent_id.sql' ), |
79 | 79 | array( 'page_restrictions', 'pr_id', 'patch-page_restrictions_sortkey.sql' ), |
80 | | - array( 'ipblocks', 'ipb_block_email', 'patch-ipb_emailban.sql' ), |
81 | | - array( 'oldimage', 'oi_metadata', 'patch-oi_metadata.sql'), |
| 80 | + array( 'ipblocks', 'ipb_block_email', 'patch-ipb_emailban.sql' ), |
| 81 | + array( 'oldimage', 'oi_metadata', 'patch-oi_metadata.sql'), |
82 | 82 | ); |
83 | 83 | |
84 | 84 | function rename_table( $from, $to, $patch ) { |
— | — | @@ -221,6 +221,16 @@ |
222 | 222 | } |
223 | 223 | } |
224 | 224 | |
| 225 | +function do_archive_user_index() { |
| 226 | + global $wgDatabase; |
| 227 | + if( $wgDatabase->indexExists( 'archive', 'usertext_timestamp' ) ) { |
| 228 | + echo "...usertext,timestamp key on archive already exists.\n"; |
| 229 | + } else { |
| 230 | + echo "Adding usertext,timestamp key on archive table... "; |
| 231 | + dbsource( archive("patch-archive-user-index.sql"), $wgDatabase ); |
| 232 | + echo "ok\n"; |
| 233 | + } |
| 234 | +} |
225 | 235 | |
226 | 236 | function do_watchlist_update() { |
227 | 237 | global $wgDatabase; |
— | — | @@ -944,6 +954,8 @@ |
945 | 955 | do_categorylinks_indices_update(); flush(); |
946 | 956 | |
947 | 957 | do_restrictions_update(); flush (); |
| 958 | + |
| 959 | + do_archive_user_index(); flush (); |
948 | 960 | |
949 | 961 | echo "Deleting old default messages (this may take a long time!)..."; flush(); |
950 | 962 | deleteDefaultMessages(); |
— | — | @@ -1275,7 +1287,8 @@ |
1276 | 1288 | ); |
1277 | 1289 | |
1278 | 1290 | $newindexes = array( |
1279 | | - array("revision", "rev_text_id_idx", "patch-rev_text_id_idx.sql") |
| 1291 | + array("revision", "rev_text_id_idx", "patch-rev_text_id_idx.sql"), |
| 1292 | + array("archive", "usertext_timestamp", "patch-archive-user-index.sql"), |
1280 | 1293 | ); |
1281 | 1294 | |
1282 | 1295 | $newrules = array( |