r34637 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r34636‎ | r34637 | r34638 >
Date:04:35, 12 May 2008
Author:aaron
Status:old
Tags:
Comment:
* Add user_text index to filearchives (for renames at least)
* Remove useless, incomplete, deleted_user index
Modified paths:
  • /trunk/phase3/maintenance/archives/patch-filearhive-user-index.sql (added) (history)
  • /trunk/phase3/maintenance/tables.sql (modified) (history)
  • /trunk/phase3/maintenance/updaters.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/archives/patch-filearhive-user-index.sql
@@ -0,0 +1,5 @@
 2+-- Adding index to sort by uploader
 3+ALTER TABLE /*$wgDBprefix*/filearchive
 4+ ADD INDEX fa_user_timestamp (fa_user_text,fa_timestamp),
 5+ -- Remove useless, incomplete index
 6+ DROP INDEX fa_deleted_user;
Property changes on: trunk/phase3/maintenance/archives/patch-filearhive-user-index.sql
___________________________________________________________________
Added: svn:eol-style
17 + native
Index: trunk/phase3/maintenance/updaters.inc
@@ -142,6 +142,7 @@
143143 array( 'do_populate_parent_id' ),
144144 array( 'check_bin', 'protected_titles', 'pt_title', 'patch-pt_title-encoding.sql', ),
145145 array( 'maybe_do_profiling_memory_update' ),
 146+ array( 'do_filearchive_indices_update' ),
146147 );
147148
148149
@@ -970,6 +971,7 @@
971972 !index_has_field('imagelinks', 'il_to', 'il_from'))
972973 {
973974 dbsource( archive( 'patch-backlinkindexes.sql' ) );
 975+ echo( "...backlinking indices updated\n" );
974976 }
975977 }
976978
@@ -978,9 +980,21 @@
979981 if (!index_has_field('categorylinks', 'cl_sortkey', 'cl_from'))
980982 {
981983 dbsource( archive( 'patch-categorylinksindex.sql' ) );
 984+ echo( "...categorylinks indices updated\n" );
982985 }
983986 }
984987
 988+function do_filearchive_indices_update() {
 989+ global $wgDatabase;
 990+ echo( "Checking filearchive indices...\n" );
 991+ $info = $wgDatabase->indexInfo( 'filearchive', 'fa_user_timestamp', __METHOD__ );
 992+ if ( !$info )
 993+ {
 994+ dbsource( archive( 'patch-filearhive-user-index.sql' ) );
 995+ echo( "...filearchive indices updated\n" );
 996+ }
 997+}
 998+
985999 function maybe_do_profiling_memory_update() {
9861000 global $wgDatabase;
9871001 if ( !$wgDatabase->tableExists( 'profiling' ) ) {
Index: trunk/phase3/maintenance/tables.sql
@@ -841,7 +841,7 @@
842842 INDEX (fa_name, fa_timestamp), -- pick out by image name
843843 INDEX (fa_storage_group, fa_storage_key), -- pick out dupe files
844844 INDEX (fa_deleted_timestamp), -- sort by deletion time
845 - INDEX (fa_deleted_user) -- sort by deleter
 845+ INDEX fa_user_timestamp (fa_user_text,fa_timestamp) -- sort by uploader
846846
847847 ) /*$wgDBTableOptions*/;
848848

Status & tagging log