Reasonable configuration of the number of temporary files created on the MySQL server

Source: Internet
Author: User

How many temporary files can be created on the MySQL server? The following gives a detailed analysis and discussion on the reasonable configuration of the number of temporary files created on the MySQL server for your reference.

 
 
  1. mysql> show global status like 'created_tmp%';  
  2. +-------------------------+---------+  
  3. | Variable_name | Value |  
  4. +-------------------------+---------+  
  5. | Created_tmp_disk_tables | 21197 |  
  6. | Created_tmp_files | 58 |  
  7. | Created_tmp_tables | 1771587 |  
  8. +-------------------------+---------+ 

Created_tmp_tables is added each time you create a temporary table. If you create a temporary table on the disk, Created_tmp_disk_tables is added. Created_tmp_files indicates the number of temporary file files created by the MySQL service. The ideal configuration is:

 
 
  1. Created_tmp_disk_tables / Created_tmp_tables * 100%  

For example, the above server Created_tmp_disk_tables/Created_tmp_tables * 100% = 1.20% should be quite good. Let's take a look at the configuration of temporary tables on the MySQL server:

 
 
  1. mysql> show variables where Variable_name in ('tmp_table_size', 'max_heap_table_size');  
  2. +---------------------+-----------+  
  3. | Variable_name | Value |  
  4. +---------------------+-----------+  
  5. | max_heap_table_size | 268435456 |  
  6. | tmp_table_size | 536870912 |  
  7. +---------------------+-----------+ 

Only temporary tables smaller than MB can be fully stored in the memory. If the memory limit is exceeded, the temporary hard disk table will be used.
 

How to enable MySQL slow Query

Mysql multi-Table query implementation

Introduction to MySQL CONVERT Functions

Take you to understand mysql Variables

Provides you with an in-depth understanding of MySQL user permissions.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.