* Add user_text index to filearchives (for renames at least)

* Remove useless, incomplete, deleted_user index
This commit is contained in:
Aaron Schulz 2008-05-12 04:35:08 +00:00
parent fea4a5dfa8
commit bb81c98d44
3 changed files with 20 additions and 1 deletions

View file

@ -0,0 +1,5 @@
-- 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;

View file

@ -841,7 +841,7 @@ CREATE TABLE /*$wgDBprefix*/filearchive (
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*/;

View file

@ -142,6 +142,7 @@ $wgMysqlUpdates = array(
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' ),
);
@ -970,6 +971,7 @@ function do_backlinking_indices_update() {
!index_has_field('imagelinks', 'il_to', 'il_from'))
{
dbsource( archive( 'patch-backlinkindexes.sql' ) );
echo( "...backlinking indices updated\n" );
}
}
@ -978,6 +980,18 @@ function do_categorylinks_indices_update() {
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" );
}
}