From: bugreport%peshkin.net <> Date: Tue, 12 Jul 2005 00:39:25 +0000 (+0000) Subject: Bug 299156: Reduce saniitycheck submitter_id time for large sites X-Git-Tag: bugzilla-2.20rc2~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=631f8109684b488b56c2a736129e50ea23153056;p=thirdparty%2Fbugzilla.git Bug 299156: Reduce saniitycheck submitter_id time for large sites Patch by Joel Peshkin r=mkanat, a=justdave --- diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm index 52d1b3212d..300a97b98c 100644 --- a/Bugzilla/DB/Schema.pm +++ b/Bugzilla/DB/Schema.pm @@ -310,7 +310,7 @@ use constant ABSTRACT_SCHEMA => { INDEXES => [ attachments_bug_id_idx => ['bug_id'], attachments_creation_ts_idx => ['creation_ts'], - attachments_submitter_id_idx => ['submitter_id'], + attachments_submitter_id_idx => ['submitter_id', 'bug_id'], ], }, diff --git a/checksetup.pl b/checksetup.pl index b5158ccb3a..ee2cd1e670 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -3770,8 +3770,6 @@ if ($emptygroupid) { } # 2005-02-12 bugreport@peshkin.net, bug 281787 -$dbh->bz_add_index('attachments', 'attachments_submitter_id_idx', - [qw(submitter_id)]); $dbh->bz_add_index('bugs_activity', 'bugs_activity_who_idx', [qw(who)]); # This lastdiffed change and these default changes are unrelated, @@ -3992,6 +3990,16 @@ AddGroup('editcomponents', 'Can create, destroy, and edit components.'); AddGroup('editkeywords', 'Can create, destroy, and edit keywords.'); AddGroup('admin', 'Administrators'); +# 2005-06-29 bugreport@peshkin.net, bug 299156 +if ($dbh->bz_index_info('attachments', 'attachments_submitter_id_idx') + && (scalar(@{$dbh->bz_index_info('attachments', + 'attachments_submitter_id_idx' + )->{FIELDS}}) < 2) + ) { + $dbh->bz_drop_index('attachments', 'attachments_submitter_id_idx'); +} +$dbh->bz_add_index('attachments', 'attachments_submitter_id_idx', + [qw(submitter_id bug_id)]); if (!GroupDoesExist("editbugs")) { my $id = AddGroup('editbugs', 'Can edit all bug fields.', ".*");