Angelo, results should be (nearly) immediate. When you add an index,
MySQL creates an index for the existing data in your table. Later,
when data is added/updated/deleted, the index is updated
simultaneously.
With a few thousand rows, you should be able to get by adding a few
indexes where they seem to make sense. As your database grows, it
might be worth your while to go more in-depth with MySQL optimization.
The online manual has a good section at:
http://dev.mysql.com/doc/refman/5.0/en/optimization.html
and I also highly recommend Jeremy Zawodny's book "High Performance MySQL".
Dan
On 10/3/06, Angelo Zanetti <angelo@stripped> wrote:
> Hi all,
>
> 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?
>
> Thanks in advance.
>
> --
> ------------------------------------------------------------------------
> Angelo Zanetti
> Systems developer
> ------------------------------------------------------------------------
>
> *Telephone:* +27 (021) 469 1052
> *Mobile:* +27 (0) 72 441 3355
> *Fax:* +27 (0) 86 681 5885
> *
> Web:* http://www.zlogic.co.za
> *E-Mail:* angelo@stripped <mailto:angelo@stripped>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=1
>
>