Home > Database > Mysql Tutorial > MySQL服务器创建临时文件数的配置_MySQL

MySQL服务器创建临时文件数的配置_MySQL

WBOY
Release: 2016-06-01 13:39:31
Original
1118 people have browsed it

bitsCN.com

 

MySQL服务器创建的临时文件的数量多少合适呢?下面就对MySQL服务器创建临时文件数的合理配置作详尽的分析讨论,供您参考。

  mysql

  >

  show global status like 'created_tmp%';

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

  | Variable_name | Value |

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

  | Created_tmp_disk_tables | 21197 |

  | Created_tmp_files | 58 |

  | Created_tmp_tables | 1771587 |

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

  每次创建临时表,Created_tmp_tables增加,如果是在磁盘上创建临时表,Created_tmp_disk_tables也增加,Created_tmp_files表示MySQL服务创建的临时文件文件数,比较理想的配置是:

  Created_tmp_disk_tables / Created_tmp_tables * 100%

  比如上面的服务器Created_tmp_disk_tables / Created_tmp_tables * 100% = 1.20%,应该相当好了。

  我们再看一下MySQL服务器对临时表的配置:

  mysql

  >

  show variables where Variable_name in (‘tmp_table_size', 'max_heap_table_size’);

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

  | Variable_name | Value |

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

  | max_heap_table_size | 268435456 |

  | tmp_table_size | 536870912 |

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

  只有256MB以下的临时表才能全部放内存,超过的就会用到硬盘临时表。

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template