tmp_table_size
时间: 2023-07-24 17:56:34 浏览: 65
The `tmp_table_size` is a configuration parameter in MySQL that determines the maximum size of internal temporary tables in memory. When a query requires a temporary table, MySQL will attempt to create it in memory if its size is within the limits specified by `tmp_table_size`. If the table exceeds this size, it will be automatically converted to an on-disk temporary table instead.
By default, the value of `tmp_table_size` is set to the maximum allowed value for your MySQL version. However, it's recommended to adjust this parameter based on your specific workload and available system resources.
If you frequently encounter large temporary tables, you may consider increasing the value of `tmp_table_size` to allow for more in-memory creations. This can potentially improve performance by reducing disk I/O operations. However, bear in mind that increasing this value will consume more memory, so ensure that you have enough available memory to accommodate the larger temporary tables.
You can modify the `tmp_table_size` parameter in the MySQL configuration file (`my.cnf` or `my.ini`). Look for the `[mysqld]` section and add or modify the following line:
```
tmp_table_size = <desired_size>
```
Replace `<desired_size>` with the desired value, specified in bytes (e.g., 64M for 64 megabytes). After making the changes, restart the MySQL server for the new configuration to take effect.
Remember to monitor your server's memory usage and performance after adjusting the `tmp_table_size` parameter to ensure it doesn't cause any adverse effects.
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)