Hi all,
I detected that my MySQL server's query_cache_size variable was set to 0, so it would not cache any queries. I set it to 16M, but still it wouldn't do any caching. (How do I know? MyAdmin tells me some stats:
Qcache queries in cache 0
Qcache inserts 0
Qcache hits 0
Qcache lowmem prunes 0
Qcache not cached 160
Qcache free memory 16768440 )
Any ideas on this? query_cache_type is set to 1, so it would cache anything, normally...
There are a bunch of other settings that start with query_cache...
SHOW VARIABLES LIKE 'query\_cache%';
-[Unknown]
hmmmm,
mysql> SHOW VARIABLES LIKE 'query\_cache%';
+-------------------+----------+
| Variable_name | Value |
+-------------------+----------+
| query_cache_limit | 2048 |
| query_cache_size | 16777216 |
| query_cache_type | ON |
+-------------------+----------+
3 rows in set (0.00 sec)
mysql> show status like 'Qc%';
+-------------------------+----------+
| Variable_name | Value |
+-------------------------+----------+
| Qcache_queries_in_cache | 0 |
| Qcache_inserts | 0 |
| Qcache_hits | 0 |
| Qcache_lowmem_prunes | 0 |
| Qcache_not_cached | 17547 |
| Qcache_free_memory | 16768440 |
| Qcache_free_blocks | 1 |
| Qcache_total_blocks | 1 |
+-------------------------+----------+
8 rows in set (0.00 sec)
It's a MySQL 4.0.23 on W2K3 Server. Not that it's slow or so, but I'd be interested to tweak it anyway.
Looks like you have your limit set extreamly low, anything over the limit wont be cached, so I imagine everything is bigger than that limit hence it isn't being cached,
Oh dear, my fault, you are so right. Maybe I thought those were kilobytes...