views:

48

answers:

1

Is it bad practice to create a mirrored table (MyISAM) of the records in an InnoDB table for the purposes of doing full-text searches? I figure this way I'm just searching a copy of the data and if anything happens to that data it's not as big of a deal because it can always be re-created. But, it just feels awkward.

(MyISAM is the only engine that supports full-text searching, but I need to use the foreign key constraints offered by InnoDB)

Should I avoid this?

A: 

first of all, have you considered using a good search indexer? for example lucene : http://lucene.apache.org/java/docs/ will speed up searches a lot as it builds its own index tables.

if you definitely want to use the inbuilt mysql full-text search, you could cut down the myisam table so that it just contains the text data you want to search and the primary key - and then retrieve the proper data from the normal innodb tables once you know the pkey. that would avoid duplication of the other data in the table.

oedo