Amalgamate ALTER TABLE statements please

Compares and synchronizes MySQL database schemas.

Moderators: Chris Auckland, eddie davis, Michael Christofides

Amalgamate ALTER TABLE statements please

Postby jodrell » Thu May 13, 2010 9:28 am

I've just downloaded MySQL Compare and tried it on a DB upgrade that we're about to perform. I've got to spend some more time checking to see if anything is missing or different but my first impression is that each table change appears to be in a single statement.

For example one of my tables has 2 columns being removed, 3 added, 2 keys added and one foreign key added. Each of these is listed in the change script as separate ALTER TABLE statement.

This particular table will take around 4 minutes to perform a single ALTER TABLE command meaning the total time would be almost half an hour. If they were joined together into a single statement everything could be done in 4 minutes.
jodrell
 
Posts: 1
Joined: Thu May 13, 2010 9:21 am
Location: Cambridge, UK

Postby Lionel » Thu May 13, 2010 6:42 pm

Thanks a lot for the feedback. You're correct that those statements should definitely be amalgamated together. Sorry, I didn't read the docs for the alter statement carefully enough so I didn't realise you could do that. I will fix that and hopefully put it in the new EAP.

Lionel
Software Engineer
Red Gate Software
Lionel
 
Posts: 155
Joined: Fri Dec 16, 2005 11:09 am


Return to MySQL Compare

Who is online

Users browsing this forum: No registered users and 0 guests