Alex Rivera | Logout

mysql "drop database" takes time -- why?

Asked 2008-09-29T18:42:14.657
12

mysql5.0 with a pair of databases "A" and "B", both with large innodb tables. "drop database A;" freezes database "B" for a couple minutes. Nothing is using "A" at that point, so why is this such an intensive operation?

Bonus points: Given that we use "A", upload data into "B", and then switch to using "B", how can we do this faster? Dropping databases isn't the sort of thing one typically has to do all the time, so this is a bit off the charts.

Edit
Report

1 Answer

6

By default, all innodb databases in a given mysql server installation use the same physical pool of data files, so conceivably "drop database A" could affect database B. Since "drop database" is likely to involve heavy reorgainsing of the innodb data files, it's conceivable that it's a blocking operation, either because of the intensity of the operation, or by design.

However, I think you can make each database use different physical files, although I haven't tried that myself, so you'll have to figure out the specifics for yourself. Failing that, then you may need to use two different mysql installs side-by-side on the same machine, which is perfectly doable.

answered 2008-09-29T18:52:47.283

Your Answer