开发者

query cache doesn't work

开发者 https://www.devze.com 2023-03-29 19:02 出处:网络
I have turned on query_cache, and allocated memory for it: query_cache_limit| 1048576| query_cache_min_res_unit| 4096|

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           开发者_Go百科  | 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消