--- /dev/null
+-- Adding index to sort by uploader
+ALTER TABLE /*$wgDBprefix*/filearchive
+ ADD INDEX fa_user_timestamp (fa_user_text,fa_timestamp),
+ -- Remove useless, incomplete index
+ DROP INDEX fa_deleted_user;
INDEX (fa_name, fa_timestamp), -- pick out by image name
INDEX (fa_storage_group, fa_storage_key), -- pick out dupe files
INDEX (fa_deleted_timestamp), -- sort by deletion time
- INDEX (fa_deleted_user) -- sort by deleter
+ INDEX fa_user_timestamp (fa_user_text,fa_timestamp) -- sort by uploader
) /*$wgDBTableOptions*/;
array( 'do_populate_parent_id' ),
array( 'check_bin', 'protected_titles', 'pt_title', 'patch-pt_title-encoding.sql', ),
array( 'maybe_do_profiling_memory_update' ),
+ array( 'do_filearchive_indices_update' ),
);
!index_has_field('imagelinks', 'il_to', 'il_from'))
{
dbsource( archive( 'patch-backlinkindexes.sql' ) );
+ echo( "...backlinking indices updated\n" );
}
}
if (!index_has_field('categorylinks', 'cl_sortkey', 'cl_from'))
{
dbsource( archive( 'patch-categorylinksindex.sql' ) );
+ echo( "...categorylinks indices updated\n" );
+ }
+}
+
+function do_filearchive_indices_update() {
+ global $wgDatabase;
+ echo( "Checking filearchive indices...\n" );
+ $info = $wgDatabase->indexInfo( 'filearchive', 'fa_user_timestamp', __METHOD__ );
+ if ( !$info )
+ {
+ dbsource( archive( 'patch-filearhive-user-index.sql' ) );
+ echo( "...filearchive indices updated\n" );
}
}