On Thu, October 19, 2006 18:24, Ow Mun Heng said: > Just curious to know, > > I tried to update a table with ~1.7 million rows (~1G in size) and the > update took close to 15-20 minutes before it says it's done. > Is this kind of speed expected? > > I don't really understand how the alter table add column is done, but > when I look at the "show processlist" I see that it says the state is > "copying into tmp table" > > Does the alter table mean that MySQL has to copy the Entire table, > row-by-row into a temporary table, and add in the additional column (or > 2)?? > > I'm using InnoDB by the way > Basic process for any change which modifies the structure of the table is to create a temporary table with the new structure, copy the information from the old table table to the new one (modifying as needed to match the new structure), drop the old table and rename the new table to the old tables name. So the time might be realistic. It depends on the hardware you are using and what else is going on on the system.
Hope this helps. ------- William R. Mussatto, Senior Systems Engineer http://www.csz.com Ph. 909-920-9154 ext. 27 FAX. 909-608-7061 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]