myisam

编程入门 行业动态 更新时间:2024-10-11 19:16:48
本文介绍了myisam_sort_buffer_size与sort_buffer_size的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是具有6GB RAM的服务器上的MySQL.我需要知道myisam_sort_buffer_size和sort_buffer_size有什么区别吗?

I am MySQL on server with 6GB RAM. I need to know what is the difference between myisam_sort_buffer_size and sort_buffer_size?

我为他们设置了以下尺寸:

I have following size set to them:

myisam_sort_buffer_size = 8M

myisam_sort_buffer_size = 8M

sort_buffer_size = 256M

sort_buffer_size = 256M

请还提及这些值是否合适或需要调整?

Please also mention if these values are fine or need adjustments?

谢谢

推荐答案

sort_buffer_size:

MySQL文档:

每个需要进行排序的会话都会分配一个该大小的缓冲区. sort_buffer_size并非特定于任何存储引擎,而是以一般方式进行优化.

Each session that needs to do a sort allocates a buffer of this size. sort_buffer_size is not specific to any storage engine and applies in a general manner for optimization.

您的sort_buffer_size值似乎很高.默认值为2M.我建议不要超过此值,因为提高性能会降低性能. 有人建议使用较小的值,例如256kB.要记住的一件事是,这是每个客户端会话,不是全局值.较大的值将快速累加.

Your sort_buffer_size value seems extremely high. The default is 2M. I'd recommend going no larger than that since there is a performance penalty for going higher. Some people recommend smaller values such as 256kB. One thing to remember is this is per-client-session, it's not a global value. Large values will add up fast.

myisam_sort_buffer_size:

MySQL文档:

在REPAIR TABLE期间对MyISAM索引排序或使用CREATE INDEX或ALTER TABLE创建索引时分配的缓冲区大小.

The size of the buffer that is allocated when sorting MyISAM indexes during a REPAIR TABLE or when creating indexes with CREATE INDEX or ALTER TABLE.

您的myisam_sort_buffer_size看起来不错.除非您要使用ALTER TABLE或REPAIR TABLE等重建索引,否则这将无关紧要.

Your myisam_sort_buffer_size seems fine. This won't be relevant unless you are rebuilding indexes using ALTER TABLE or REPAIR TABLE etc.

更多推荐

myisam

本文发布于:2023-10-28 10:28:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1536382.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:myisam

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!