The table 'xxxx' is full to set The temporary table size

Source: Internet
Author: User

Tmp_table_size

If the temporary table in the memory exceeds this value, MySQL automatically converts it to the MyISAM table on the hard disk. If you execute many advanced group by queries with a large amount of memory, you can increase the value of tmp_table_size.


Max_heap_table_size

This variable sets the maximum size of the MEMORY (HEAP) Table space that can be increased. This variable is used to calculate the MAX_ROWS value of the MEMORY table. Setting this variable on an existing memory table does not work unless you use the create table or truncate table statement to recreate the TABLE.


How to Set:
Method 1: modify my. ini or my. cnf
Tmp_table_size = 64 M
Max_heap_table_size = 32 M
The biggest disadvantage of this method is that, once mysql is restarted, everything is restored to the default value.

Method 2: mysqld command line
Mysqld_safe -- key_buffer_size = 512 K -- sort_buffer_size = 16 K
-- Tmp_table_size = 64 M -- max_heap_table_size = 32 M &

Method 3: Dynamic Modification
Because tmp_table_size and max_heap_table_size both have session scopes, do as much as possible.
Set session tmp_table_size = 64*1024*1024
Set session max_heap_table_size = 32*1024*1024

How to view the modified information:
View server configuration information
Show variables where Variable_name LIKE % tmp_table_size %

View server running information
SHOW STATUS

How to Use JDBC to obtain their values:
SELECT @ tmp_table_size
SELECT @ max_heap_table_size

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.