Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use InnoDB and MyISAM tables in ONE database?

Obviously both have their benefits. MyISAM is fast but may get currupted easily, InnoDB is slow but is more stable thanks to transactions and foreign keys. So it could be good to mix both engines in one database. If that's possible?

like image 453
openfrog Avatar asked Dec 28 '09 16:12

openfrog


People also ask

Which is better MyISAM or InnoDB?

InnoDB can be used for row level locking, that means it gives higher performance as compared to MyISAM. InnoDB can be used for both data and index for a large buffer pool. InnoDB can be used when we need better performance than MyISAM.

How do I know if my table is InnoDB or MyISAM?

Simply check the value of the Engine column in the returned dataset to know which engine the table is using. Show activity on this post. SELECT ENGINE FROM INFORMATION_SCHEMA. TABLES WHERE TABLE_NAME='your_table_name' AND TABLE_SCHEMA='your_database_name'; -- or use TABLE_SCHEMA=DATABASE() if you have a default one.

What is the difference between InnoDB and MyISAM database engine?

Overall, MyISAM is an older and less efficient storage engine than InnoDB. The most commonly noted differences between these two engines are as follows: InnoDB is more stable, faster, and easier to set up; it also supports transactions.

Is InnoDB faster than MySQL?

In terms of data queries (SELECT), InnoDB is the clear winner, but when it comes to database writes (INSERT and UPDATE), MyISAM is somewhat faster. However, the lower speed of InnoDB is more than compensated for by its transaction protocol.


1 Answers

REMEMBER! It's OK to mix table types in the same database! In fact it's recommended and frequently required. However, it is important to note that if you are having performance issues when joining the two types, try converting one to the other and see if that fixes it. This issue does not happen often but it has been reported.

Taken from MySQL - InnoDB vs MyISAM

like image 95
Anthony Forloney Avatar answered Oct 28 '22 05:10

Anthony Forloney