MySQL Forums
Forum List  »  InnoDB

Re: Index re-creation after composite primary key change
Posted by: Jakub G
Date: November 03, 2012 07:45AM

Hi Rick, thank You very much for the help!

Rick James Wrote:
-------------------------------------------------------
> > So it won't lock the table and things like that...
> False. The recreate-and-swap is for safety. During the recreate, all the indexes will be rebuilt.
> It _may_ be the case that you can continue to _read_ the table during the ALTER. (I don't know.) Writes are definitely locked out.

Right. I was a bit unclear in the 'it won't lock the table' statement. What I meant was the information in the manual:

"In most cases, ALTER TABLE makes a temporary copy of the original table. MySQL waits for other operations that are modifying the table, then proceeds. It incorporates the alteration into the copy, deletes the original table, and renames the new one. While ALTER TABLE is executing, the original table is readable by other sessions. Updates and writes to the table that begin after the ALTER TABLE operation begins are stalled until the new table is ready, then are automatically redirected to the new table without any failed updates."


> > without impact on the performance?
> False. There will be a lot of disk I/O. This may or may not impact other activity.

Right, that's should be obvious for me...


Thanks again!



Edited 1 time(s). Last edit at 11/03/2012 07:46AM by Jakub G.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Index re-creation after composite primary key change
1190
November 03, 2012 07:45AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.