4

I have turned on query_cache, and allocated memory for it:

| query_cache_limit            | 1048576    |
| query_cache_min_res_unit     | 4096       |
| query_cache_size             | 16777216   |
| query_cache_type             | ON         |
| query_cache_wlock_invalidate | OFF        |

But queries are not cached:

| Qcache_free_blocks             | 1        |
| Qcache_free_memory             | 16768400 |
| Qcache_hits                    | 0        |
| Qcache_inserts                 | 0        |
| Qcache_lowmem_prunes           | 0        |
| Qcache_not_cached              | 163      |
| Qcache_queries_in_cache        | 0        |
| Qcache_total_blocks            | 1        |

I use Innodb as storage engine, without transactions. The sample query which is not cached:

select * from `feed-ts`.feeds where id < 10;

It returns just one row.

Any ideas?

1 Answer 1

8

There's a bug in MySQL.

The query cache simply doesn't get used for queries on InnoDB tables that are in a database with a hyphenated name (like feed-ts).

"Renaming" your database seems to be the only solution for now.

2
  • Oh, such a mess :-S Thank you
    – zerkms
    Aug 23, 2011 at 1:44
  • The bug is apparently fixed as of MySQL 5.6.9. Jun 2, 2014 at 20:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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