Thanks for good explnation.
Some more questions: #1Does 'update' also create temporary table?
Definitely not. Otherwise if an Update changed a single row it would have to create a temporary table, and of course it doesn't do that. Boy, wouldn't that be slow.<bg>
One more thing to think about when using "Alter Table" is if you have a large table, it needs enough disk space to create a duplicate of the table (data) that you are altering . So if you have a 4gb table, you better have at least another 4gb free in your database directory.
#2What happend with old table after alter?
It is dropped if the "alter table" is successful and the temp table is renamed to the old table name.
Mike
From: mos <[EMAIL PROTECTED]>
To: "Mike Mapsnac" <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re: Kill "alter table" process? Date: Wed, 21 Jan 2004 19:12:07 -0600
At 05:34 PM 1/21/2004, you wrote:I run alter today on table with 380,000 records. 'Alter' was adding column to the table. It took 10 minutes and server load went up to 15.
"alter table info add column interactive_email enum('on','off') NOT NULL default 'on';"
Here comes my questions:
#1 If I kill the process after it was running for 5 minutes. Would it update some records and some records not?
#2 How dangerous is to stop alter?
#3 What is a good way to stop alter or update without damaging database?
Thanks
Mike,
"Alter" creates a copy of the table so stopping it in the middle won't hurt anything. If the Alter succeeds, it renames the new table to the old table name.
Mike
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
_________________________________________________________________ Learn how to choose, serve, and enjoy wine at Wine @ MSN. http://wine.msn.com/
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]