From 2429c5daba37968dacb9b84e6eb671b057765fda Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Tue, 25 Mar 2008 03:47:21 +0000 Subject: 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 (module owner) a=mkanat --- Bugzilla/DB/Mysql.pm | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'Bugzilla/DB/Mysql.pm') 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 -- cgit v1.2.3-24-g4f1b