Andrew
Andrew

Reputation: 5213

Can I tell how long is left on an ALTER TABLE command?

On our primary MySQL server, it took 40 minutes to insert rows and re-enable keys on a particular table. On the slave, the ALTER TABLE ... ENABLE KEYS command has been running now for just over 100 minutes, which is very unusual. I'd like to kill it, but that will annoy the slave. Is there any way whatsoever to get a glimpse at how much longer this will take?

Upvotes: 2

Views: 951

Answers (2)

Dismissile
Dismissile

Reputation: 33071

No way to tell. Just have to wait it out.

Upvotes: 1

Kinexus
Kinexus

Reputation: 12904

There is no way to determine how much longer this will take. The command will copy all data to a temporary table, make the changes and then rename the copy to replace the original. You may well see 'Copy into temporary table' in the ProcessList, but this doesn't give any indication as to how much is left.

I also suggest that you do not kill the process and let it finish the operation.

Patience!

Upvotes: 3

Related Questions