简体   繁体   中英

does InnoDB MySQL automatically use row-level locking?

I have a MySQL database that currently uses MyISAM but I am thinking of changing over to InnoDB, because it's quite high traffic and does a lot of writes to the same table, which causes slow loading times for visitors who then have to wait for each write to finish as the whole table is locked.

If I change to InnoDB, does it automatically use row-level locking instead of table-locking? Or are there any query modifications I have to make.

Thank you :)

It has auto row-level locking on write operations. It's better choice over MyIsam if you have more writes then reads. You haven't to change your queries. But you can make other alter method. If data that you you insert is not important to see immediately then you can stay on MyISam and use INSERT DELAYED approach. We used it in highload project and it works brilliant on very large tables.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM