Case: How To Clean Up Large Table

We have a large interface table with more than 12m records,  unfortunately, most of them are useless, we’d like to clean it up for performance optimization.
Delete useless data by ‘delete from ’  and subsequently shrink the table to lower the HWM?  It’s not a good choice. DBA hates that as delete clause would generate huge log, probably the operation would fail.
Truncate the table? I just can’t do that, some data couldn’t be eliminated now.
Here is the DBA’s suggestion:
Step 1: Select the useful data into a new table table_tmp;
Step 2:  rename the large table  table_origin to table_old;
Step 3:  rename table_tmp to table_origin. Now we have a much smaller table_origin with normal HWM.
Step 4:  Take care of the indices and the privileges;
Step 5:  ensure the table_origin  is healthy and then drop table_old;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值