Hi Marko, Thank you for the ALTER TABLE … EXCHANGE PARTITION idea, but I don't think it has any chance to work. Even if I keep the same timestamps as partition limits, several “near to the boundary” rows in my new partition scheme are expected to not fall in the same partition as before. Regards, Gingko ------------------------------------------------------------------------ *De :* Marko Mäkelä [mailto:marko.makela@mariadb.com] *Envoyé :* lundi 5 août 2024 à 4:09 PM *Pour :* Gingko *Cc :* MariaDB discuss *Objet :* [MariaDB discuss] About partitioning change
[…] There is also a possibility to invoke ALTER TABLE … EXCHANGE PARTITION in order to convert each partition into a normal table and then to alter the table. That would seem to remove two full-copy steps while removing and adding partitioning. After converting each table (former partition), you'd create an empty partitioned table corresponding to the new PRIMARY KEY definition and EXCHANGE PARTITION from the individual tables again.
I am not deeply familiar with the partitioning code, and I did not test the above suggestion. From the storage engine point of view, each partition or subpartition is just a funnily named table, and ALTER TABLE…EXCHANGE PARTITION is just a RENAME TABLE.
[…] Best regards,
Marko