Is there a way to immediately convert a large data table in the database to a partitioned table?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 有没有办法把数据库很大数据量的表立即改为分区表的?

| username: tidb狂热爱好者

Is there a way to immediately convert a large data table in the database to a partitioned table?

| username: ShawnYan | Original post link

To clarify the partition key, let’s look at the table structure first. Partitioning the table involves data replication, so we need to see what the primary key of the original table looks like.

| username: h5n1 | Original post link

Upgrade to 7.0, then exchange partition and reorganize.

| username: tidb菜鸟一只 | Original post link

This requires restructuring the underlying data storage, which definitely cannot take effect immediately. Whether it’s importing and exporting after creating a new partition table or using exchange partition and then reorganize, it essentially means storing the original table according to the new partition structure, which takes a considerable amount of time. The larger the table, the slower the process.

| username: Kongdom | Original post link

It should not take effect immediately.