Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Recently, I moved from standard MySQL to Percona, and used the Percona Wizard to generate my.cnf.

However, I can see that, by default, the generated settings for my.cnf use query_cache_type = 0. (query cache is disabled).

The only thing I run on the server is a Wordpress blog. My questions are:

  1. May I enable query cache?
  2. There are some Wordpress plugins that offer database cache. Is the result similar of enabling query cache?
share|improve this question
up vote 4 down vote accepted

For a Wordpress blog it should be fine to set query_cache_type = 1. See, the major problems with the query cache are:

  1. It invalidates very easily (any update on some table invalidates all queries related to said table)

  2. It has a single mutex on which any incoming or outgoing query must go through.

The query cache was fine in the days where machines had one core, maybe two; it does not fare well with multiple cores and high concurrency, and it does not fare well with write intensive applications.

Your Wordpress blog is not likely to be write intensive: your writes are new posts, updates, comments... How many of these? You may not even counter them on a per-minute basis...

It would actually not be read intensive either. Hundreds of reads per day Thousands? That's nothing.

With regard plugins, that greatly depends on the plugin and on your deployment. Wordpress is written in PHP, and PHP might use such cache mechanisms as file system, memcached or APC. It should be typically "better" caching for the specific purpose it is oriented. That is, it will invalidate cached data based on real changes to relevant data -- not for irrelevant operations on some table. The programmers of the plugin would need to decide which pieces of data are important to cache, which are not, how invalidation works.

Again, in the scale of a blog, this is no big deal, and should not make a significant difference (of course there could always be some crazy plugin).

Bottom line: for your needs, anything goes and it does not matter much.

share|improve this answer

It depends on your DB type. If you use InnoDB, query cache is not required. Moreover query cache harms the speed of overall performance. Hence, if you use MyISAM for wordpress, you should use it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.