Red Gate forums :: View topic - Amalgamate ALTER TABLE statements please
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
MySQL Compare
MySQL Compare forum

Amalgamate ALTER TABLE statements please

Search in MySQL Compare forum
Post new topic   Reply to topic
Jump to:  
Author Message
jodrell



Joined: 13 May 2010
Posts: 1
Location: Cambridge, UK

PostPosted: Thu May 13, 2010 9:28 am    Post subject: Amalgamate ALTER TABLE statements please Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
Lionel



Joined: 16 Dec 2005
Posts: 170

PostPosted: Thu May 13, 2010 6:42 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group