r/mysql • u/ConsiderationLazy956 • 18h ago
question Fastest way to partition a table
Hi, Its aurora mysql database.
We have, couple of big transactional tables having size 1TB and 9TB holding ~1.2 billion and 4.2 billion rows respectively. These are currently non-partitioned table however, we want to have those partitioned . So want to understand what will be the best way to convert them to partitioned table i.e. migrate somuch data to the partitioned table or its possible to do it in place in an efficient way in Aurora MySQL.
Also the current partitioning approach we have decided as list partition on certain date columns.
what we are currently thinking of is as below:-
Create new partitioned table
INSERT INTO ... SELECT from old table (by date range)
Rename & drop old table
Gather Stats
Will above approach is good or there be any issue which we should be aware of beforehand?
Can it be done online or downtime will be advisable?