From: Dan Nelson Date: October 3 2006 9:53pm Subject: Re: creating indexes on a table already containing data List-Archive: http://lists.mysql.com/mysql/202298 Message-Id: <20061003215323.GB54791@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In the last episode (Oct 03), Angelo Zanetti said: > I've got a database that has a few thousand rows, I've noticed that > some of the search queries (especially the large ones) are taking > some time. Im looking at adding indexes to my tables in order to > speed up the data retrieval. > > My question is as follows: At this point in time if I add the indexes > to the various tables should I see immediate results in the query > times or do I have to wait for new information to enter the database > (only new data gets indexed?) > > When does the data actually get indexed? Is it when its inserted or > continually when regards are inserted or updated in the database? When you add an index, Mysql builds a complete index of your table immediately. For a few thousand rows it should take under a minute. The index will automatically be updated as you insert rows or change existing ones. -- Dan Nelson dnelson@stripped