myisam 表类型真的更适合日志表(mysql)吗?
我一直在研究是否使用 myisam 还是 innodb 作为日志表(大量写入,很少读取)。虽然有些人说 myisam 总体上更快并且资源占用更少,但其他人说 myisam 实际上是更糟糕的选择,因为它只有表级锁定。
有人对这种情况有实际经验并愿意分享他们的建议吗?
提前致谢
i've been reading up whether to use myisam or innodb for a log table (lots of writes, very few reads). While some people say that myisam is overall faster and less resource-intensive, other people say that myisam would actually be the worse choice because it only has table-level locking.
Does anybody have actual experience with this situation and care to share their recommendation ?
thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您主要执行少量写入的操作,或者主要执行少量写入的查询,那么 MyISAM 非常适合。
我的猜测是,对于日志,您可能只执行几个查询,因此 MyISAM 可能是您的最佳选择,但如果日志在您的应用程序中频繁显示和过滤,那么您应该使用 InnoDB。
MyISAM is good if you are either doing mostly writes with just a few queries, or mostly queries with just a few writes.
My guess is that for a log you would probably be doing only a few queries so MyISAM may be the best choice for you, but if the log is being frequently displayed and filtered in your application then you should use InnoDB.