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 |
1 | 7 | + native |
Index: trunk/phase3/maintenance/updaters.inc |
— | — | @@ -142,6 +142,7 @@ |
143 | 143 | array( 'do_populate_parent_id' ), |
144 | 144 | array( 'check_bin', 'protected_titles', 'pt_title', 'patch-pt_title-encoding.sql', ), |
145 | 145 | array( 'maybe_do_profiling_memory_update' ), |
| 146 | + array( 'do_filearchive_indices_update' ), |
146 | 147 | ); |
147 | 148 | |
148 | 149 | |
— | — | @@ -970,6 +971,7 @@ |
971 | 972 | !index_has_field('imagelinks', 'il_to', 'il_from')) |
972 | 973 | { |
973 | 974 | dbsource( archive( 'patch-backlinkindexes.sql' ) ); |
| 975 | + echo( "...backlinking indices updated\n" ); |
974 | 976 | } |
975 | 977 | } |
976 | 978 | |
— | — | @@ -978,9 +980,21 @@ |
979 | 981 | if (!index_has_field('categorylinks', 'cl_sortkey', 'cl_from')) |
980 | 982 | { |
981 | 983 | dbsource( archive( 'patch-categorylinksindex.sql' ) ); |
| 984 | + echo( "...categorylinks indices updated\n" ); |
982 | 985 | } |
983 | 986 | } |
984 | 987 | |
| 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 | + |
985 | 999 | function maybe_do_profiling_memory_update() { |
986 | 1000 | global $wgDatabase; |
987 | 1001 | if ( !$wgDatabase->tableExists( 'profiling' ) ) { |
Index: trunk/phase3/maintenance/tables.sql |
— | — | @@ -841,7 +841,7 @@ |
842 | 842 | INDEX (fa_name, fa_timestamp), -- pick out by image name |
843 | 843 | INDEX (fa_storage_group, fa_storage_key), -- pick out dupe files |
844 | 844 | 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 |
846 | 846 | |
847 | 847 | ) /*$wgDBTableOptions*/; |
848 | 848 | |