MySQL buffer类参数

bulk_insert_buffer_size
myisam引擎参数,在使用myisam引擎执行INSERT ... SELECT,INSERT ... VALUES (...), (...), ...,LOAD DATA INFILE批量插入时,会采用一种缓存树的内存结构来优化插入速度。
bulk_insert_buffer_size来设置myisam每个线程的缓存树内存大小,默认值是8M,设为0表示关闭myisam对批量插入的优化。
MySQL buffer类参数

innodb_log_buffer_size
redo buffer大小
MySQL buffer类参数

innodb_sort_buffer_size
定义创建索引时用于索引值排序的buffer大小,也定义了online DDL执行时用于存储并发DML的临时日志文件大小,最大可以扩展至innodb_online_alter_log_max_size。
MySQL buffer类参数

join_buffer_size
定义每个线程用于范围索引扫描或用不到索引的表关联的buffer大小。每两个表join就需要分配一个join buffer,例如多表关联,则需要分配多个join buffer。
MySQL buffer类参数

key_buffer_size
myisam用于缓存索引数据的buffer大小,如果myisam是主要的引擎,一般建议是OS内存的25%,myisam需要依赖操作系统缓存来读取数据,需要给OS预留足够的内存做cache。
MySQL buffer类参数

myisam_sort_buffer_size
myisam创建索引或修复表时的排序buffer大小
MySQL buffer类参数

net_buffer_length
每一个用户线程,都有对应的连接buffer和结果集buffer,均以net_buffer_length为初始大小,但可以按需扩展至max_allowed_packet。默认是16K。
MySQL buffer类参数

read_buffer_size
每个线程在顺序读取一个myisam表时会分配一个以read_buffer_size大小的buffer,read_buffer_size需要是4K的倍数。
This option is also used in the following context for all storage engines:
• For caching the indexes in a temporary file (not a temporary table), when sorting rows for ORDER
BY.
• For bulk insert into partitions.
• For caching results of nested queries.
MySQL buffer类参数

read_rnd_buffer_size
用于优化MRR的buffer大小。
MySQL buffer类参数

sort_buffer_size
order by,group by排序buffer的大小,每个线程需要排序时会分配该buffer。当sort_merge_passes每秒数值很大,应该增大sort_buffer_size,减少排序合并的次数。
MySQL buffer类参数

sql_buffer_result
如果设为1,select语句的结果集会缓存到一个临时表,有助于更早地释放表上的锁,尤其是需要花费大量时间来发送结果集到客户端的情况。默认是0,关闭该功能。
MySQL buffer类参数