summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Install
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2013-01-07 21:11:53 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2013-01-07 21:11:53 +0100
commit9426b8ea72bfa4ea7725e5499107e5b283a1a76c (patch)
tree8d6c22ef4ff6624730b13a25702d17d118c15ad1 /Bugzilla/Install
parent292ad609ffad27232699a5c5db2b244a28881267 (diff)
downloadbugzilla-9426b8ea72bfa4ea7725e5499107e5b283a1a76c.tar.gz
bugzilla-9426b8ea72bfa4ea7725e5499107e5b283a1a76c.tar.xz
Bug 824361: Add an index on (bug_id, work_time) in the longdescs table to improve performance
r=dkl a=LpSolit
Diffstat (limited to 'Bugzilla/Install')
-rw-r--r--Bugzilla/Install/DB.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm
index e1a3f3630..cb7276fb9 100644
--- a/Bugzilla/Install/DB.pm
+++ b/Bugzilla/Install/DB.pm
@@ -705,6 +705,9 @@ sub update_table_definitions {
# 2012-12-29 reed@reedloden.com - Bug 785283
_add_password_salt_separator();
+ # 2013-01-02 LpSolit@gmail.com - Bug 824361
+ _fix_longdescs_indexes();
+
################################################################
# New --TABLE-- changes should go *** A B O V E *** this point #
################################################################
@@ -3734,6 +3737,15 @@ sub _fix_longdescs_primary_key {
}
}
+sub _fix_longdescs_indexes {
+ my $dbh = Bugzilla->dbh;
+ my $bug_id_idx = $dbh->bz_index_info('longdescs', 'longdescs_bug_id_idx');
+ if ($bug_id_idx && scalar @{$bug_id_idx->{'FIELDS'}} < 2) {
+ $dbh->bz_drop_index('longdescs', 'longdescs_bug_id_idx');
+ $dbh->bz_add_index('longdescs', 'longdescs_bug_id_idx', [qw(bug_id work_time)]);
+ }
+}
+
sub _fix_dependencies_dupes {
my $dbh = Bugzilla->dbh;
my $blocked_idx = $dbh->bz_index_info('dependencies', 'dependencies_blocked_idx');