| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Baron Schwartz | Date: | June 13 2007 6:35pm |
| Subject: | Re: Before I shoot myself in the foot... | ||
| View as plain text | |||
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
| Thread | ||
|---|---|---|
| • Before I shoot myself in the foot... | Brian Dunning | 13 Jun |
| • Re: Before I shoot myself in the foot... | Baron Schwartz | 13 Jun |
| • Re: Before I shoot myself in the foot... | Brent Baisley | 13 Jun |
| • Re: Before I shoot myself in the foot... | Brian Dunning | 13 Jun |
| • Re: Before I shoot myself in the foot... | Ananda Kumar | 14 Jun |
| • Re: Before I shoot myself in the foot... | Baron Schwartz | 14 Jun |
| • Re: Before I shoot myself in the foot... | Ananda Kumar | 14 Jun |
| • Re: Before I shoot myself in the foot... | Martijn Tonies | 14 Jun |
| • Re: Before I shoot myself in the foot... | Martijn Tonies | 14 Jun |
| • Re: Before I shoot myself in the foot... | Baron Schwartz | 13 Jun |
