A few days back we were given a MySQL database hosted in EC2 with
around 5TB data to move some of the tables to a new server.
The intention was to share the tables between 2 EC2
instances. Since AWS had the option to take online snapshots, the
plan was to take a snapshot, create a new machine with that
snapshot and drop the unwanted tables.So everything went as
planned until creating a new machine with the snapshot. The
real challenge was dropping the unwanted tables. It took
around 4 minutes to Drop a table whose size is 20GB. It
took 20 minutes to drop a 100GB table. The time kept on
increasing for larger tables. MySQL even went to “defunct” when
we killed the drop query and at times crashed. To track down this
issue we executed drop table in one session and checked the
processlist from another session that gave the below
output.
mysql> show processlist \G
*************************** 1. row …
[Read more]