mysql myISAM vs Innodb storage engines
InnoDB and MYISAM, are storage engines for MySQL.
These two differ on their locking implementation: InnoDB locks the particular row in the table, and MyISAM locks the entire MySQL table.
You can specify the type by giving MYISAM OR InnoDB while creating a table in DB.
The major deficiency of MyISAM is the absence of transactions support. Versions of MySQL 5.5 and greater have switched to the InnoDB engine to ensure referential integrity constraints, and higher concurrency.MyISAM | Innodb |
---|---|
Not ACID-compliant and non-transactional | ACID-compliant and hence fully transactional with ROLLBACK and COMMIT and support for Foreign Keys |
MySQL 5.0 default engine | Rackspace Cloud default engine |
Offers compression | Offers compression |
Requires full repair and rebuild of indexes and tables | Provides automatic recovery from crashes via the replay of logs |
Changed database pages written to disk instantly | Dirty pages converted from random to sequential before commit and flush to disk |
No ordering in storage of data | Row data stored in pages in PK order |
Table-level locking | Row-level locking |
When MyISAM tables are mostly useful
There can be several other reasons that fit your requirement for choosing the MyISAM engine. For example, reads can be faster on MyISAM, despite the general claims in the MySQL documentation, when a MyISAM table has a fixed (not dynamic) row size, for example, when it uses more CHARs then VARCHARs. Another reason why you might choose MyISAM over Innodb is because Innodb must perform additional checks because of ACID compliancy. For example, a FK check must be performed, which could potentially cause an operational overhead.
Comments
Post a Comment