At 10:39 AM 3/18/2002, you wrote: >Greetings, > >We're running MySQL 3.23.47 on MacOS X 10.1.2. We've got a rather large >table ( 200,000+ records, 120+ columns) and some simple queries on that >table have pretty inconsistent performance. Due to licensing issues I >can't give an actual example of the table, but here is an equivalent >example: > >Field1 and Field2 are both unsigned integers >IndexField1 is an unsigned integer and is the primary key > >select Field1,Field2 from table1 where IndexField1 = 345232; > >We ran this query will different values for IndexField1, sometimes it >would return in around 0.01 seconds, other times it would take as long >as 9 seconds. There was no other load on the database when this was >occurring, and it was specific to certain records (one IndexField1 would >always return around 8 seconds, others would always return around 0.01 >seconds). > >Is there any kind of reasonable explanation for this behavior? Is it >perhaps because of where the records are situated on the hard disk (seek >times)? Is it maybe a caching issue? > >Thanks for any help. > >- Gabriel Ricard
Gabriel, The select you described should take very little time, like around 0.01 seconds. But 9 seconds on a primary key? It appears that it wasn't using the index. You may want to try the "Explain select Field1,Field2 from table1 where IndexField1 = 345232;" to see if the index was used. Also you may want to rebuild the index by dropping it and creating it again in case the index was corrupted. You can also run "myisamchk --analyze pathtodatabase/table to see if the Explain changes on the query. Brent _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com --------------------------------------------------------------------- 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