You are here

query cache

MySQL Query Cache does not work with Complex Queries in Transactions

We did recently a review of one of our customers systems and we found that the Query Cache was disabled even thought it had significant more read than write queries.
When we asked the customer why he has not enabled the Query Cache he mentioned a review that was done a few years ago and which stated that the Query Cache hit ratio was non optimal.
This was verified on a testing system which had the Query Cache enabled by accident.

But we all thought that the Query Cache would make sense in this situation so we investigated a bit more.

Regularly flushing the MySQL Query Cache

Taxonomy upgrade extras: 

When we analyze our customers systems we see typically a high fragmentation of the query cache after a while. This leads to a less optimal use of the Query Cache than possible.

With the following Query you can see the values for your Query Cache:

Typical automated MySQL maintenance jobs, query cache

The following maintenance jobs are typically run against a MySQL database:

  • Backup
  • Clean-up binary logs
  • Optimize tables
  • Purge query cache
  • Rotate binary logs

Backup

A backup is not a typical maintenance job. But it behaves more or less like one. The backup should be done regularly depending on the restore/PITR (Point in Time Recovery) requirements.

Subscribe to RSS - query cache