We have a websites with hundreds of visitors every day and tens of thousands queries a day. So, some tables in the database are updated very rarely, some tables are updated few times a minute and some tables are updated ~10 times a seconds.
MyISAM uses table-level locking for updates and InnoDb uses row-level locking.
So, as I understand, for tables with frequent concurrent updates (several updates per second) it is better to make them InnoDb, and for other tables (if we don't need transactions and foreign keys of course) it is ok to be with MyISAM engine.
Am I right in my thoughts?

我们的网站每天有数百名访问者,每天有数万个查询。因此,数据库中的一些表很少更新,一些表每分钟更新几次,一些表更新〜每秒10次。 MyISAM使用表级锁定进行更新,InnoDb使用行级锁定。因此,据我了解,对于频繁并发更新的表(每秒多次更新),最好将它们设为InnoDb,对于其他表(如果我们当然不需要事务和外键),可以使用MyISAM引擎。我的想法是对的吗?

2 个解决方案

#1


6

MyISAM is faster for reads and writes, but not at the same time. In other words, if you need to do a lot of writes, it will be faster, but if you want to also have people reading at the same time the readers and the writers will block each other and you may have concurrency issues. You should use InnoDB in such scenarios, and most mysql gurus recommend using InnoDB by default anyway because it's considered more generally reliable than MyISAM, despite being slower under some use cases.

MyISAM读写速度更快,但不能同时读取和写入。换句话说,如果你需要做很多写操作,它会更快,但是如果你想让人同时阅读,读者和编写者会相互阻塞,你可能会遇到并发问题。您应该在这种情况下使用InnoDB,并且大多数mysql专家建议默认使用InnoDB,因为它被认为比MyISAM更可靠,尽管在某些用例下速度较慢。

更多相关文章

  1. 请问MySql 可以处理8千万条以上的记录吗, 速度有没SQL2000快?
  2. linux测试硬盘读写速度
  3. 网站速度慢及其解决方法
  4. mysql笔记02:source命令导入大数据速度慢优化
  5. 使用android的加速度计移动图像

随机推荐

  1. 对MVC进行数据验证详解
  2. C#中关于foreach遍历使用的深入理解
  3. 完美解决SqlDataReader指定转换无效
  4. C#连接FTP时路径出现问题的解决方法
  5. Asp.Net--详解Core的安装和介绍
  6. 有关.Net MVC长轮询的实现方法
  7. C#如何利用FileSystemWatcher控件实现的
  8. 有关MVC异常情况的相关处理
  9. C#编程如何获取电脑硬件信息的方法?
  10. 从零讲解.Net Core开发实现图片文件上传