summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB/Mysql.pm
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2008-03-25 04:47:21 +0100
committermkanat%bugzilla.org <>2008-03-25 04:47:21 +0100
commit2429c5daba37968dacb9b84e6eb671b057765fda (patch)
tree5218a8c3da1a02d241d02c5b33572551cd98ce5e /Bugzilla/DB/Mysql.pm
parentd7f129889f6d9eb839c18c6bf820f86ec57a2cfe (diff)
downloadbugzilla-2429c5daba37968dacb9b84e6eb671b057765fda.tar.gz
bugzilla-2429c5daba37968dacb9b84e6eb671b057765fda.tar.xz
Bug 399370: Fulltext search with a LIKE on bugs.short_desc is too slow (make Bugzilla use a separate fulltext table)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> (module owner) a=mkanat
Diffstat (limited to 'Bugzilla/DB/Mysql.pm')
-rw-r--r--Bugzilla/DB/Mysql.pm20
1 files changed, 16 insertions, 4 deletions
diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm
index 2da0c44ea..0bd7b7d37 100644
--- a/Bugzilla/DB/Mysql.pm
+++ b/Bugzilla/DB/Mysql.pm
@@ -255,11 +255,11 @@ EOT
print "\nISAM->MyISAM table conversion done.\n\n";
}
- my $sd_index_deleted = 0;
+ my ($sd_index_deleted, $longdescs_index_deleted);
my @tables = $self->bz_table_list_real();
- # We want to convert the bugs table to MyISAM, but it's possible that
- # it has a fulltext index on it and this will fail unless we remove
- # the index.
+ # We want to convert tables to InnoDB, but it's possible that they have
+ # fulltext indexes on them, and conversation will fail unless we remove
+ # the indexes.
if (grep($_ eq 'bugs', @tables)) {
if ($self->bz_index_info_real('bugs', 'short_desc')) {
$self->bz_drop_index_raw('bugs', 'short_desc');
@@ -268,6 +268,13 @@ EOT
$self->bz_drop_index_raw('bugs', 'bugs_short_desc_idx');
$sd_index_deleted = 1; # Used for later schema cleanup.
}
+ if ($self->bz_index_info_real('longdescs', 'thetext')) {
+ $self->bz_drop_index_raw('longdescs', 'thetext');
+ }
+ if ($self->bz_index_info_real('longdescs', 'longdescs_thetext_idx')) {
+ $self->bz_drop_index_raw('longdescs', 'longdescs_thetext_idx');
+ $longdescs_index_deleted = 1; # For later schema cleanup.
+ }
}
# Upgrade tables from MyISAM to InnoDB
@@ -480,6 +487,11 @@ EOT
$self->_bz_real_schema->delete_index('bugs', 'bugs_short_desc_idx');
$self->_bz_store_real_schema;
}
+ if ($longdescs_index_deleted) {
+ $self->_bz_real_schema->delete_index('longdescs',
+ 'longdescs_thetext_idx');
+ $self->_bz_store_real_schema;
+ }
# The old timestamp fields need to be adjusted here instead of in
# checksetup. Otherwise the UPDATE statements inside of bz_add_column