On Tue, Jan 16, 2001 at 05:05:13PM +0000, John Stumbles wrote:

>       [Apologies if this message hits the list twice: I sent it several
> hours ago but didn't see it on the list or get a bounce message (or get
> any response!) so I don't know what's happened to it.]
> 
>       I've noticed that when developing queries involving complex joins on
> tables I sometimes seem to get appallingly long times the first time I run
> a query, but the second and subsequent time I run it - even substituting
> a different value for a field value I'm matching on - the query runs
> quickly.
> 
>       Does mySQL do some behind-the-scenes reindexing the first time, or
> cache tables or indices, resulting in the speed differences I see? If so
> is there some way I can periodically force it to do whatever it's doing so
> I can ensure that queries are generally fast? Is this the point I should
> be going out and buying a book about mySQL? ;-)

That's fairly common. It's due to the fact that the data (and indexes)
are probably not cached in memory until the first time the query
runs. If you have sufficient free memory on your system, you might
consider increasing the size of your key_buffer.

But you'll want to experiment to see if that really helps.

Jeremy
-- 
Jeremy D. Zawodny, <[EMAIL PROTECTED]>
Technical Yahoo - Yahoo Finance
Desk: (408) 328-7878    Fax: (408) 530-5454
Cell: (408) 439-9951

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to