如何确定 MySQL 中的最大事务大小? [英] How do I determine maximum transaction size in MySQL?

查看:29
本文介绍了如何确定 MySQL 中的最大事务大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此处看到了为 PostgreSQL 提出的相同问题;想知道是否有人知道 (a) 响应的 MySQL 风格和 (b) 我会检查哪些 MySQL 选项来确定/影响答案.

Saw the same question posited for PostgreSQL here; wondering if anyone knows (a) the MySQL flavour of the response and (b) which MySQL options I would examine to determine/influence the answer.

顺便说一句,我不需要绝对的答案,但是如果我提议插入 200,000 行,每行约 2Kb,您会认为这非常简单,还是稍微突破一下限制?

I don't need an absolute answer btw, but if I were to propose inserting, say, 200,000 rows of ~2Kb each would you consider that very straightforward, or pushing the limit a bit?

假设 MySQL 运行在一个配置良好的 Linux 机器上,它有 4Gb 的 RAM、大量的磁盘空间和一个由通常知道自己在做什么的人调整的实例!

Assume MySQL is running on a well specced Linux box with 4Gb of RAM, shedloads of disk space, and an instance tuned by someone who generally knows what they're doing!

干杯

布莱恩

推荐答案

对于 Innodb,事务大小将受到重做日志 (ib_logfile*) 大小的限制,因此如果您计划提交非常大的事务,请确保您设置innodb_log_file_size=256M 或更多.缺点是在崩溃的情况下需要更长的时间来恢复.

For Innodb the transaction size will be limited by the size of the redo log (ib_logfile*), so if you plan to commit very large transactions make sure you set innodb_log_file_size=256M or more. The drawback is that it will take longer to recover in case of crash.

但为了记录,Innobase 员工建议您保持交易简短

But for the record Innobase employees recommend keeping you transactions short

这篇关于如何确定 MySQL 中的最大事务大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆