I was experiencing some problems with duplicate queries slowing down rendering a HTML table (very similar select queries inside a while loop). So I created some simple caching functions (php):
check_cache()write_cache()return_cache()
These functions prevent the server from asking anything from the database. Which sped things up quite a lot!
Later I read that MySQL caches SELECT statements:
The query cache stores the text of a SELECT statement together with the corresponding result that was sent to the client. If an identical statement is received later, the server retrieves the results from the query cache rather than parsing and executing the statement again.
Why does this increase performance if MySQL is already doing this?
query_cache_size 0doh! My local server is set to16777216which is probably why I got confused, that's what I'm going to blame it on anyway, one day I'll stop looking stupid on this site ;)