MySQL user created temporary table is full

删除回忆录丶 提交于 2019-12-04 04:56:09

max_heap_table_size is a limit on the size of any table (temporary or otherwise) that uses the MEMORY storage engine. You'll have to increase this config option to store more data in the table.

In MySQL, by default, the temp tables created with the memory engine can quickly grow beyond the 16mb limit of max-heap-table-size and tmp-table-size because more memory is allocated per row than is usually required. In the example you provided, the VARCHAR(400) will allocate memory based upon the maximum string size, not the actual size of your data. Each character may require more than 1 byte for storage. Suppose each row requires 2kb, then it only takes 8k rows to reach the limit.

For many applications, this issue can be addressed by using ROW_FORMAT=DYNAMIC as explained here:

http://www.percona.com/doc/percona-server/5.5/flexibility/improved_memory_engine.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!