我打开了query_cache,并为它分配了内存:
| query_cache_limit | 1048576 |
| query_cache_min_res_unit | 4096 |
| query_cache_size | 16777216 |
| query_cache_type | ON |
| query_cache_wlock_invalidate | OFF |
但查询不会缓存:
| 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 |
我使用Innodb作为存储引擎,没有交易.未缓存的示例查询:
select * from `feed-ts`.feeds where id < 10;
它只返回一行.
有任何想法吗?
解决方法:
查询缓存根本不会用于具有连字符名称的数据库(如feed-ts)中的InnoDB表上的查询.
“Renaming”您的数据库似乎是目前唯一的解决方案.
标签:mysql
来源: https://codeday.me/bug/20190610/1209931.html