innodb_sort_buffer_size手册

简介:

说明

在创建InnoDB索引时用于指定对数据排序的排序缓冲区的大小。利用这块内存把数据读进来进行内部排序然后写入磁盘。这个参数只会在创建索引的过程中被使用,不会用在后面的维护操作;在索引创建完毕后innodb_sort_buffer会被释放。
这个值也控制了在执行online DDL期间DML产生的临时日志文件。
默认 1048576 bytes (1MB).
对于一个典型的排序操作来说,可以用下面的公式评估它消耗的内存:

(6 /*FTS_NUM_AUX_INDEX*/ * (3*@@GLOBAL.innodb_sort_buffer_size)
+ 2 * number_of_partitions * number_of_secondary_indexes_created
* (@@GLOBAL.innodb_sort_buffer_size/dict_index_get_min_size(index)*/)
* 8 /*64-bit sizeof *buf->tuples*/")

@@GLOBAL.innodb_sort_buffer_size/dict_index_get_min_size(index) indicates the maximum tuples held. 2 (@@GLOBAL.innodb_sort_buffer_size/dict_index_get_min_size(index)/) 8 /64-bit size of buf->tuples*/ indicates auxiliary pointers allocated.

对于在全文索引上的并行排序,需要再*innodb_ft_sort_pll_degree:

(6 /*FTS_NUM_AUX_INDEX*/ * @@GLOBAL.innodb_ft_sort_pll_degree)

参考:

https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_sort_buffer_size

相关文章
|
8月前
|
缓存 关系型数据库 MySQL
MySQL数据库——InnoDB引擎-架构-内存结构(Buffer Pool、Change Buffer、Adaptive Hash Index、Log Buffer)
MySQL数据库——InnoDB引擎-架构-内存结构(Buffer Pool、Change Buffer、Adaptive Hash Index、Log Buffer)
138 3
|
缓存 关系型数据库 MySQL
【MySQL】sort_buffer_size=256kb,是干什么的?底层原理是什么?
【MySQL】sort_buffer_size=256kb,是干什么的?底层原理是什么?
600 0
|
6月前
|
数据库 关系型数据库 MySQL
innodb_buffer_pool_size
【8月更文挑战第13天】
61 1
|
存储 缓存 关系型数据库
【MySQL】myisam_sort_buffer_size=32M,是干什么的?底层原理是什么?
【MySQL】myisam_sort_buffer_size=32M,是干什么的?底层原理是什么?
629 0
|
存储 关系型数据库 MySQL
【MySQL】sort_buffer_size=128M,是干什么的?底层原理是什么?
【MySQL】sort_buffer_size=128M,是干什么的?底层原理是什么?
509 0
|
存储 关系型数据库 MySQL
【MySQL】myisam_max_sort_file_size=64G,是干什么的?底层原理是什么?
【MySQL】myisam_max_sort_file_size=64G,是干什么的?底层原理是什么?
744 0
|
缓存 Oracle 关系型数据库
Ask Hoegh(5)——buffer cache和buffer有什么区别?
问: Oracle数据库的SGA包含db block buffer cache和redo buffer等组件,那么,同样属于内存,buffer cache和buffer有区别吗? 答:首先我们对比一下db block buffer cache和redo buffer的概念和功能。
1194 0

热门文章

最新文章