简体   繁体   中英

Adding partition to already partitioned table by not touching existing partition data

I want to add new partitions to already partitioned table, this is straight forward if we use REORGANIZE as it's answered here , but in my case, I have huge data in p_max partition which is taking forever to REORGANIZE.

So, I want to add new partitions to the already partitioned table without REORGANIZING the current p_max partition so that new partitions get added instantly.

在此处输入图像描述

Simple: always have p_max empty. I like to call it future . Then, just before you need p_3 , split future into p_3 and future . With no data in that partition, it is fast.

Details: http://mysql.rjweb.org/doc.php/partitionmaint#high_level_view_of_the_code

The "Why": http://mysql.rjweb.org/doc.php/partitionmaint#why _

(Both are in the same treatise on MySQL Partitioning.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM