MySQL InnoDB 适合这种场景吗?
我的MySQL数据库包含多个MyISAM表,每个表包含数百万行。数据库上的插入负载很重,因此我无法在该实时数据库上发出 SELECT。相反,我创建数据库的副本用于查询并对其进行分析。
为了进行分析,我需要发出多个并行查询。这些查询是独立的(即,查询的结果不组合在一起),但它们大多数时候都在同一个表上操作。据我所知,每个查询都会锁定整个MyISAM表,这意味着并行独立查询会很慢。理想情况下,我更喜欢支持“NO LOCKING”的引擎。我假设 MySQL 没有这样的引擎,那么我应该使用 InnoDB 吗?我可能在这里遗漏了很多东西。请建议在这里采取什么是正确的路径。
谢谢
My MysQL database contains multiple MyISAM tables, with each table containing millions of rows. There is a heavy insert load on the database, so I cannot issue SELECTs on that live database. Instead, I create a replica of the database for queries and conduct analysis on that.
For the analysis, I need to issue multiple parallel queries. The queries are independent (i.e., the results of the queries are not combined together), but they operate on same tables most of the time. As far as I know, the entire MyISAM table is locked for each query, which means parallel independent queries would be slow. Ideally, I would prefer an engine that supports "NO LOCKING". I am assuming MySQL doesnt have such an engine, so should I use InnoDB? I might be missing lot of things here. Please suggest what is the right path to take here.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
MyISAM
读锁是兼容的,因此SELECT
查询不会互相锁定。如果您对副本数据库的分析查询不写入,只读取,那么使用
MyISAM
就可以了。MyISAM
read locks are compatible, so theSELECT
queries won't lock each other.If your analysis queries on the replica database don't write, only read, then it's OK to use
MyISAM
.您可以坚持使用 MyISAM 并使用
INSERT DELAYED
:
You could stick to MyISAM and use
INSERT DELAYED
: