Bug #11870 Include QUERY CACHE information in EXPLAIN output
Submitted: 11 Jul 2005 20:43 Modified: 7 Jul 9:14
Reporter: Kolbe Kegel Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Query Cache Severity:S4 (Feature request)
Version: OS:Any
Assigned to:
Triage: Triaged: D5 (Feature request)

[11 Jul 2005 20:43] Kolbe Kegel
Description:
The output of EXPLAIN, or an alternative command, should show information about whether the result of a query will be stored in the Query Cache.

How to repeat:
n/a

Suggested fix:
The information provided could include whether or not the query is cacheable, and if not it could give the reason (ie. refers to UDF, refers to user-defined variable, refers to non-idempotent function, etc). It could also be shown whether the query is already in the cache and how much space the result for the query uses in the query cache.

Possible implementations include an additional column of output in EXPLAIN, which could either be automatically included or triggered by EXPLAIN SQL_CACHE SELECT or some other syntax. Another possibility is to show this output only if it is asked for explicitly, and to show the output independent of any other output.
[24 Mar 2011 18:38] Roberto Spadim
bug 23714 is a source of information about cache size
[7 Jul 9:14] Erlend Dahl
MySQL will no longer invest in the query cache, see:

http://mysqlserverteam.com/mysql-8-0-retiring-support-for-the-query-cache/