Headshota
Headshota

Reputation: 21439

MyIsam engine transaction support

I was testing transaction support in innoDB tables, and just for the curriosity I tried to run the same transaction on MyIsam table, and surprisingly it worked. I am assuming that on myIsam table queries are executed one after another not in one atomic operation and I don't get any errors from START TRANSACTION and COMMIT and ROLLBACK operations. I am interested, is MyIsam engine just ignoring this operations or does it perform some actions?

Upvotes: 31

Views: 34815

Answers (2)

Mário Rodrigues
Mário Rodrigues

Reputation: 862

MyIsam tabels were not built for this. Not even in the 5+ versions. It only was meant to store data. It gives you no guarantee for transactions or data recovery. You should use InnoDB for this and, if needed, use MyIsam for replication purposes (it's faster to retrieve data with MyIsam tables since there's no cross-table checks).

You may read this post from MySQL http://forums.mysql.com/read.php?21,68686,69229#msg-69229

Upvotes: 4

Maxim Krizhanovsky
Maxim Krizhanovsky

Reputation: 26719

MyISAM effectively works in auto-commit mode (as it's not a transactional engine), and it just ignores the commit/rollback.

Actually storage engine is a different layer in the MySQL architecture, separated from the SQL parser, the SQL layer communicates to the storage engine with lower-level API, and that's the reason there is a common SQL and engines, supporting different subset of featured. You can see very high-level overview of the architecture here

Upvotes: 38

Related Questions