恢复 MySQL 索引
我已经在一个 2 亿行的表上建立索引近 14 个小时了。由于机器上的资源过度消耗(由于单独的事件),机器兑现了。显然,我想避免再花 14 个小时来重新构建索引。有没有一种方法可以让我从机器崩溃的点(或稍微向后)恢复索引的构建?我可以看到创建的临时文件。
谢谢
I have been building index on a 200 million row table for almost 14 hours. Due to resource over-consumption on the machine (because of a separate incident), the machine cashed. Clearly, I want to avoid another 14 hours to re-construct the index. Is there a way that I can resume the construction of index from the point (or slightly back) where the machine crashed? I can see the temporary files created.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我猜你的首要任务不是完成工作 - 而是拥有一个工作数据库,最后包含未损坏的数据。所以你真的需要先尝试修复桌子。如果最后你得到了索引 - 那么就是结果。如果没有,那么您将需要重新开始构建索引 - 而且您并没有真正丢失任何东西。
14 小时是相当长的时间 - 你可以将表和索引拆分到单独的磁盘上吗?这次中断的成本是否足以证明花费几天时间重新配置硬件以更快地完成它是合理的?
C.
I would guess that your priority is not getting the job done - but in having a working database with your undamaged data in it at the end. So you really need to try to repair the table first. If at the end of that you've got the index - then result. If not, then you'll need to start building the index again - and you've not really lost anything.
14 hours is rather a long time though - can you split the table and index ontp seperate disks? Is this outage sufficiently expensive to justify spending a coujple days reconfiging your hardware to get it done quicker?
C.
我认为没有办法恢复索引创建,并且坦率地说,如果您的计算机崩溃了,则无法知道该临时文件是否包含有效数据或在崩溃中已损坏。
I don't think there is a way to resume the index creation and quite frankly, if your machine crashed, there is no way of knowing if that temporary file contains vaild data or has been corrupted in the crash.