`
guoweimail
  • 浏览: 203465 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Mysql提速

 
阅读更多

 

因数据较大,导致执行速度慢,同事帮我优化一下,果然见效。

 

如图:

修改前:

处理了这么长时间还没处理完,看修改后的效果:如下图:

20s就处理完成。

 

修改步骤如下:

 

1、打开Mysql安装目录C:\Program Files\MySQL\MySQL Server 5.0\

 

2、修改了C:\Program Files\MySQL\MySQL Server 5.0\my.ini

 

3、innodb_flush_log_at_trx_commit=1

 

修改为

 

innodb_flush_log_at_trx_commit=0

 

一下是修改属性的注释:

 

 If set to 1, InnoDB will flush (fsync) the transaction logs to the

 disk at each commit, which offers full ACID behavior. If you are

 willing to compromise this safety, and you are running small

 transactions, you may set this to 0 or 2 to reduce disk I/O to the

 logs. Value 0 means that the log is only written to the log file and

 the log file flushed to disk approximately once per second. Value 2

 means the log is written to the log file at each commit, but the log

 file is only flushed to disk approximately once per second.

 

 是用google翻译了一下,大概意思

 

 如果设置为1,InnoDB将刷新(FSYNC)事务日志到

 磁盘在每一个承诺,它提供了完整的ACID行为。如果你是

 愿意妥协的安全,和您运行的是小

 交易,您可以设置为0或2,以减少磁盘的I / O的

 日志。值0意味着该日志只有写入日志文件,

 日志文件刷新到磁盘,约每秒一次。值2

 手段的日志将被写入日志文件在每次提交,但日志

 文件只有大约每秒一次刷新到磁盘。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics