Show status like 'Qcache_queries_in_cache' returns:
+-------------------------+----------+
| Variable_name | Value |
+-------------------------+----------+
| Qcache_queries_in_cache | 327 |
+-------------------------+----------+
How do I print these 327 queries?
In an attempt to optimize mysql caching I want to trying switching to "on demand" caching. But before I do I want to get a definitive sense of which queries are being cached or discarded. I tried mysql docs, google, and stackoverflow search but no luck.
解决方案
AFAIK sql queries are not stored into Qcache only their hash. So there is no way to find what queries are now cached exept you execute one of your query and see the changes of Value column.