MySQL Forums
Forum List  »  Performance

Simple Performance Question
Posted by: Ted Elkind
Date: May 02, 2009 03:40PM

Short prelude. I'm working on some web software that uses MySQL. Most of my expertise is with Perl, HTML, css, Javascript, etc., and very little with MySQL.

I have a few queries I've been working on trying to tune. My queries are fairly simple, and so my approach is fairly simple. I run a query I've found to be slow (on the order of 20 or 30 seconds when it needs to be instant), and by inspection I can usually see what I've done wrong, like the order of columns in the index or a missing index. My test table has about a half-million entries, enough for problems to show themselves.

I work interactively in a MySQL command line window. I run the query, verify it's slow by looking at the elapsed time reported at the end, I inspect it, deduce and make a fix to the table (almost always a change to table indices), then rerun the query.

My problem is that the queries I'm working on now run super-fast after the first time I run them. First time it takes maybe 20 or 30 seconds. Second time it takes maybe something like .373 seconds, and the same fast speed for all subsequent queries. So I go off and do something else for a while, and when I come back the query runs slow again.

I've got the query cache turned off, with query_cache_limit and query_cache_size both set to 0.

My question is, how do turn off whatever optimizing or learning MySQL is doing so that the slow performance for a query is as bad for later attempts as it is for the first?

--Ted

Options: ReplyQuote


Subject
Views
Written By
Posted
Simple Performance Question
3300
May 02, 2009 03:40PM
2089
May 02, 2009 05:28PM
2168
May 03, 2009 06:34AM
2105
May 03, 2009 04:00PM
1843
June 28, 2009 04:06PM
1777
June 28, 2009 09:18PM
1863
July 04, 2009 09:28AM
1834
July 04, 2009 02:08PM
1749
July 07, 2009 09:25AM
1788
July 07, 2009 08:18PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.