From: Martijn Tonies Date: April 12 2007 12:44pm Subject: Re: when rebuilding keys? List-Archive: http://lists.mysql.com/mysql/206096 Message-Id: <017301c77d00$604d5020$9902a8c0@martijnws> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit > >> >> before load data. > >> > > >> > You want to rebuild the indices after loading data, > >> > correct? > > > > Then what exactly is the question? > > > > > > Please write your answer BELOW, not above. > > sorry ,my english is poor. > > There is a observable event. > My table's engine is myisam. > Rows above 1000000 in my table. > I did "alter table ......disable keys" before loading data. > I did "alter table ......enable keys" after loading data. > The operation of enable keys is so fast! > > I am not sure than if the keys have been rebuild.I think the course of > rebuilding should need very long time. According to the documentation: ALTER TABLE ... ENABLE KEYS then should be used to re-create missing indexes. MySQL does this with a special algorithm that is much faster than inserting keys one by one, so disabling keys before performing bulk insert operations should give a considerable speedup. Martijn Tonies Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle & MS SQL Server Upscene Productions http://www.upscene.com My thoughts: http://blog.upscene.com/martijn/ Database development questions? Check the forum! http://www.databasedevelopmentforum.com If you can't dazzle em with brilliance, baffle em with bullshit