Related Documentation Download this Manual
PDF (US Ltr) - 44.6Mb
PDF (A4) - 44.7Mb
PDF (RPM) - 40.5Mb
HTML Download (TGZ) - 10.5Mb
HTML Download (Zip) - 10.5Mb
HTML Download (RPM) - 9.1Mb
Man Pages (TGZ) - 205.6Kb
Man Pages (Zip) - 308.9Kb
Info (Gzip) - 3.9Mb
Info (Zip) - 3.9Mb
Excerpts from this Manual

query-cache

This page has moved or been replaced. The new page is located here:

http://dev.mysql.com/doc/refman/8.0/en/buffering-caching.html

Please update any bookmarks that point to the old page.


User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
  Posted by Nicolas Muller on March 14, 2013
Hi, we write a post talking about query cache in portuguese, if somebody need this information in that language -> http://www.oficinadanet.com.br/artigo/mysql/usando_o_cache_de_consultas_no_mysql
  Posted by Jose Luis Palacios on June 11, 2013
"mysqldump", with "--lock-all-tables" option, runs "FLUSH TABLES" / "FLUSH TABLES WITH READ LOCK" which purges entire query cache.

"mysqlcheck --optimize" runs "OPTIMIZE TABLE" which will invalidate the table and its referring queries from the query cache.
  Posted by Hayden James on July 10, 2014
Due to all the variations of MySQL setups, hardware specs and the fact that databases are all different in demand, query types, reads vs writes, etc, you will have to play around with what query cache config works for "you" and finding that query_cache_size sweet-spot as it were. A MySQL query cache size may be fast on one server but slow on another. Pay attn to prunes just as must as over sizing. I wrote more about this... http://haydenjames.io/mysql-query-cache-size-performance/
  Posted by Chris Wilson on August 15, 2014
The documentation above says that "The query cache does not return stale data. When tables are modified, any relevant entries in the query cache are flushed."

But this is not true in at least one case: loading data into the timezone tables does not invalidate cached queries using CONVERT_TZ. http://bugs.mysql.com/73604.
Sign Up Login You must be logged in to post a comment.