Re: Kill "alter table" process?
At 09:04 PM 1/21/2004, you wrote: 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. 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]
Re: Kill "alter table" process?
Thanks for good explnation. Some more questions: #1Does 'update' also create temporary table? #2What happend with old table after alter? 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]
Re: Kill "alter table" process?
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]
Kill "alter table" process?
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 _ Find high-speed net deals comparison-shop your local providers here. https://broadband.msn.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Alter Table Process
On Fri, Mar 02, 2001 at 09:27:50AM +1300, Quentin Bennett wrote: > Hi, > > Would > > ALTER TABLE mytable ADD INDEX (somecol, othercol), ADD INDEX (othercol); > > do this in one sweep of the table, creating one temporary copy, or go > through the table twice, one for each index? > One run for the entire ALTER TABLE. Regards, Fred. -- Fred van Engen XO Communications B.V. email: [EMAIL PROTECTED] Televisieweg 2 tel: +31 36 5462400 1322 AC Almere fax: +31 36 5462424 The Netherlands - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Alter Table Process
Hi, Would ALTER TABLE mytable ADD INDEX (somecol, othercol), ADD INDEX (othercol); do this in one sweep of the table, creating one temporary copy, or go through the table twice, one for each index? Quentin Bennett Transport Systems Division Infinity Solutions web http:\\www.infinity.co.nz mailto:[EMAIL PROTECTED] Phone : +64 9 358 9720 Fax : +64 9 309 4142 The information contained in this email is privileged and confidential and intended for the addressee only. If you are not the intended recipient, you are asked to respect that confidentiality and not disclose, copy or make use of its contents. If received in error you are asked to destroy this email and contact the sender immediately. Your assistance is appreciated. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php