MySQL【参数】sort_buffer_size

amber 3年前 3,159次点击 来自 mysql

  • 基础知识
  1. sort_buffer_size 是一个connection级参数,在每个connection需要buffer的时候,一次性分配的内存。

  2. sort_buffer_size 并不是越大越好,过大的设置+高并发可能会耗尽系统内存资源。

  3. On Linux, there are thresholds of 256KB and 2MB where larger values may significantly slow down memory allocation

image

如果您看到Sort_merge_passes每秒很多的 SHOW GLOBAL STATUS输出,则可以考虑增加该 sort_buffer_size值以加快速度,ORDER BY或者GROUP BY通过查询优化或改进的索引无法改善的操作。

  1. https://www.cnblogs.com/wajika/p/6481188.html

  2. https://imysql.cn/2008_09_27_deep_into_mysql_sort_buffer

  3. https://stackoverflow.com/questions/17928366/what-is-the-recommended-max-value-for-join-buffer-size-in-mysql

目前暂无回复

致力于搭建一个分享发现好玩东西的社区京ICP备15052899号-3

本站总访问量 | 本文总阅读量 | 本站总访客数