问题
Possible Duplicate:
Should I always prefer MySQL InnoDB over MyISAM?
Under what conditions should InnoDB be used over MyISAM ? I've seen some MySQL optimization tests where MyISAM proves to be faster. All of my tables are MyISAM, so why should I switch to InnoDB?
回答1:
Pros & Cons of InnoDB & MyISAM -
- InnoDB recovers from a crash or other unexpected shutdown by replaying its logs.
- InnoDB can be run in a mode where it has lower reliability but in some cases higher performance.
- InnoDB automatically groups together multiple concurrent inserts and flushes them to disk at the same time.
- InnoDB flushes the transaction log after each transaction, greatly improving reliability.
- Unlike InnoDB, MyISAM has built-in full-text search
- MyISAM is still widely used in web applications as it has traditionally been perceived as faster than InnoDB in situations where most DB access is reads.
- While writing/updating data into a InnoDB table, only that particular row is locked, whereas in MyISAM the entire table is locked.
- InnoDB provides Full Transaction support.
回答2:
How about transactions and concurrent read/writes? Crash recovery is better as well. There are some features that are only available using MyISAM, like full text search, but unless you need these, I would go with InnoDB.
回答3:
Every update operation exclusivly locks table. And You can't select from this table at the same time with update.
回答4:
The creator of InnoDB - Heikki Tuuri, use th following email signature.
InnoDB - transactions, row level locking, and foreign keys for MySQL
来源:https://stackoverflow.com/questions/4246863/why-use-innodb-over-mysiam