On Tue 18 May 02004 at 12:26:41PM -0700, David Griffiths wrote: > > Is that the only table in your MySQL installation?
Yes, and no one has access to it yet but me. > > MyISAM primary keys are put in a b-tree index, which is cached by MySQL > in memory in the key_buffer_size parameter. What is it set to on your > system (the my.cnf file, probably in /etc or /var)? key_buffer_size does not appear in my.cnf. Is the default sensible for my setup? > > The second time you run it, the index is definately in memory, which is > why it is so fast. > > Perhaps the OS is swapping MySQL pages out to disk, or perhaps there is > not enough memory allocated to the key-buffer to keep the index in memory. > > The more frequently you access data, the more likely it is to be cached > by the OS or the database. Not sure what is running on your system or > how it is configured, but the amount of memory you have looks a bit > light. Databases are much faster with more memory. > > David. > There are other services on this machine, but the load is rarely above 0.05. I hear what you're saying about memory, but I really don't understand why a btree lookup would be so dramatically slow compared to a linear search with grep. Would something other than MyISAM be more appropriate here? The chances of a given row being returned more than once per day is very small, so caching the result doesn't help a lot. -- Jacob Elder -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]