MySQL:当内存表达到max_heap_table_size时该怎么办? [英] Mysql: what to do when memory tables reach max_heap_table_size?

查看:1068
本文介绍了MySQL:当内存表达到max_heap_table_size时该怎么办?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用mysql内存表作为一种方式来缓存多次读取的数据行.我选择此替代方法是因为我无法在解决方案中使用xcache或memcache. 阅读有关此内容的 mysql手册和论坛主题我得出的结论是,当表达到其最大内存大小时,将引发错误.我想知道是否有一种方法可以捕获此错误,以便截断表并释放内存.我不想提高可使用的内存限制,我需要一种自动释放内存的方法,以便表可以继续工作.

I'm using a mysql memory table as a way to cache data rows which are read several times. I chose this alternative because I'm not able to use xcache or memcache in my solution. After reading the mysql manual and forum about this topic I have concluded that an error will be raised when the table reaches its maximum memory size. I want to know if there is a way to catch this error in order to truncate the table and free the memory. I don't want to raise the limit of memory that can be used, I need a way to free the memory automatically so the table can continue working.

谢谢.

推荐答案

如果内存不足,引擎将引发错误1114并显示以下错误消息:

If you're out of memory, the engine will raise the error 1114 with the following error message:

The table 'table_name' is full

您应该在客户端捕获此错误,并从表中删除一些数据.

You should catch this error on the client side and delete some data from the table.

这篇关于MySQL:当内存表达到max_heap_table_size时该怎么办?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆