Home>

Configuration for 16g memory

tmp_table_size=64m

First talktmp_table_sizeRight:

It specifies the maximum value of the internal memory temporary table,Each thread is allocated.(What is actually limiting is the minimum of tmp_table_size and max_heap_table_size.) If the memory temporary table exceeds the limit,MySQL will automatically convert it into a disk-based myisam table, stored in the specified tmpdir directory, default:

mysql>show variables like "tmpdir";

+ --------------- + ------- +

| variable_name | value |

+ --------------- + ------- +

| tmpdir |/tmp/|

+ --------------- + ------- +

When optimizing query statements,To avoid using temporary tables,If it ca n’t be avoided,Make sure that these temporary tables are stored in memory.If needed and you have a lot of group by statements and you have a lot of memory,Increase the value of tmp_table_size (and max_heap_table_size). This variable does not apply to user-created memory tables.

You can compare the total number of internal disk-based temporary tables with the total number of temporary tables created in memory (created_tmp_disk_tables and created_tmp_tables). The general ratio is

created_tmp_disk_tables/created_tmp_tables<5%

max_heap_table_size

This variable defines the size of the memory table that the user can create. This value is used to calculate the maximum number of rows in the memory table.This variable supports dynamic changes,I.e. [email protected]_heap_table_size=#

, But it is not useful for existing memory tables,Unless the table is recreated or altered or truncate table. The service restart will also set the existing memory table to the global max_heap_table_size value.

This variable, together with tmp_table_size, limits the size of the internal memory table.

  • Previous jQuery Easyui verify that two passwords are entered equal
  • Next asp knowledge finishing notes 2 (question and answer mode)