[…]
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