Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the safest way to convert table with InnoDB to MyISAM?

My database is currently using the InnoDB engine. Now I want to add the fulltext search feature, which is why I want to convert my tables to MyISAM. But doing so breaks all foreign keys. How can I change my table engines to MyISAM safely?

How can I use SELECT...JOIN after I change my tables to the MyISAM engine?

ALTER TABLE jobs ENGINE = MyISAM;
Cannot delete or update a parent row: a foreign key constraint fails
like image 225
hungneox Avatar asked Dec 19 '11 07:12

hungneox


People also ask

Should I use InnoDB or MyISAM?

The performance of InnoDB for large volumes of data is better as compared to MyISAM. MyISAM doesn't support transactional properties and is faster to read. As compared to InnoDB, the performance for a high volume of data is less.

Why is MyISAM faster than InnoDB?

MyISAM will out-perform InnoDB on large tables that require vastly more read activity versus write activity. MyISAM's readabilities outshine InnoDB because locking the entire table is quicker than figuring out which rows are locked in the table.

What is the main purpose of InnoDB over MyISAM?

A big reason to use InnoDB over MyISAM, is the lack of full table-level locking. This allows your queries to process faster.


2 Answers

I'd recommend you to do a dump of the db, change all the text from that file from InnoDB to MyISAM, then load the modified file

like image 126
Tudor Constantin Avatar answered Oct 13 '22 13:10

Tudor Constantin


As I know, MyISAM doesn't supports foreign keys (compare the features offered by InnoDB vs the features of MyISAM). MySQL tries to tell you that you have to drop every foreign key constraint that references your jobs table before changing its engine to MyISAM.

like image 24
Kohányi Róbert Avatar answered Oct 13 '22 14:10

Kohányi Róbert