Brent Baisley wrote:
Yes, that will lock up the table while the change is being made. One technique you can use is to rename the table and create a new to catch the incoming data.
RENAME TABLE x TO y;CREATE TABLE x LIKE y;

By putting both commands on 1 line, it will execute almost immediately.

If you create the new table first with a different name, then rename to swap the table names, it will be atomic (multi-table renames are atomic). So this would avoid the "almost immediately" above:

create table x like y;
rename table y to z, x to y;

Baron

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to