Home >Database >Mysql Tutorial >用Partition Exchange(分区交换)卸载数据

用Partition Exchange(分区交换)卸载数据

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 17:15:421221browse

我们有个应用每天操作相关的一张核心表t_ms_mdeia_task,此表是按天来做的List分区,分区键为monthday,列值类似于lsquo;mmddrs

我们有个应用每天操作相关的一张核心表t_ms_mdeia_task,此表是按天来做的List分区,分区键为monthday,列值类似于‘mmdd’,共有366个分区。

每天的数据量在3千万以上,应用的要求是只保存31天,之前的全部迁移到历史表中,用于查询。也就是说每天要把31天前那一天的数据迁移到hist表里面,当然hist表也是分区的。

应用侧原先通过存储过程来大批量的进行删除和insert,对于这样的操作,而且过程搞的非常复杂且影响数据库性能。

看提交的的过程:

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn