如果磁盘上的可用空间很少,如何优化9GB的表? [英] How do I OPTIMIZE a 9GB table if the disk has very little free space?
问题描述
我在12GB的磁盘上有一个9GB的myisam表,具有5MB的可用空间.如何optimize
桌子?
I have a 9GB myisam table on a 12GB disk with 5MB free space. How do I optimize
the table?
问题是OPTIMIZE
可以通过将整个表复制到新文件来工作,因此我需要9GB的可用空间才能成功.
The problem is that OPTIMIZE
works by copying the whole table to a new file, therefore I would need 9GB of free space for this to succeed.
我唯一能想到的解决方案是
The only solution I can come up with is to
- 停止在桌子上写字
- 将表逻辑备份到另一台计算机
- 放下桌子
- 通过从另一台计算机上的备份还原来重新创建表
将来,我应该将表的大小限制为小于可用的可用空间.
And in the future I should limit the table size to be smaller than available free space.
我回答了我的问题还是有更好的解决方案? 谢谢.
Did I answer my question or is there a better solution? Thanks.
推荐答案
删除索引并手动或通过查询将其还原.这与OPTIMIZE操作相同.
Drop indexes and restore them manually or by query. This is same with OPTIMIZE operation.
这篇关于如果磁盘上的可用空间很少,如何优化9GB的表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!