MySQL has a great feature called "Query Cache" which is quite helpful for MySQL Performance optimization tasks but there are number of things you need to know.
First let me clarify what MySQL Query Cache is - I've seen number of people being confused, thinking MySQL Query Cache is the same as Oracle Query Cache - meaning cache where execution plans are cached. MySQL Query Cache is not. It does not cache the plan but full result sets. This means it is much more efficient as query which required processing millions of rows now can be instantly summoned from query cache. It also means query has to be exactly the same and deterministic, so hit rate would generally be less. In any case it is completely different.
Query cache is great for certain applications, typically simple applications deployed on limited scale or applications dealing with small data sets. For example I'm using Query Cache on server which runs this …
[Read more]