Question

I'd like to see a dump of my MySQL query cache file, but can't seem to figure out where it's stored. I'm on a Windows machine -- which doesn't make it easier.

Was it helpful?

Solution

Just went through the documentation and a few searches but there doesn't seem to be a file for the query cache.

The query cache operates by storing the data in memory (though it doesn't specify how exactly) though from the looks of it, with the constraint of "Queries must be exactly the same (byte for byte) to be seen as identical" it is likely that it is hashing the query.

You can view some information regarding the status of the query cache including free memory and hits on the cache, these are done with the SQL query SHOW STATUS LIKE 'Qcache%';. I haven't yet seen a command to allow full viewing of the cache though I am not sure it is possible (or useful) if they are hashing the queries. This StackOverflow answer also mentions regarding the possibility of hashing and not being able to view the data stored.

I'm going to take a guess by wanting to view the query cache you may also want to modify it's configuration. You can modify the cache size which may impact the overall performance of your queries for better or worse. Personally, I have never modified it and unless you are running some extremely large site, you might not need to.

OTHER TIPS

As far as i know, query cache is stored in memory, not in file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top