I noticed something weird on MySQL query_cache behavior and I would like to know if this is a normal behavior.
Let's say I have an item table
ID | Item
-----------
1 | Item_1
2 | Item_2
3 | Item_3
The query that will be used here is : SELECT id FROM items
The first time I use it I have a +1 in my status Qcache_inserts, the second time I use it I have +1 to Qcache_hits. Perfect it's working fine.
Now if I use this query : SELECT COUNT(1) FROM (SELECT id FROM items) my_table
The subquery SELECT id FROM items
is supposed to already be present in the cache, but I can't get any hit.
Aren't subquery simple thread that executes first ? Then why it is not hitting my query cache ?