0
我有一個MySQL表,它的分區看起來如下MySQL的 - 分區之間移動數據又名重新分區
p2015h1 - Contains data where date < 2015-07-01 (Has data from 2016-06-01. Hence only month worth of data)
p2015h2 - Contains data where date < 2016-01-01
p2016h1 - Contains data where date < 2016-07-01
p2016h2 - Contains data where date < 2017-01-01
我想新的分區,以每季度基於如下 -
p0 - Contains data where date < 2015-10-01
p1 - Contains data where date < 2016-01-01
p2 - Contains data where date < 2016-04-01
p3 - Contains data where date < 2016-07-01
我開始通過重組第一個分區&執行下面的命令。一切順利。
alter table `table1` reorganize partition `p2015half1` into (partition `p0` values less than ('2015-10-01'));
現在,作爲現有的分區p2015h2
有包括高達2015-10-01
數據的數據,我怎麼可能動這部分進入分區p0
?當我繼續構建新的分區時,我需要對其他分區也做同樣的事情。
我曾嘗試在桌子上全面清除分區,但是,該表是數十億行的大小&因此操作將需要數天時間。發佈後,我將不得不重建分區,這將需要幾天。因此,我決定採取拆分分區的方法。
我被困在這個時間點。請在這裏完全欣賞任何指導。