Re: dropping primary key - 99%CPU

2006-06-10 Thread ebergen
Gaspar Bakos wrote: Hi, Dan, RE: Currently mysql handles all "ALTER TABLE" commands by rebuilding the entire table and all indexes. OK, so an "add index" is mapped to "alter table", and the "alter table" rebuilds everything. This means if I have a table with multiple indexes, it does

Re: dropping primary key - 99%CPU

2006-06-10 Thread mos
At 04:29 PM 6/10/2006, you wrote: Hi, Dan, RE: > Currently mysql handles all "ALTER TABLE" commands by rebuilding the > entire table and all indexes. OK, so an "add index" is mapped to "alter table", and the "alter table" rebuilds everything. This means if I have a table with multiple indexes,

Re: dropping primary key - 99%CPU

2006-06-10 Thread Gaspar Bakos
Hi, Dan, RE: > Currently mysql handles all "ALTER TABLE" commands by rebuilding the > entire table and all indexes. OK, so an "add index" is mapped to "alter table", and the "alter table" rebuilds everything. This means if I have a table with multiple indexes, it does not make too much sense to

Re: dropping primary key - 99%CPU

2006-06-10 Thread Dan Nelson
In the last episode (Jun 10), Gaspar Bakos said: > Could someone explain why dropping a primary key of a table (of > ~1million rec) may take up to minutes of time and 99%CPU? > > Naively, I would have thought that this involves only updating the > index file. Currently mysql handles all "ALTER TA

dropping primary key - 99%CPU

2006-06-10 Thread Gaspar Bakos
Hi, Could someone explain why dropping a primary key of a table (of ~1million rec) may take up to minutes of time and 99%CPU? Naively, I would have thought that this involves only updating the index file. However, all the .MYD, MYI and .frm files are duplicated (#sql-*), and then something happe